Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Classloading problem
Classloading problem [message #86925] Tue, 17 April 2007 23:37 Go to next message
Ross Gardler is currently offline Ross GardlerFriend
Messages: 5
Registered: July 2009
Junior Member
I have a simple bundle running an http.jetty webapp. This works fine
until I try and create an instance of a data bean from another plugin.
This bean uses StAX to serialise data for my servlet.

The data bean comes from uk.ac.osswatch.simal.model
The servlet is in uk.ac.osswatch.simal.rest

The stack trace on the log is:

osgi> 18-Apr-2007 00:25:57 org.mortbay.jetty.servlet.ServletHandler handle
WARNING: Error for /rest/doap
java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
at uk.ac.osswatch.simal.rest.RESTServlet.writeDOAP(RESTServlet. java:34)
at uk.ac.osswatch.simal.rest.RESTServlet.doGet(RESTServlet.java :22)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

<sniip/>

The line where the error occurs is:

Project p = new Project("shortname","name","description", null);

Where Project is the databean from the model plugin.

The javax.xml.stream.XMLStreamException class is provided by
stax-api-1.0.jar which is a jar in the build path of the model plugin.

The output of ss is:

id State Bundle
0 ACTIVE system.bundle_3.2.2.R32x_v20070118
1 ACTIVE javax.servlet_2.4.0.qualifier
2 ACTIVE org.apache.commons.logging_1.0.4.qualifier
3 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
4 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
5 ACTIVE org.apache.xerces_2.8.0.v200606131651
6 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
7 RESOLVED
org.eclipse.core.runtime.compatibility.registry_3.2.1.R32x_v 20060907
Master=12
8 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
9 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
10 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
11 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
12 ACTIVE org.eclipse.equinox.registry_3.2.1.R32x_v20060814
Fragments=7
13 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
14 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
15 ACTIVE org.mortbay.jetty_5.1.11.qualifier
21 ACTIVE uk.ac.osswatch.simal.rest_0.1.0
22 ACTIVE uk.ac.osswatch.simal.model_0.1.0

I've tried all sorts of things in an attemptto ensure the
XMLStreamException class is available to the plugin that provides the
servlet, but have so far failed.

How do I ensure this class is available to the servlet?

Ross
Re: Classloading problem [message #86970 is a reply to message #86925] Wed, 18 April 2007 21:40 Go to previous message
Ross Gardler is currently offline Ross GardlerFriend
Messages: 5
Registered: July 2009
Junior Member
I solved this.

Despite the fact that my junit tests work OK, which are also in a
separate bundle, things didn't work when deployed as a servlet within
Equinox. Adding the relevant JARs to the classpath in the model plugin
did the trick.

Ross

Ross Gardler wrote:
> I have a simple bundle running an http.jetty webapp. This works fine
> until I try and create an instance of a data bean from another plugin.
> This bean uses StAX to serialise data for my servlet.
>
> The data bean comes from uk.ac.osswatch.simal.model
> The servlet is in uk.ac.osswatch.simal.rest
>
> The stack trace on the log is:
>
> osgi> 18-Apr-2007 00:25:57 org.mortbay.jetty.servlet.ServletHandler handle
> WARNING: Error for /rest/doap
> java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
> at uk.ac.osswatch.simal.rest.RESTServlet.writeDOAP(RESTServlet. java:34)
> at uk.ac.osswatch.simal.rest.RESTServlet.doGet(RESTServlet.java :22)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>
> <sniip/>
>
> The line where the error occurs is:
>
> Project p = new Project("shortname","name","description", null);
>
> Where Project is the databean from the model plugin.
>
> The javax.xml.stream.XMLStreamException class is provided by
> stax-api-1.0.jar which is a jar in the build path of the model plugin.
>
> The output of ss is:
>
> id State Bundle
> 0 ACTIVE system.bundle_3.2.2.R32x_v20070118
> 1 ACTIVE javax.servlet_2.4.0.qualifier
> 2 ACTIVE org.apache.commons.logging_1.0.4.qualifier
> 3 ACTIVE org.apache.commons_logging_1.0.4.v200608011657
> 4 ACTIVE org.apache.jakarta_log4j_1.2.8.v200607172048
> 5 ACTIVE org.apache.xerces_2.8.0.v200606131651
> 6 ACTIVE org.eclipse.core.jobs_3.2.0.v20060603
> 7 RESOLVED
> org.eclipse.core.runtime.compatibility.registry_3.2.1.R32x_v 20060907
> Master=12
> 8 ACTIVE org.eclipse.equinox.common_3.2.0.v20060603
> 9 ACTIVE org.eclipse.equinox.http.jetty_1.0.0.qualifier
> 10 ACTIVE org.eclipse.equinox.http.registry_1.0.0.qualifier
> 11 ACTIVE org.eclipse.equinox.http.servlet_1.0.0.qualifier
> 12 ACTIVE org.eclipse.equinox.registry_3.2.1.R32x_v20060814
> Fragments=7
> 13 ACTIVE org.eclipse.equinox.servlet.api_1.0.0.v20060601
> 14 ACTIVE org.eclipse.osgi.services_3.1.100.v20060601
> 15 ACTIVE org.mortbay.jetty_5.1.11.qualifier
> 21 ACTIVE uk.ac.osswatch.simal.rest_0.1.0
> 22 ACTIVE uk.ac.osswatch.simal.model_0.1.0
>
> I've tried all sorts of things in an attemptto ensure the
> XMLStreamException class is available to the plugin that provides the
> servlet, but have so far failed.
>
> How do I ensure this class is available to the servlet?
>
> Ross
Previous Topic:Remote bundles
Next Topic:Equinox inside a servlet container
Goto Forum:
  


Current Time: Fri Apr 19 04:42:36 GMT 2024

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

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

Back to the top