Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Help with the resolving a classloader issue
Help with the resolving a classloader issue [message #539415] Thu, 10 June 2010 16:08 Go to next message
Simon Chemouil is currently offline Simon ChemouilFriend
Messages: 24
Registered: July 2009
Junior Member
Hello,

I am currently developing an E4 application that's working with no
problem when launched from Eclipse, but that I can't get to work using a
configuration I generate myself on an integration server.

I have talked of this on IRC with some E4 devs but they don't have the
problem so they couldn't help me, and it is related to equinox so this
newsgroup is my last hope ;).

I get this stacktrace when starting my program:
java.lang.NoClassDefFoundError: org/w3c/dom/css/DocumentCSS
at
org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngine.<init>(ThemeEngine.java:55)
at
org.eclipse.e4.ui.css.swt.internal.theme.ThemeEngineManager. getEngineForDisplay(ThemeEngineManager.java:24)
at
org.eclipse.e4.ui.workbench.swt.internal.CSSStylingSupport.i nitializeStyling(CSSStylingSupport.java:39)
at
org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine $3.run(PartRenderingEngine.java:463)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .run(PartRenderingEngine.java:457)
at
org.eclipse.e4.workbench.ui.internal.E4Workbench.createAndRu nUI(E4Workbench.java:102)
at
org.eclipse.e4.ui.workbench.swt.internal.E4Application.start (E4Application.java:83)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
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(EclipseS tarter.java:369)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.main(Eclipse Starter.java:150)
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.css.DocumentCSS
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInter nal(BundleLoader.java:506)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:422)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(Bund leLoader.java:410)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 14 more


DocumentCSS is an interface that is present in java 1.6 (which I'm using
to run Equinox) and should not require any bundle exporting it (but it
is also in javax.xml as packaged on Orbit, and using it did not work
either).

In ThemeEngine's constructor, line 55, a new object of type
CSSSWTEngineImpl is instanciated, and this class inherits from another
class that imports DocumentCSS.


My question here is: what could be the causes of this problem? Is this a
bug with Equinox? It is tricky for me to debug it fully since it is
running on an integration server.

Equinox seems to have all its bundles satisfied, there is no missing
bundle message.

I'll provide any file or output needed to find more, and I will greatly
appreciate any help.

Thanks,

--
Simon Chemouil
Re: Help with the resolving a classloader issue [message #539629 is a reply to message #539415] Fri, 11 June 2010 14:43 Go to previous messageGo to next message
Simon Chemouil is currently offline Simon ChemouilFriend
Messages: 24
Registered: July 2009
Junior Member
Simon Chemouil a écrit :
> Hello,
>
> I am currently developing an E4 application that's working with no
> problem when launched from Eclipse, but that I can't get to work using a
> configuration I generate myself on an integration server.

10 minutes after posting this yesterday, I realized that since
ClassNotFoundException was caused it meant the bundle trying to find it
wasn't explicitely stating it needed to use it, or I would have an had a
message stating that the required bundle/imported package is not found.

So I changed the e4 bundle to add an explicit import package on
org.w3c.dom.css and I got that message that the package was not exported
by any bundle, so it could not be found.

I then went on to add a Require-Bundle directive to that bundle, +
reexport, on javax.xml (which I explicitely start in the config.ini file
to make sure the services are started). It worked! But...

After that the same problem happened with javax.sql used by Derby. I
realized it probably had something to do with javax not being exported.

I run the Equinox container using java -jar org.eclipse.osgi_version
-configuration /path/to/config/folder and with Tom Schindl's help I
discovered the org.osgi.framework.system.packages and
org.osgi.framework.system.packages.extra properties.

I have read as much as I could on those options but I can't get it to work.

For instance, if I define in config.ini:
org.osgi.framework.system.packages.extra=org.w3c.dom.css

I still get the ClassNotFoundException on org.w3c.dom.css.DocumentCSS
The same goes with javax.sql.XAConnect when I export javax.sql

Here is the system packages property I defined (I tried with
system.packages and system.packages.extra):
org.osgi.framework.system.packages.extra=javax.naming, javax.naming.spi,
javax.management, javax.management.loading, javax.management.modelmbean,
javax.net, javax.net.ssl, javax.crypto, javax.crypto.interfaces,
javax.crypto.spec, javax.security.auth, javax.security.auth.spi,
javax.security.auth.callback, javax.security.auth.login,
javax.security.cert, javax.xml.parsers, javax.xml.xpath,
javax.xml.transform.sax, javax.xml.transform.dom, javax.xml.namespace,
javax.xml.transform, javax.xml.transform.stream, javax.xml.validation,
org.xml.sax, org.xml.sax.helpers, org.xml.sax.ext,
com.sun.org.apache.xalan.internal,
com.sun.org.apache.xalan.internal.res,
com.sun.org.apache.xml.internal.utils,
com.sun.org.apache.xpath.internal,
com.sun.org.apache.xpath.internal.jaxp,
com.sun.org.apache.xpath.internal.objects,
com.sun.org.apache.xml.internal, org.w3c.dom, org.w3c.dom.css,
org.w3c.dom.traversal, org.w3c.dom.ls, javax.sql, javax.transaction,
sun.misc, javax.xml.datatype



So I was investigating further and found about the osgi.java.profile
property. It seems to me that if I could use PDE's JavaSE-1.6 profile,
the exports would be properly set. Unfortunately I could not find any
reference on how to get a file/an URL for it.

In the end, I made my program workusing yet another property:
org.osgi.framework.bootdelegation=* but from what I read, this is not
the proper solution and removes the isolation between bundles.


I'm looking for the "proper" solution to solve this, and reasons why
setting the org.osgi.framework.system.packages property doesn't work.


Thanks

(using org.eclipse.osgi_3.6.0.v20100517.jar)

--
Simon Chemouil
Re: Help with the resolving a classloader issue [message #539647 is a reply to message #539415] Fri, 11 June 2010 15:44 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
We chatted on IRC and I found out you are launching equinox (org.eclipse.osgi) directly without using the launcher (org.eclipse.equinox.launcher). When launched this way the property osgi.compatibility.bootdelegation=false. If you set the property to osgi.compatibility.bootdelegation=true then it should solve the issue.

It appears some e4 bundles are not importing all of their requirements. Ideally bundles should import all the packages they need (or use Require-Bundle). The osgi.compatibility.bootdelegation flag is used to provide compatibility with older versions of eclipse where constraints (Import-Package) was not needed to get access to the packages available in the VM. The osgi.compatibility.bootdelegation adds a last resort class load to boot if the class cannot be found through normal OSGi class loader delegation.

HTH

Tom
Previous Topic:Plugin install particular operation
Next Topic:Questions using P2 director (Provisioning my own distributions)
Goto Forum:
  


Current Time: Tue Apr 23 09:43:30 GMT 2024

Powered by FUDForum. Page generated in 0.02640 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top