10 Replies Latest reply on Dec 23, 2006 7:20 PM by Norman Richards

    Removing jaxws in ejb3-all jar

    Chad La Joie Newbie

      I have two sets of code that I need to integrate. One is a web service client using XFire and the other is a SEAM 1.1 application. Turns out there is a conflict between the javax.ws.WebService annotation in the XFire library and the ejb3-all.jar.

      I certainly understand that the WS code is part of JEE 5, but can I safely remove that package as long as I don't attempt to use any of those features?

      Let me say that I'm almost 100% sure it's a problem with the XFire library, but I have to use the code regardless. I also understand that this might be more appropriate in the EJB3 forum but having looked at the EJB3 package they don't create an ejb3-all bundle, that appears to be a SEAM specific bundling.

      So, anyways, an help on this would be greatly appreciated.

        • 1. Re: Removing jaxws in ejb3-all jar
          Norman Richards Master

          Why is there a conflict? Are the two libraries using different versions of the annotation? Are they being loaded by different classloaders?

          • 2. Re: Removing jaxws in ejb3-all jar
            Chad La Joie Newbie

            They seem to be using different versions. The XFire library seems to indicate they are using jsr181 maintenance release 1.

            If you'd like to try and work through the problem I'd be happy to help in any way I can. I have to admit that I'm not terribly familiar with either code set (which is part of the problem).

            • 3. Re: Removing jaxws in ejb3-all jar
              Chad La Joie Newbie

              Testing shows that removing the WS code from the jar isn't sufficient. As I was worried about it, those classes are at least loaded during the container startup.

              2006-12-22 10:19:25,953 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/portal]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
              java.lang.RuntimeException: exception invoking: startup
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:112)
               at org.jboss.seam.Component.callComponentMethod(Component.java:1791)
               at org.jboss.seam.Component.callCreateMethod(Component.java:1739)
               at org.jboss.seam.Component.newInstance(Component.java:1728)
               at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:152)
               at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:126)
               at org.jboss.seam.init.Initialization.init(Initialization.java:430)
               at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
               at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
               at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
               at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
               at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
               at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
               at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
               at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
               at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
               at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
               at org.jboss.web.WebModule.startModule(WebModule.java:83)
               at org.jboss.web.WebModule.startService(WebModule.java:61)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
               at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
               at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
               at $Proxy0.start(Unknown Source)
               at org.jboss.system.ServiceController.start(ServiceController.java:417)
               at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy11.start(Unknown Source)
               at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
               at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy12.start(Unknown Source)
               at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
               at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
               at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
               at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
               at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
               at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
               at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
               at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
               at $Proxy6.deploy(Unknown Source)
               at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
               at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
               at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
               at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
               at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
              Caused by: java.lang.reflect.InvocationTargetException
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
               at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
               ... 93 more
              Caused by: java.lang.NoClassDefFoundError: javax/jws/WebService
               at org.jboss.ejb3.ProxyFactoryHelper.getEndpointInterface(ProxyFactoryHelper.java:70)
               at org.jboss.ejb3.ProxyFactoryHelper.getLocalInterfaces(ProxyFactoryHelper.java:101)
               at org.jboss.ejb3.ProxyDeployer.initializeLocalBindingMetadata(ProxyDeployer.java:117)
               at org.jboss.ejb3.SessionContainer.instantiated(SessionContainer.java:71)
               at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:573)
               at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:555)
               at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:536)
               at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:508)
               at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:463)
               at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:437)
               at org.jboss.seam.core.Ejb.startup(Ejb.java:55)
               ... 99 more
              


              • 4. Re: Removing jaxws in ejb3-all jar
                Chad La Joie Newbie

                Disregard the above exception, I didn't have the XFire JAX-WS jar in place when I did that.

                So, it seems that the EJB container will start and run okay with the XFire version of the JAX-WS APIs in there, but XFire won't start with the EJB3 version.

                • 5. Re: Removing jaxws in ejb3-all jar
                  Norman Richards Master

                  In general, you should not count on being able to replace/override core Java EE classes in your application. I don't know anything about XFire, but I do know that code that is intended to be run in a Java EE server should NOT have their own copy of the annotations.

                  So, don't add the annotation classes to your application. If there is a version compatibility between the annotations you need to either find the correct version of XFire for the Java EE version in JBoss or update jbossws.sar in JBoss to a version that works with XFire.

                  However, in saying that, I really find it hard to believe that they are using incompatible versions of the annotations. Are you sure the problem wasn't simply that you were providing an equivalent class with your application, causing some classloader confusion?

                  There are still some classloading tricks that might make this work, but it's better not to go there. Could you show your packaging so we can make sure the problem isn't just a simple packaging problem.

                  • 6. Re: Removing jaxws in ejb3-all jar
                    Chad La Joie Newbie

                    Sure thing. This is bundled up as a war for deployment in any ol' servlet container. Our customer happens to be using Tomcat.

                    META-INF/
                    META-INF/MANIFEST.MF
                    WEB-INF/
                    WEB-INF/classes/
                    WEB-INF/lib/
                    images/
                    layout/
                    stylesheet/
                    AdvancedSearch.xhtml
                    AdvancedSearchResults.xhtml
                    BasicSearch.xhtml
                    BasicSearchResult.xhtml
                    SearchResult.xhtml
                    WEB-INF/classes/messages_en.properties
                    WEB-INF/components.xml
                    WEB-INF/faces-config.xml
                    WEB-INF/lib/jrobin-1.4.0.jar
                    WEB-INF/lib/mc-conf.jar
                    WEB-INF/lib/portal.jar
                    WEB-INF/lib/seam-1.1.0.GA-commons-beanutils-1.7.0.jar
                    WEB-INF/lib/seam-1.1.0.GA-commons-codec-1.3.jar
                    WEB-INF/lib/seam-1.1.0.GA-commons-collections-3.1.jar
                    WEB-INF/lib/seam-1.1.0.GA-commons-digester-1.6.jar
                    WEB-INF/lib/seam-1.1.0.GA-commons-el-1.0.jar
                    WEB-INF/lib/seam-1.1.0.GA-commons-lang-2.1.jar
                    WEB-INF/lib/seam-1.1.0.GA-debug.jar
                    WEB-INF/lib/seam-1.1.0.GA-el-api.jar
                    WEB-INF/lib/seam-1.1.0.GA-el-ri.jar
                    WEB-INF/lib/seam-1.1.0.GA-hibernate-all.jar
                    WEB-INF/lib/seam-1.1.0.GA-httpclient-3.0.1.jar
                    WEB-INF/lib/seam-1.1.0.GA-jboss-aop-jdk50.jar
                    WEB-INF/lib/seam-1.1.0.GA-jboss-cache-jdk50.jar
                    WEB-INF/lib/seam-1.1.0.GA-jboss-ejb3-all.bak
                    WEB-INF/lib/seam-1.1.0.GA-jboss-ejb3.jar
                    WEB-INF/lib/seam-1.1.0.GA-jbpm-3.1.2.jar
                    WEB-INF/lib/seam-1.1.0.GA-jgroups.jar
                    WEB-INF/lib/seam-1.1.0.GA-jsf-facelets.jar
                    WEB-INF/lib/seam-1.1.0.GA-jstl-1.1.0.jar
                    WEB-INF/lib/seam-1.1.0.GA-myfaces-api-1.1.4.jar
                    WEB-INF/lib/seam-1.1.0.GA-myfaces-impl-1.1.4.jar
                    WEB-INF/lib/seam-1.1.0.GA-thirdparty-all.jar
                    WEB-INF/lib/seam-1.1.0.GA-ui.jar
                    WEB-INF/lib/seam-1.1.0.GA.jar
                    WEB-INF/lib/tomahawk-1.1.3.jar
                    WEB-INF/lib/xfire-1.2.3-activation-1.1.jar
                    WEB-INF/lib/xfire-1.2.3-jaxb-api-2.0.jar
                    WEB-INF/lib/xfire-1.2.3-jaxb-impl-2.0.1.jar
                    WEB-INF/lib/xfire-1.2.3-jaxb-xjc-2.0.1.jar
                    WEB-INF/lib/xfire-1.2.3-jaxws-api-2.0.jar
                    WEB-INF/lib/xfire-1.2.3-jdom-1.0.jar
                    WEB-INF/lib/xfire-1.2.3-jsr181-api-1.0-M1.jar
                    WEB-INF/lib/xfire-1.2.3-logging-1.0.4.jar
                    WEB-INF/lib/xfire-1.2.3-stax-api-1.0.1.jar
                    WEB-INF/lib/xfire-1.2.3-wsdl4j-1.5.2.jar
                    WEB-INF/lib/xfire-1.2.3-wstx-asl-3.0.1.jar
                    WEB-INF/lib/xfire-all-1.2.3.jar
                    WEB-INF/navigation.xml
                    WEB-INF/web.xml
                    .... web pages ....
                    


                    The xfire-1.2.3-jsr181.api-1.0-M1.jar is the jar that contains the WebService annotation that conflicts with the one in the EJB3 jar. Specifically I get the following error:
                    Exception in thread "main" java.lang.NoSuchMethodError: javax.jws.WebService.portName()Ljava/lang/String;
                     at org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations.getWebServiceAnnotation(Jsr181WebAnnotations.java:55)
                     at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(AnnotationServiceFactory.java:173)
                     at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:356)
                     at gov.nih.nci.cagrid.portal.indexService.IndexServiceClient.createServiceDescriptor(IndexServiceClient.java:145)
                     at gov.nih.nci.cagrid.portal.indexService.IndexServiceClient.<init>(IndexServiceClient.java:83)
                     at gov.nih.nci.cagrid.portal.indexService.IndexServiceClientExample.main(IndexServiceClientExample.java:17)
                    


                    This occurs if both jars are on the classpath and the EJB3 jar appears first. Unforuantely the EJB3 jar does not contain all the necessary annotations that XFire require. Here's the contents of the jsr181 jar from XFire:
                    META-INF/
                    META-INF/MANIFEST.MF
                    javax/
                    javax/jws/
                    javax/jws/soap/
                    javax/jws/HandlerChain.class
                    javax/jws/Oneway.class
                    javax/jws/WebMethod.class
                    javax/jws/WebParam$Mode.class
                    javax/jws/WebParam.class
                    javax/jws/WebResult.class
                    javax/jws/WebService.class
                    javax/jws/soap/InitParam.class
                    javax/jws/soap/SOAPBinding$ParameterStyle.class
                    javax/jws/soap/SOAPBinding$Style.class
                    javax/jws/soap/SOAPBinding$Use.class
                    javax/jws/soap/SOAPBinding.class
                    javax/jws/soap/SOAPMessageHandler.class
                    javax/jws/soap/SOAPMessageHandlers.class
                    


                    While I completely agree with what you've said, I'm not as worried as I might otherwise be. The EJB3 jar seems to have an incomplete version of these annotations. For example, JEE5 specifies the javax.jws.soap package which the EJB3 jar is missing (and XFire needs).

                    • 7. Re: Removing jaxws in ejb3-all jar
                      Norman Richards Master

                      OK - you are right. In your situation your choices appear to be to get jbossws and XFire to compatible versions. You'll have to ask on the EJB3 and/or JBoss WS forums for help there.

                      Are you actually using EJB3? If not, you can drop the JBoss embedded EJB3 altogether, which should eliminate the problem.

                      • 8. Re: Removing jaxws in ejb3-all jar
                        Chad La Joie Newbie

                        Yeah, we are. The XFire stuff is just for a client that goes out and pulls some data. The meat of the app is a normal SEAM app (session beans for actions, entity beans for persistence, etc).

                        Thanks for the help Norman. I'll spend some time poking around the other projects and hopefully post back here with what I find.

                        • 9. Re: Removing jaxws in ejb3-all jar
                          Frank Cornelis Apprentice

                          I experienced similar problems when trying to integrate JAX-WS RI into JBoss AS. It almost feels like Sun and JBoss don't really care that much about the capability of running the WS stacks on each others application servers. IMHO, the best environment right now for SOA is: JBoss AS with JAX-WS RI, but getting the WS runtime up and running really sucks...

                          • 10. Re: Removing jaxws in ejb3-all jar
                            Norman Richards Master

                            I haven't followed what the WS guys are doing that closely, but my understanding is that the JBoss WS project has the goal of being usable outside of JBoss AS.