Home » Eclipse Projects » Rich Client Platform (RCP) » RCP + JWS can't find classes from external bundles
RCP + JWS can't find classes from external bundles [message #458811] |
Fri, 24 November 2006 18:22  |
Eclipse User |
|
|
|
Again I'm in trouble with Java Web Start and a RCP application. After one week struggeling with with tons of error messages, I arrived to get my RCP application running, but everything has to be in a single plug-in. After this success I wanted to sepparate the libraries again.
The structure:
- application plug-in
- hibernate core plug-in
- model classes plug-in
- mysql driver plug-in
application plug-in requires:
- hibernate core plug-in
- model classes plug-in
First I have to say that everything works fine in the IDE and also when exported as a product. But when I deploy my application via Web Start I get the following exception:
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at com.xxxx.xxxx.views.View.<clinit>(View.java:40)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:170)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:787)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:234)
at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:69)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:292)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActive(WorkbenchPage.java:3881)
at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:2905)
at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1933)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:2867)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1675)
at org.eclipse.ui.internal.Workbench.access$12(Workbench.java:1660)
at org.eclipse.ui.internal.Workbench$17.run(Workbench.java:1539)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1483)
at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:702)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1094)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1857)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.xxxx.xxxx.Application.run(Application.java:28)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341)
at org.eclipse.core.launcher.Main.basicRun(Main.java:285)
at org.eclipse.core.launcher.WebStartMain.basicRun(WebStartMain.java:59)
at org.eclipse.core.launcher.Main.run(Main.java:987)
at org.eclipse.core.launcher.WebStartMain.main(WebStartMain.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1154)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1101)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:944)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:515)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:218)
at com.sun.javaws.Launcher.run(Launcher.java:165)
at java.lang.Thread.run(Thread.java:595)
This are my Manifest and build files:
<b>Application Manifest:</b>
[code]
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Application Plug-in
Bundle-SymbolicName: com.xxxx.xxxx; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: com.xxxx.xxxx.Activator
Bundle-Vendor: xxxx
Bundle-Localization: plugin
Export-Package: .,
com.xxxx.xxxx,
com.xxxx.xxxx.actions,
com.xxxx.xxxx.dao,
com.xxxx.xxxx.dialogs,
com.xxxx.xxxx.exceptions,
com.xxxx.xxxx.listeners,
com.xxxx.xxxx.model,
com.xxxx.xxxx.persistence,
com.xxxx.xxxx.statics,
com.xxxx.xxxx.tools,
com.xxxx.xxxx.views,
com.xxxx.xxxx.wizards
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.forms,
org.hibernate.eclipse,
com.xxxx.xxxx.model
Eclipse-LazyStart: true
Eclipse-RegisterBuddy: org.hibernate.eclipse
[code]
<b>Application build:</b>
source.. = src/
output.. = bin/
bin.includes = .,\
plugin.xml,\
META-INF/,\
icons/,\
splash.bmp,\
log4j.xml
<b>Hibernate manifest:</b>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Eclipse Plug-in
Bundle-SymbolicName: org.hibernate.eclipse
Bundle-Version: 1.0.0
Bundle-ClassPath: .,
cglib-2.1.jar,
...
junit-3.8.1.jar,
log4j-1.2.11.jar,.
...
hibernate3.jar
Bundle-Vendor: Hibernate
Export-Package: .,
...
org.apache.html.dom,
org.apache.log4j,
org.apache.log4j.chainsaw,
org.apache.log4j.config,
org.apache.log4j.helpers,
org.apache.log4j.jdbc,
org.apache.log4j.jmx,
org.apache.log4j.lf5,
org.apache.log4j.lf5.util,
org.apache.log4j.lf5.viewer,
org.apache.log4j.lf5.viewer.categoryexplorer,
org.apache.log4j.lf5.viewer.configure,
org.apache.log4j.net,
org.apache.log4j.nt,
org.apache.log4j.or,
org.apache.log4j.or.jms,
org.apache.log4j.or.sax,
org.apache.log4j.spi,
org.apache.log4j.varia,
org.apache.log4j.xml,
org.apache.regexp,
org.apache.tools.ant,
...
versioncheck
Eclipse-BuddyPolicy: registered
Require-Bundle: com.mysql.eclipse
<b>Hibernate build:</b>
bin.includes = META-INF/,\
.,\
cglib-2.1.jar,\
...
log4j-1.2.11.jar,\
...
hibernate3.jar
Obviously the problem is that my external bundles aren't found.
I already solved another class loading problem I had in the single plug-in application. I always got this ClassNotFound- and SecurityException:
Caused by: java.lang.SecurityException: class "com.xxxx.xxxx.xxxx.MyClass$$EnhancerByCGLIB$$9c94f40"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:775)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)
at java.lang.ClassLoader.defineClass(ClassLoader.java:614)
What solved the problem was to add this in the run method of my Application class:
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
the output of this code
System.out.println(Thread.currentThread().getContextClassLoader());
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
System.out.println(Thread.currentThread().getContextClassLoader());
in the run method is this:
org.eclipse.core.runtime.internal.adaptor.ContextFinder@1a8d460
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@40ece0
If anybody has an idea what I could have setup wrong, I would be very thankful. Since two weeks I'm trying to get my Web Start app working and with the help of this forum I already solved lots of issues. I hope that this is going to be the last issue to solve to get my RCP app running on Web Start.
Regards
Peter
|
|
|
Re: RCP + JWS can't find classes from external bundles [message #459273 is a reply to message #458811] |
Wed, 29 November 2006 15:49  |
Eclipse User |
|
|
|
OK, I solved the problem.
the problem was this missing line in the Manifest file of the application plug-in:
I don't really understand why this line is important to find classes of external plug-ins, but it solved the problem.
Another thing that I don't understand, is why I do have to set the classpath explicitely in the application plug-in, to prevent the SecurityException from cglib.
At least the application works now with Java Web Start.
If you have answers to my questions I would nevertheless be very interested in hearing them.
Regards
Peter
|
|
|
Goto Forum:
Current Time: Fri Mar 21 04:17:42 EDT 2025
Powered by FUDForum. Page generated in 0.07368 seconds
|