templates not working

tauchsieder wrote on Fri May  4 10:50:38 MEST 2007:
Hi,

I am using Eclipse 3.2.2 running under Win XP Prof and EPIC 0.5.35. But
two features are not working: code completion and templates. The eclipse
error log gives me this error message:

org.epic.perleditor.editors.PerlEditor cannot be cast to org.eclipse.jdt.internal.ui.javaeditor.JavaEditor

Any ideas are very welcome!

Cheers,
Stefan
jploski wrote on Fri May  4 20:05:08 MEST 2007:
Could you also provide a complete stack trace from the error log?
tauchsieder wrote on Mon May  7 13:55:43 MEST 2007:
Sure:

java.lang.ClassCastException: org.epic.perleditor.editors.PerlEditor cannot
be cast to org.eclipse.jdt.internal.ui.javaeditor.JavaEditor
at org.eclipse.jdt.internal.ui.text.java.JavaContentAssistHandler.getActiveEditor(JavaContentAssistHandler.java:60)
at org.eclipse.jdt.internal.ui.text.java.JavaContentAssistHandler.execute(JavaContentAssistHandler.java:40)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:151)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:461)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:424)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:160)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:466)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:799)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:846)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:564)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:506)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:122)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:982)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:927)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1932)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)


Cheers,
Stefan
jploski wrote on Tue May  8 21:36:55 MEST 2007:
The problem seems to be that the "command" associated with a key stroke
is routed to the wrong handler (the Java handler, not the Perl handler).
Normally, when you switch focus from Java editor to Perl editor, the associations
of commands such as autocomplete with handlers are updated to reflect the
current context. For some strange reason this did not/does not occur in
your case.

Can you reproduce this problem still? Is there anything "special" about
your Eclipse configuration? For example, could you try with a fresh Eclipse
3.2.2 install and see if this problem can be reproduced in it?
tauchsieder wrote on Wed May  9 08:59:56 MEST 2007:
I am working with a fresh and new Eclipse 3.2.2 Build id: M20070212-1330
installation, the only plugin installed is EPIC. In my company my computer
is not the only one with this problem, but there also computers where templates
are working.

Cheers,
Stefan

Note: The above is an archived snapshot of a forum thread. Use the original thread at sf.net to post comments.