> -----Original Message----- > From: Sergey Beryozkin [mailto:[email protected]] > > May be you need to add a cxf bundle jar into your WEB-APP/lib ? May be > it > will help a (WebLogic) classloader to resolve CXF classes ?
I think one problem is that this EAR file that the WAR is in already uses an older version of JAXB, and I don't have any control over that. If you can believe it, it appears to be implementation version 1.0.1, from January of 2005. I tried using the WebLogic incantation that "prefers" the jars in the webapp as opposed to other jars in the classloader, but it didn't help. I don't think that works if there's a conflict with other jars in the same EAR. If anything, I'll try removing the JAXB jar that CXF loads, and see if I at least fix my classloader conflicts. I know there's at least one line in JAXBElementProvider that depends on a newer JAXB, but I don't know if there's any critical functionality. > KARR, DAVID (ATTCINW) wrote: > > > >> -----Original Message----- > >> From: Sergey Beryozkin [mailto:[email protected]] > >> Sent: Saturday, September 05, 2009 1:23 PM > >> To: [email protected] > >> Subject: Re: Need help writing JAXBElementProvider that uses > >> "jaxbElementClassMap" > >> > >> > >> Hi > >> > >> You can extend JaxbElementProvider and override > >> AbstractJAXBProvider.convertToJaxbElemenIfNeeded() and implement it > > the > >> way > >> it's done on the trunk [1]. > >> > >> let me know please how it goes > > > > I'm getting a screwy error trying to implement a copy of > > JAXBElementProvider as a subclass of the original > JAXBElementProvider, > > with the additional definition of the "jaxbElementClassMap" property. > > > > Before making this change, I was just getting the error saying that > > "jaxbElementClassMap" wasn't a property of "JAXBElementProvider", > which > > isn't surprising. > > > > I've defined a class "TempJAXBElementProvider" which extends > > "org.apache.cxf.jaxrs.provider.JAXBElementProvider", and I have the > > following bean in my beans.xml: > > > > <bean id="jaxbProvider" > > class="org.apache.cxf.jaxrs.provider.TempJAXBElementProvider"> > > <property name="jaxbElementClassMap" ref="jaxbElementClassMap" /> > > </bean> > > > > After implementing this class, I'm now getting the following Spring > init > > failure: > > > > ------ > > [ERROR] ContextLoader - -Context initialization failed > > <org.springframework.beans.factory.BeanCreationException: Error > creating > > bean with name 'org.apache.cxf.resource.ResourceManager' defined in > > class path resource [META-INF/cxf/cxf.xml]: Initialization of bean > > failed; nested exception is > > org.springframework.beans.factory.CannotLoadBeanClassException: Error > > loading class [org.apache.cxf.jaxrs.provider.TempJAXBElementProvider] > > for bean with name 'jaxbProvider' defined in ServletContext resource > > [/WEB-INF/beans.xml]: problem with class file or dependent class; > nested > > exception is java.lang.NoClassDefFoundError: > > > org/apache/cxf/jaxrs/provider/JAXBElementProvider>org.springframework.b > e > > ans.factory.BeanCreationException: Error creating bean with name > > 'org.apache.cxf.resource.ResourceManager' defined in class path > resource > > [META-INF/cxf/cxf.xml]: Initialization of bean failed; nested > exception > > is org.springframework.beans.factory.CannotLoadBeanClassException: > Error > > loading class [org.apache.cxf.jaxrs.provider.TempJAXBElementProvider] > > for bean with name 'jaxbProvider' defined in ServletContext resource > > [/WEB-INF/beans.xml]: problem with class file or dependent class; > nested > > exception is java.lang.NoClassDefFoundError: > > org/apache/cxf/jaxrs/provider/JAXBElementProvider > > ---------------- > > > > It doesn't make sense that it can't find the class def for > > "org/apache/cxf/jaxrs/provider/JAXBElementProvider". The only change > I > > made in what jars are supplied is that I added > > "geronimo-stax-api_1.0_spec-1.0.1.jar" as that was apparently needed > by > > some constructs in the copied JAXBElementProvider class. I'm > obviously > > still including the cxf-2.2.3.jar file in the WEB-INF/lib. > > > >> > >> cheers, SErgey > >> > >> [1] > >> > > > http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/ja > >> va/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java > >> > >> > >> KARR, DAVID (ATTCINW) wrote: > >> > > >> > I noticed in the following thread > >> > <http://www.mail-archive.com/[email protected]/msg09175.html> > > that > >> > there are some changes in the trunk to allow JAXBElementProvider > to > >> have > >> > a "jaxbElementClassMap" property, which will allow me to bind my > > REST > >> > services to classes I don't control (or are generated), so I can't > >> add > >> > "@XmlRootElement" to them. Sergey mentioned in that thread that > it > >> > would be straightforward to build that JAXBElementProvider before > > the > >> > next release it's available in. Would that be possible? > >> > > >> > > >> > >> -- > >> View this message in context: http://www.nabble.com/Need-help- > writing- > >> JAXBElementProvider-that-uses-%22jaxbElementClassMap%22- > >> tp25303787p25312013.html > >> Sent from the cxf-user mailing list archive at Nabble.com. > > > > > > > > -- > View this message in context: http://www.nabble.com/Need-help-writing- > JAXBElementProvider-that-uses-%22jaxbElementClassMap%22- > tp25303787p25365592.html > Sent from the cxf-user mailing list archive at Nabble.com.
