geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <ammul...@alumni.princeton.edu>
Subject Re: Geronimo xmlbeans error
Date Fri, 28 Apr 2006 12:20:20 GMT
On 4/28/06, David Jencks <david_jencks@yahoo.com> wrote:
> > Then you'll have to put XMLBeans in the WEB-INF/lib directory.  This
> > is a little unfortunate, but there's a "bug" in Geronimo 1.0 where
> > common libraries and WEB-INF/lib libraries don't share the same
> > classpath.
>
> Maybe I don't understand what you are saying, but I don't think this
> is an accurate description of the problem in 1.0 nor IMO could it be
> the problem here.  In 1.0, a gbean in a web app can't see the web-app
> classes nor the classes in WEB-INF/lib.  However, the problem here is
> that the application can't see xmlbeans classes: there are no custom
> gbeans in sight :-)

It may not be the problem, and it certainly may be that I'm a little
confused on this issue.  The more I think about it, the less sure I
am.

What I'm trying to describe is that if you list a dependency in your
geronimo-web.xml, which would normally be the way to add a third-party
JAR to the web app class loader, then it gets added to the
configuration class loader not the web app class loader, right?  And
it's a parent of the web app class loader, so while the web app class
loader can see it, it won't be able to see the web app libs, right? 
So for example, you couldn't put Spring in there if it's supposed to
load the bean classes from WEB-INF/lib?  Maybe XMLBeans doesn't have
this same issue trying to load the classes for your schema, I'm not
sure.

Nevertheless, the stax issue sounds more likely to be the culprit.

Thanks,
    Aaron

> I think the easiest solution is to use dependency elements for
> xmlbeans and stax-api: that way you won't need copies of these jars
> in your war.  This solution should work for 1.0, 1.1, or 1.2 although
> the syntax is different in 1.1
>
> I suspect the basic problem here is that you didn't include stax-api
> jar, which is where the missing class is from.
>
> You should be able to use a different version of xmlbeans in your app
> because the geronimo copy is used on in builder modules, none of
> which are parents of a j2ee application.
>
> thanks
> david jencks
>
>
> > In Geronimo 1.1 your app can share the same copy of
> > XMLBeans used by the server but just add it to the application's class
> > path using a <dependency> element.
> >
> > Thanks,
> >    Aaron
> >
> > On 4/28/06, avin98 <avin98@yahoo.com> wrote:
> >>
> >> I am trying to marshal an object into XML in my servlet. I am
> >> using XMLBeans
> >> to achieve this.
> >>
> >> I use scomp to create a jar, and have it in my /WEB-INF/lib folder.
> >>
> >> However at runtime I get the following error. Can someone let me
> >> know whats
> >> wrong ???
> >>
> >> java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
> >>         at java.lang.Class.getDeclaredMethods0(Native Method)
> >>         at java.lang.Class.privateGetDeclaredMethods(Class.java:1655)
> >>         at java.lang.Class.getMethod0(Class.java:1901)
> >>         at java.lang.Class.getMethod(Class.java:984)
> >>         at org.apache.xmlbeans.XmlBeans.buildMethod(XmlBeans.java:
> >> 174)
> >>         at org.apache.xmlbeans.XmlBeans.buildNodeMethod
> >> (XmlBeans.java:195)
> >>         at
> >> org.apache.xmlbeans.XmlBeans.buildNodeToCursorMethod(XmlBeans.java:23
> >> 2)
> >>         at org.apache.xmlbeans.XmlBeans.<clinit>(XmlBeans.java:131)
> >>
> >>
> >> The same code in a standalone console app works perfectly fine.
> >>
> >> Is there anything that I need to do ? I am using XmlBeans v 2.0.0
> >> which is
> >> what is shipped with Geronimo as well.
> >> --
> >> View this message in context: http://www.nabble.com/Geronimo-
> >> xmlbeans-error-t1522515.html#a4134540
> >> Sent from the Apache Geronimo - Users forum at Nabble.com.
> >>
> >>
>
>

Mime
View raw message