[ 
https://issues.apache.org/jira/browse/DIRSTUDIO-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580364#action_12580364
 ] 

Pierre-Arnaud Marcelot commented on DIRSTUDIO-301:
--------------------------------------------------

This really looks like a ClassLoader issue.

The Eclipse documentation indicates that each plugin has its own ClassLoader 
but it seems like Apache Directory Studio plugins and your Application plugins 
share the same ClassLoader (which could explain the ClassCastException).

You can try to edit the Studio jars plugin to use the same dom4j dependency you 
use, but I'm really not sure it will work. The API must changed between 1.5.2 
and 1.6.1 versions.

> Intermittant ClassCastException from dom4j.DocumentFactory.getInstance()
> ------------------------------------------------------------------------
>
>                 Key: DIRSTUDIO-301
>                 URL: https://issues.apache.org/jira/browse/DIRSTUDIO-301
>             Project: Directory Studio
>          Issue Type: Bug
>          Components: studio-connection
>    Affects Versions: 1.1.0
>         Environment: Eclipse 3.3
> Java 1.5.0_11
> Windows XP Pro
>            Reporter: John Buslawski
>            Priority: Critical
>             Fix For: 1.1.0
>
>
> We've integrated Directory Studio 1.1 0 into our Eclipse application and we 
> occasionally see the following stack trace when we select the Finish button 
> while defining a new connection via the New LDAP Connection wizard. The stack 
> trace display each time the Finish button is displayed and the wizard never 
> completes. You always have to cancel the wizard. Most of the time the wizard 
> works fine but occasionally it has this problem.
> We see a similar stack trace with ClassCastException from 
> DocumentFactory.getInstance() when we launch our application and we have 
> previously defined LDAP connections. It appears as though Directory Studio is 
> trying to read the persisted connection definitions but cannot due to the 
> exception. The appearance is that your previously defined connections do not 
> appear in the Connections view but if you try to define a connection with a 
> previously defined (but now invisible) connection name you will get a message 
> about a duplicate name. This problem is also intermittant and sometimes it 
> seems to depend on what perspective is loaded during the launch.
> After researching this problem I found the following link that seems to be 
> related to just this issue with dom4j-1.6.1.jar which Directory Studio 
> bundles in org.apache.directory.studio.jars_1.1.0.v20080303.jar. 
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg01282.html
> [dom4j-dev] [ dom4j-Bugs-1618750 ] ClassCastException while creating 
> org.dom4j.DocumentFactory
> It's not clear what the fix should be after reading this thread. We use 
> dom4j-1.5.2.jar in our application have never seen an issue like this. I was 
> tempted to replace the dom4j-1.6.1.jar with dom4j-1.5.2.jar in 
> org.apache.directory.studio.jars_1.1.0.v20080303.jar to see if it would fix 
> the problem but I wasn't sure what other impacts, if any, that might cause.
> These issues, especially the invisible connections, are a real annoyance for 
> our users so I'm marking this issue as critical. We would really like to see 
> this addressed before Directory Studio reaches GA.
> !STACK 0
> java.lang.ClassCastException: org.dom4j.DocumentFactory
>       at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
>       at org.dom4j.DocumentHelper.getDocumentFactory(DocumentHelper.java:36)
>       at org.dom4j.DocumentHelper.createDocument(DocumentHelper.java:41)
>       at 
> org.apache.directory.studio.connection.core.io.ConnectionIO.saveConnectionFolders(ConnectionIO.java:444)
>       at 
> org.apache.directory.studio.connection.core.ConnectionFolderManager.saveConnectionFolders(ConnectionFolderManager.java:339)
>       at 
> org.apache.directory.studio.connection.core.ConnectionFolderManager.connectionAdded(ConnectionFolderManager.java:284)
>       at 
> org.apache.directory.studio.connection.core.event.ConnectionEventRegistry$4.run(ConnectionEventRegistry.java:250)
>       at 
> org.apache.directory.studio.connection.core.event.CoreEventRunner.execute(CoreEventRunner.java:41)
>       at 
> org.apache.directory.studio.connection.core.event.ConnectionEventRegistry.fireConnectionAdded(ConnectionEventRegistry.java:257)
>       at 
> org.apache.directory.studio.connection.core.ConnectionManager.addConnection(ConnectionManager.java:119)
>       at 
> org.apache.directory.studio.connection.ui.wizards.NewConnectionWizard.performFinish(NewConnectionWizard.java:165)
>       at 
> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
>       at 
> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
>       at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:616)
>       at 
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
>       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
>       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
>       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
>       at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
>       at org.eclipse.jface.window.Window.open(Window.java:796)
>       at 
> org.apache.directory.studio.connection.ui.actions.NewConnectionAction.run(NewConnectionAction.java:68)
>       at 
> org.apache.directory.studio.connection.ui.actions.StudioActionProxy.run(StudioActionProxy.java:238)
>       at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
>       at 
> org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
>       at 
> org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
>       at 
> org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)
>       at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
>       at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
>       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
>       at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
>       at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
>       at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
>       at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
>       at 
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
>       at 
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
>       at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
>       at 
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
>       at 
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
>       at 
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
>       at 
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
>       at 
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
>       at 
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
>       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:504)
>       at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
>       at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
>       at org.eclipse.equinox.launcher.Main.main(Main.java:1144)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to