Thanks Jano. Good news! It works on BEA now--all I needed to do was add <package-name>org.xmlsoap.schemas.wsdl.*</package-name> to <prefer-application-packages> of my weblogic-application.xml file. That is apparently BEA's alternative to having separate classloaders[1]. I'll update our docs on this.
In general, then, whenever BEA is complaining about a particular library when trying to activate an EAR, all you need to do is add its package name to the prefer-application-packages section of the config file. That will cause it to read the EAR's version of that library rather than BEA's. (Though I would still like the CXF team to pipe up if this package--org.xmlsoap.schemas.wsdl.http--is still meaningful within CXF; I'll happily remove it otherwise. I wouldn't want to keep things in that are actually not serving a useful purpose.) Regards, Glen [1] http://forums.bea.com/thread.jspa?threadID=570001292 jan.minaroviech wrote: > > Hi Glen, > > i had lots of class cast exceptions like this on different classes with > jboss. > Solution was to create a separate classloader for EAR (it's not by > default). I did it be attaching jboss-application.xml to EAR. Hopefully > there is something similar in weblogic. > And of course, i have all dependencies in my EAR (it has 20MB). > > And also it's possible in jboss (or tomcat) to setup, if it should first > try to load classes from EAR(WAR) or first from JMV libs. I set it to > these from EAR first. > > best regards > jano > > > > > Glen Mazza <[EMAIL PROTECTED]> > 06/11/2008 01:29 > Bitte antworten an > [email protected] > > > An > [email protected] > Kopie > > Thema > Problem with WebLogic and org.xmlsoap.schemas.wsdl.http.AddressType [Virus > checked] > > > > > > > > Hello, > > I'm having a terrible time trying to load an CXF-based web service > provider > (in an EAR) to WebLogic 10.0. This web service runs fine as a WAR on > Tomcat. Relevant portions of the stack trace are below. WebLogic > continually complains "ClassCastException: interface > org.xmlsoap.schemas.wsdl.http.AddressType"--this interface is in XMLBeans. > I > guess the problem is that WebLogic is loading an older version of XMLBeans > than the 2.3 required by CXF. I'm guessing that because when I explicitly > load an old version of XMLBeans (1.0) into Tomcat, I get a very similar > error. > > I've tried manually placing the XMLBeans-2.3.0 jar in the WAR's > WEB-INF/lib > folder, as well as a lib/ directory within the EAR (after updating the > classpath in the WAR manifest to point to that directory). No luck > though--it is either not detecting the 2.3 JAR or I'm on the wrong track, > and something else is the problem. > > For the weblogic-application.xml, I've placed all the possible > prefer-application-packages values I've seen others do: > > <prefer-application-packages> > <package-name>javax.jws.*</package-name> > <package-name>org.apache.xerces.*</package-name> > <package-name>org.apache.xalan.*</package-name> > <package-name>com.ctc.wstx.*</package-name> > <package-name>org.springframework.*</package-name> > <package-name>org.apache.xmlbeans.*</package-name> > </prefer-application-packages> > > Does anyone have a clue what the problem might be? > > Thanks, > Glen > > > <<WLS Kernel>> <> <> <1213138566713> <BEA-149078> <Stack trace for message > 149004 > weblogic.application.ModuleException: [HTTP:101216]Servlet: > "WebServicePort" > failed to preload on startup in Web application: "doubleit". > java.lang.RuntimeException: > org.springframework.beans.factory.BeanCreationException: Error creating > bean > with name 'org.apache.cxf.wsdl.WSDLManager' defined in class path resource > [META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested exception is > org.springframework.beans.BeanInstantiationException: Could not > instantiate > bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: Constructor threw > exception; nested exception is java.lang.ClassCastException: interface > org.xmlsoap.schemas.wsdl.http.AddressType > at > org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:96) > at > org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:87) > at > org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:65) > at > org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:54) > at > org.apache.cxf.transport.servlet.CXFServlet.loadSpringBus(CXFServlet.java:99) > at > org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:64) > at > org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:86) > at > weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:282) > at > weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) > at > weblogic.security.service.SecurityManager.runAs(Unknown Source) > at > weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:63) > at > weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) > > > Caused by: org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'org.apache.cxf.wsdl.WSDLManager' defined in class > path resource [META-INF/cxf/cxf.xml]: Instantiation of bean failed; nested > exception is org.springframework.beans.BeanInstantiationException: Could > not > instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: > Constructor > threw exception; nested exception is java.lang.ClassCastException: > interface > org.xmlsoap.schemas.wsdl.http.AddressType > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451) > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249) > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291) > at > org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) > at > org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext.java:86) > at > org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:93) > > > Caused by: org.springframework.beans.BeanInstantiationException: Could not > instantiate bean class [org.apache.cxf.wsdl11.WSDLManagerImpl]: > Constructor > threw exception; nested exception is java.lang.ClassCastException: > interface > org.xmlsoap.schemas.wsdl.http.AddressType > at > org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100) > at > org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:757) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:722) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386) > ... 56 more > Caused by: java.lang.ClassCastException: interface > org.xmlsoap.schemas.wsdl.http.AddressType > at java.lang.Class.asSubclass(Class.java:2979) > at > org.apache.cxf.wsdl.JAXBExtensionHelper.addExtensions(JAXBExtensionHelper.java:64) > at > org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:231) > at > org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:104) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) > > -- > View this message in context: > http://www.nabble.com/Problem-with-WebLogic-and-org.xmlsoap.schemas.wsdl.http.AddressType-tp17767027p17767027.html > > Sent from the cxf-user mailing list archive at Nabble.com. > > > > > > -- View this message in context: http://www.nabble.com/Problem-with-WebLogic-and-org.xmlsoap.schemas.wsdl.http.AddressType-tp17767027p17781745.html Sent from the cxf-user mailing list archive at Nabble.com.
