Eclipse:无法使用编辑器打开 Jspf

Posted

技术标签:

【中文标题】Eclipse:无法使用编辑器打开 Jspf【英文标题】:Eclipse: Jspf can't be open with Editor 【发布时间】:2021-12-21 10:12:50 【问题描述】:

我的编辑器无法在 Eclipse 中打开 JSPF 文件。

当我转到:“文件关联”和“内容类型”菜单时,jspf 与“JSP 编辑器”相关联,但它不起作用。

当我尝试打开“.jspf 文件”时,我收到以下消息:

Unsupported content type in editor.
To associate file extension with a supported content type,
please see Content Types Preference Page

并记录错误

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.507
!MESSAGE StructuredTextEditor being used without StructuredDocument

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.507
!MESSAGE          Input Name: doDBMailMessageAttachements.jspf

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.508
!MESSAGE         Unexpected IDocumentProvider implementation: org.eclipse.ui.editors.text.TextFileDocumentProvider

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.508
!MESSAGE         Unexpected IDocument implementation: org.eclipse.core.internal.filebuffers.SynchronizableDocument

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.507
!MESSAGE StructuredTextEditor being used without StructuredDocument

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.507
!MESSAGE          Input Name: doDBMailMessageAttachements.jspf

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.508
!MESSAGE         Unexpected IDocumentProvider implementation: org.eclipse.ui.editors.text.TextFileDocumentProvider

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-08 15:04:45.508
!MESSAGE         Unexpected IDocument implementation: org.eclipse.core.internal.filebuffers.SynchronizableDocumen

编辑:

我只有一个额外的插件,即“增强类反编译器”。

新日志错误:

!SESSION 2021-11-09 17:14:19.378
----------------------------------------------- eclipse.buildId=4.21.0.I20210906-0500 java.version=16.0.2 java.vendor=Oracle Corporation BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_FR Framework arguments:  -product org.eclipse.epp.package.jee.product Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.jee.product -consoleLog

!ENTRY org.eclipse.jface 2 0 2021-11-09 17:14:23.971 !MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2021-11-09 17:14:23.971 !MESSAGE A conflict occurred for COMMAND+SHIFT+T: Binding(COMMAND+SHIFT+T,    ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,       Open a type in a Java editor,       Category(org.eclipse.ui.category.navigate,Navigate,null,true),      org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2330c995,        ,,true),null),  org.eclipse.ui.defaultAcceleratorConfiguration,     org.eclipse.ui.contexts.window,,,system) Binding(COMMAND+SHIFT+T,   ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,         ,       Category(org.eclipse.lsp4e.category,Language Servers,null,true),        org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7d086485,        ,,true),null),  org.eclipse.ui.defaultAcceleratorConfiguration,     org.eclipse.ui.contexts.window,,,system)

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-09 17:14:31.813 !MESSAGE StructuredTextEditor being used without StructuredDocument

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-09 17:14:31.814 !MESSAGE     Input Name: doMailBody.jspf

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-09 17:14:31.814 !MESSAGE     Unexpected IDocumentProvider implementation: org.eclipse.ui.editors.text.TextFileDocumentProvider

!ENTRY org.eclipse.wst.sse.ui 2 2 2021-11-09 17:14:31.815 !MESSAGE     Unexpected IDocument implementation: org.eclipse.core.internal.filebuffers.SynchronizableDocument

!ENTRY org.eclipse.ui.navigator 2 0 2021-11-09 17:14:32.391 !MESSAGE Can't find Navigator Content Descriptor with id: org.eclipse.jst.servlet.ui.EnhancedJavaRendering

!ENTRY org.eclipse.ui.navigator 2 0 2021-11-09 17:14:32.391 !MESSAGE Can't find Navigator Content Descriptor with id: org.eclipse.jst.servlet.ui.EnhancedJavaRendering

【问题讨论】:

请以!SESSION 开头显示您的日志(删除日志,重现问题并添加整个日志)。右键单击打开方式菜单显示什么?您是否在 Eclipse 中安装了其他插件? 【参考方案1】:

这是因为: "内容类型" => "自定义内容类型",

在没有关联编辑器的情况下创建了文件关联“*.jspf”。

我删除了这个关联,它工作正常。

【讨论】:

以上是关于Eclipse:无法使用编辑器打开 Jspf的主要内容,如果未能解决你的问题,请参考以下文章

使用 jspf 钩子自定义 LifeRay portlet

如何防止eclipse工程Java代码或js代码打开而左边的目录却无法展开并定位

Eclipse CDT 编辑器无法识别 OpenGL 扩展

如何使eclipse 显示两个窗口

使用 Ctrl+s 在 Eclipse 中保存多个文件会导致“无法编辑文件”

无法使 Xdebug 与 Eclipse PDT 一起工作