[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-5080) java.lang.ClassCastException: $Proxy0 cannot be cast to org.mozilla.interfaces.nsIWebBrowser after updating JBT to Version: 1.1.0.v200910220041N-H228-M4

Snjezana Peco (JIRA) jira-events at lists.jboss.org
Mon Nov 9 12:59:05 EST 2009


    [ https://jira.jboss.org/jira/browse/JBIDE-5080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12493823#action_12493823 ] 

Snjezana Peco commented on JBIDE-5080:
--------------------------------------

The problem happens because the org.mozila.xpcom plugin is not a singleton and Eclipse resolves both of the versions (1.8.x and 1.9.x) of this plugin. Since the plugins that require this plugin don't declare the minimal required version, the Eclipse loader loads the org.mozilla.* classes either from org.mozilla.xpcom version 1.8 or from 1.9. If it loads the classes from the 1.8 version, you will get java.lang.ClassCastException.

The problem can't be solved by adding singleton=true to org.mozilla.xpcom 1.9 since the 1.8  version has already been installed. I believe the solution would be that all the plugins that depend on org.mozilla.xpcom declare 1.9.0 (or 1.9.1) as the minimal required version of this plugin. org.mozilla.xpcom 1.8 contains the "Eclipse-BuddyPolicy: registered" declaration, but it is not used. The org.mozilla.xpcom 1.9 doesn't contain "Eclipse-BuddyPolicy: registered" declaration. org.mozilla.xulrunner.* plugins look correctly (they are singleton plugins).


> java.lang.ClassCastException: $Proxy0 cannot be cast to org.mozilla.interfaces.nsIWebBrowser after updating JBT to Version: 1.1.0.v200910220041N-H228-M4
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-5080
>                 URL: https://jira.jboss.org/jira/browse/JBIDE-5080
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Visual Page Editor core
>    Affects Versions: 3.1.0.M4
>            Reporter: Anton Klimkovich
>            Assignee: Denis Golovin
>            Priority: Blocker
>             Fix For: 3.1.0.CR1
>
>
> EXECUTE: Update JBT to Version: 1.1.0.v200910220041N-H228-M4 using update site
> EXECUTE: Open any xhtml page
> FAILURE:   
> java.lang.ClassCastException: $Proxy0 cannot be cast to org.mozilla.interfaces.nsIWebBrowser
> at org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser.<init>(XulRunnerBrowser.java:89)
> at org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor.<init>(XulRunnerEditor.java:135)
> at org.jboss.tools.vpe.editor.mozilla.MozillaPreview$1.<init>(MozillaPreview.java:58)
> at org.jboss.tools.vpe.editor.mozilla.MozillaPreview.createPartControl(MozillaPreview.java:58)
> at org.jboss.tools.vpe.editor.VpeEditorPart.createPreviewBrowser(VpeEditorPart.java:925)
> at org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor.pageChange(JSPMultiPageEditor.java:217)
> at org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditorPart$2.widgetSelected(JSPMultiPageEditorPart.java:106)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:770)
> at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3256)
> at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2045)
> at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:323)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
> 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.equinox.launcher.Main.invokeFramework(Main.java:559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list