Axis2
  1. Axis2
  2. AXIS2-2972

Vague error produced for ServiceClient invocation within a service where class pathing is a problem

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Component/s: databinding, deployment
    • Labels:
      None
    • Environment:
      Running in windows XP under eclipse and with axis2 1.2 embedded under Jetty.

      Description

      The problem I have seen occurs when a component is not in the deployment directory, but is being referenced externally. Instead of encountering a ClassNotFoundException or similar, a vague error is produced when attempting to:

      1) create a ServiceClient within a service
      2) load a configuration context within a service

      The client was external to the jar because it will be used both remotely and as a part of the service. The text of the exception is misleading because the receivers in use as per the services.xml have nothing to do with those seen in the error.

      To create the error, simply attempt to create a new ServiceClient() in a class that is not contained within the deployment directory, but is referenced by a class in the deployment directory.

      The error seen is the following:
      java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apache.axis2.engine.MessageReceiver
      at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:190)
      at org.apache.axis2.deployment.DescriptionBuilder$1.run(DescriptionBuilder.java:142)
      at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:130)
      at org.apache.axis2.deployment.DescriptionBuilder.processMessageReceivers(DescriptionBuilder.java:138)
      at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:92)
      at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:640)
      at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:105)
      at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:60)
      at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:174)
      at org.apache.axis2.client.ServiceClient.initializeTransports(ServiceClient.java:211)
      at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:138)
      at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:133)
      at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:229)
      at com.test.client.BasicClient.<init>(BasicClient.java:76)
      at com.test.client.TestClient.<init>(TestClient.java:31)
      at com.test.client.servlet.TestServer.<init>(TestServer.java:452)
      at com.test.client.TestServer.getInstance(TestServer.java:65)
      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:597)
      at com.test.client.ClientMessageHandler.init(ClientMessageHandler.java:51)
      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:597)
      at org.apache.axis2.engine.DependencyManager.initServiceClass(DependencyManager.java:56)
      at org.apache.axis2.engine.DependencyManager.initService(DependencyManager.java:94)
      at org.apache.axis2.context.ConfigurationContextFactory.initApplicationScopeServices(ConfigurationContextFactory.java:91)
      at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:76)
      at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:486)
      at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:406)
      at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
      at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:617)
      at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
      at org.mortbay.jetty.Server.doStart(Server.java:210)
      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
      at com.test.TestServer.<init>(TestServer.java:52)
      at com.test.TestServer.main(TestServer.java:83)

        Activity

        Hide
        Deepal Jayasinghe added a comment -

        Please attache a test case.

        Thanks
        Deepal

        Show
        Deepal Jayasinghe added a comment - Please attache a test case. Thanks Deepal
        Hide
        Jason Kania added a comment -

        Please hold the issue open as I am too busy to strip the code down to a presentable test case now, but I will get to it.

        Show
        Jason Kania added a comment - Please hold the issue open as I am too busy to strip the code down to a presentable test case now, but I will get to it.
        Hide
        J. Nessunnome added a comment -

        I am getting this same exception (see below) using Axis2 1.3 on Websphere Application Server 6.1 on Windows. I have noticed that it only seems to occur after I republish my project, if I restart my server after republishing, I do not get this error.

        I have my WAR configured to use parent last classloading, but both of these classes only exist in the axis2-kernel jar in my war, so I'm not sure if it matters.

        Caused by:
        java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver incompatible with org.apache.axis2.engine.MessageReceiver
        at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:191)
        at org.apache.axis2.deployment.DescriptionBuilder$1.run(DescriptionBuilder.java:144)
        at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
        at org.apache.axis2.deployment.DescriptionBuilder.processMessageReceivers(DescriptionBuilder.java:140)
        at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:95)
        at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615)
        at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180)
        at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146)
        at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:139)
        at com.west.intlorch.securitysvc.SecurityServiceStub.<init>(SecurityServiceStub.java:241)
        at com.west.intlorch.securitysvc.SecurityServiceStub.<init>(SecurityServiceStub.java:227)
        at com.west.intlorch.securitysvc.SecurityServiceStub.<init>(SecurityServiceStub.java:275)
        at com.west.intlorch.service.SecurityServiceImpl.authenticateApp(SecurityServiceImpl.java:19)

        Show
        J. Nessunnome added a comment - I am getting this same exception (see below) using Axis2 1.3 on Websphere Application Server 6.1 on Windows. I have noticed that it only seems to occur after I republish my project, if I restart my server after republishing, I do not get this error. I have my WAR configured to use parent last classloading, but both of these classes only exist in the axis2-kernel jar in my war, so I'm not sure if it matters. Caused by: java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver incompatible with org.apache.axis2.engine.MessageReceiver at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:191) at org.apache.axis2.deployment.DescriptionBuilder$1.run(DescriptionBuilder.java:144) at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132) at org.apache.axis2.deployment.DescriptionBuilder.processMessageReceivers(DescriptionBuilder.java:140) at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:95) at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615) at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180) at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146) at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:139) at com.west.intlorch.securitysvc.SecurityServiceStub.<init>(SecurityServiceStub.java:241) at com.west.intlorch.securitysvc.SecurityServiceStub.<init>(SecurityServiceStub.java:227) at com.west.intlorch.securitysvc.SecurityServiceStub.<init>(SecurityServiceStub.java:275) at com.west.intlorch.service.SecurityServiceImpl.authenticateApp(SecurityServiceImpl.java:19)
        Hide
        Jason Harrop added a comment -

        Another datapoint.

        I get the same class cast exception when using the java2wsdl ant task in Axis2-1.3; running ant from the command line

        Show
        Jason Harrop added a comment - Another datapoint. I get the same class cast exception when using the java2wsdl ant task in Axis2-1.3; running ant from the command line
        Hide
        Peter Nash added a comment -

        I get the same problem. I'm using an Axis2 web service to connect to another Axis2 webservice within the same Jboss container. The exception is trigger when I initialise the remote client:

        RPCServiceClient serviceClient = new RPCServiceClient();

        Any help would be appreciated.

        Thanks,

        Peter
        16:53:54,560 ERROR [STDERR] java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apa
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:192)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DescriptionBuilder$1.run(DescriptionBuilder.java:145)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DescriptionBuilder.processMessageReceivers(DescriptionBuilder.java:141)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:102)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:641)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFac
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(Configura
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:150)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:244)
        16:53:54,561 ERROR [STDERR] at org.apache.axis2.rpc.client.RPCServiceClient.<init>(RPCServiceClient.java:48)

        Show
        Peter Nash added a comment - I get the same problem. I'm using an Axis2 web service to connect to another Axis2 webservice within the same Jboss container. The exception is trigger when I initialise the remote client: RPCServiceClient serviceClient = new RPCServiceClient(); Any help would be appreciated. Thanks, Peter 16:53:54,560 ERROR [STDERR] java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apa 16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver(DescriptionBuilder.java:192) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DescriptionBuilder$1.run(DescriptionBuilder.java:145) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:132) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DescriptionBuilder.processMessageReceivers(DescriptionBuilder.java:141) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:102) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:641) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:116 16:53:54,561 ERROR [STDERR] at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFac 16:53:54,561 ERROR [STDERR] at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(Configura 16:53:54,561 ERROR [STDERR] at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:150) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:244) 16:53:54,561 ERROR [STDERR] at org.apache.axis2.rpc.client.RPCServiceClient.<init>(RPCServiceClient.java:48)
        Hide
        Michael Costello added a comment -

        I am currently working on a prototype where I am running into this same problem.
        I am trying to create a new ServiceClient within a service. I have also tried multiple ways of creating a Configuration Context from the default Axis Config each time getting the same casting exception. I'm running an application with an embedded jetty configured with Axis who's Web service config references class files that do physically reside in the Axis Deployment directory.

        Does anyone know of any way to work around this problem until it is resolved?

        Any ideas will be greatly appreciated!

        Thanks
        Mike

        Show
        Michael Costello added a comment - I am currently working on a prototype where I am running into this same problem. I am trying to create a new ServiceClient within a service. I have also tried multiple ways of creating a Configuration Context from the default Axis Config each time getting the same casting exception. I'm running an application with an embedded jetty configured with Axis who's Web service config references class files that do physically reside in the Axis Deployment directory. Does anyone know of any way to work around this problem until it is resolved? Any ideas will be greatly appreciated! Thanks Mike
        Hide
        Benjamin Francisoud added a comment -

        I had the same problem with ant, it seems to be a classpath issue (my 2 cents)
        I am using a axis2 war distrib. I also have axis2 binary distrib installed localy.

        I tried various classpath combinaisons and I finally got this one working...
        (where webapp.classpath is WEB-INF-lib of axis2 war distrib)

        <path id="wsdl.classpath">
        <pathelement path="$

        {axis2.classpath}

        "/>
        <pathelement location="web/WEB-INF/classes"/>
        </path>

        <taskdef name="java2wsdl" classname="org.apache.ws.java2wsdl.Java2WSDLTask"
        classpathref="webapp.classpath"/>

        <java2wsdl className="$

        {pkg}

        .IMyService" outputLocation="$

        {wsdl.dir}

        " locationUri="$

        {webservice.url}

        /MyService">
        <classpath location="web/WEB-INF/classes"/>
        </java2wsdl>

        hopes this help someone...

        Show
        Benjamin Francisoud added a comment - I had the same problem with ant, it seems to be a classpath issue (my 2 cents) I am using a axis2 war distrib. I also have axis2 binary distrib installed localy. I tried various classpath combinaisons and I finally got this one working... (where webapp.classpath is WEB-INF-lib of axis2 war distrib) <path id="wsdl.classpath"> <pathelement path="$ {axis2.classpath} "/> <pathelement location="web/WEB-INF/classes"/> </path> <taskdef name="java2wsdl" classname="org.apache.ws.java2wsdl.Java2WSDLTask" classpathref="webapp.classpath"/> <java2wsdl className="$ {pkg} .IMyService" outputLocation="$ {wsdl.dir} " locationUri="$ {webservice.url} /MyService"> <classpath location="web/WEB-INF/classes"/> </java2wsdl> hopes this help someone...
        Hide
        ravi sekhar mikkilineni added a comment -

        I am also getting the same error while doing java2wsdl.i.e

        java.lang.RuntimeException: java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver

        Our appliocation was developed on Axis1.2Rc2 and now we wanted to upgrade to Axis2.x

        Here is the build file content:
        ----------------------------------------
        <taskdef name="java2wsdl"
        classname="org.apache.ws.java2wsdl.Java2WSDLTask" classpathref="axis.classpath"
        loaderref="axis"/>

        <target name="java2wsdl">
        <path id="axis.class.path">
        <path refid="dd.class.path"/>
        <pathelement location="$

        {deploy.home}/install/classes"/>
        </path>

        <java2wsdl className="${target.directory.each}.service.${target.servicename.each}"
        outputLocation="http://localhost:8080//services/${target.servicename.each}" targetNamespace="urn:${target.servicename.each}">
        <classpath refid="axis.classpath"/>
        <classpath location="${deploy.home}

        /install/classes"/>
        </java2wsdl>

        Please let me know the work around for this issue(i followed the inputs provided by Benjamin Francisoud ,but those inputs not helped me )

        Show
        ravi sekhar mikkilineni added a comment - I am also getting the same error while doing java2wsdl.i.e java.lang.RuntimeException: java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver Our appliocation was developed on Axis1.2Rc2 and now we wanted to upgrade to Axis2.x Here is the build file content: ---------------------------------------- <taskdef name="java2wsdl" classname="org.apache.ws.java2wsdl.Java2WSDLTask" classpathref="axis.classpath" loaderref="axis"/> <target name="java2wsdl"> <path id="axis.class.path"> <path refid="dd.class.path"/> <pathelement location="$ {deploy.home}/install/classes"/> </path> <java2wsdl className="${target.directory.each}.service.${target.servicename.each}" outputLocation="http://localhost:8080//services/${target.servicename.each}" targetNamespace="urn:${target.servicename.each}"> <classpath refid="axis.classpath"/> <classpath location="${deploy.home} /install/classes"/> </java2wsdl> Please let me know the work around for this issue(i followed the inputs provided by Benjamin Francisoud ,but those inputs not helped me )
        Hide
        Yao added a comment -

        I am having the sample problem with Java2WSDLTask. I use axis2-1.5. Is there a workaround? Which jar is missing?

        Show
        Yao added a comment - I am having the sample problem with Java2WSDLTask. I use axis2-1.5. Is there a workaround? Which jar is missing?
        Hide
        Andreas Erhart added a comment -

        This problem always ocurrs for me when I have the axis jars in two or more locations within the classpath

        Show
        Andreas Erhart added a comment - This problem always ocurrs for me when I have the axis jars in two or more locations within the classpath
        Hide
        giacomo petronio added a comment -

        It occurs to me too.
        I have an axis2 web service deployed as an aar in the axis2.war which in turn call an EJB deployed on the same JBoss (4.2.3).
        The EJB then acts as a web-service client and tries to instantiate a ServiceClient, but here the error occurs. with the following
        java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apache.axis2.engine.MessageReceiver

        Show
        giacomo petronio added a comment - It occurs to me too. I have an axis2 web service deployed as an aar in the axis2.war which in turn call an EJB deployed on the same JBoss (4.2.3). The EJB then acts as a web-service client and tries to instantiate a ServiceClient, but here the error occurs. with the following java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apache.axis2.engine.MessageReceiver
        Hide
        Deepak Pant added a comment -

        I am facing this issue in WebSphere Base Edition 7.0.0.11, AXIS2 1.5.4. Do you have any solution or work-around available to bypass this error? Please post/suggest.

        Show
        Deepak Pant added a comment - I am facing this issue in WebSphere Base Edition 7.0.0.11, AXIS2 1.5.4. Do you have any solution or work-around available to bypass this error? Please post/suggest.
        Hide
        Deepak Pant added a comment -

        I was able to fix this issue by doing following: (WebSphere 7.0.0.17 and Apache Axis2 1.5.4)

        (a) WebSphere Console: Under "Class loading and update detection", selected following two options: Classes loaded with local class loader first (parent last) and Single class loader for application.
        (b) WebSphere Console: Under "Manage Modules" for both the WAR file(s) present in the EAR, selected "Classes loaded with local class loader first (parent last)" option.
        (c) Removed following files from WEB-INF/lib of my WAR files: xalan-2.7.0.jar, xercesImpl-2.6.2.jar, xercesImpl-2.8.1.jar, xml-apis-1.3.02.jar
        (d) Added following via Ant to MANIFEST.MF file of the WAR file.
        <attribute name="DisableIBMJAXWSEngine" value="true"/>
        (e) Bundled "commons-logging-adapters-1.1.1.jar" file instead of commons-logging-1.1.1.jar.
        (f) Forcefully included "org.apache.axis2.jar" file present under "/IBM/WebSphere/AppServer/plugins" folder in the EAR/lib folder. Forced it to be the first file in MANIFEST.MF file of the EAR file.

        Once WebSphere is happy... life is good...

        Show
        Deepak Pant added a comment - I was able to fix this issue by doing following: (WebSphere 7.0.0.17 and Apache Axis2 1.5.4) (a) WebSphere Console: Under "Class loading and update detection", selected following two options: Classes loaded with local class loader first (parent last) and Single class loader for application. (b) WebSphere Console: Under "Manage Modules" for both the WAR file(s) present in the EAR, selected "Classes loaded with local class loader first (parent last)" option. (c) Removed following files from WEB-INF/lib of my WAR files: xalan-2.7.0.jar, xercesImpl-2.6.2.jar, xercesImpl-2.8.1.jar, xml-apis-1.3.02.jar (d) Added following via Ant to MANIFEST.MF file of the WAR file. <attribute name="DisableIBMJAXWSEngine" value="true"/> (e) Bundled "commons-logging-adapters-1.1.1.jar" file instead of commons-logging-1.1.1.jar. (f) Forcefully included "org.apache.axis2.jar" file present under "/IBM/WebSphere/AppServer/plugins" folder in the EAR/lib folder. Forced it to be the first file in MANIFEST.MF file of the EAR file. Once WebSphere is happy... life is good...
        Hide
        Andreas Veithen added a comment -

        @Deepak: Most of these manipulations should not be necessary if you turn on parent-last class loading for modules and services in Axis2 (supported starting with Axis2 1.5.5). See AXIS2-4917 for more details.

        Show
        Andreas Veithen added a comment - @Deepak: Most of these manipulations should not be necessary if you turn on parent-last class loading for modules and services in Axis2 (supported starting with Axis2 1.5.5). See AXIS2-4917 for more details.
        Hide
        Deepak Pant added a comment -

        Using WebSphere 7.0.0.17 and Apache Axis2 1.5.5, I tested following without any success.

        1. With EnableChildFirstClassLoading=true in axis2.xml and no change in class-loading policy of application in WebSphere, I see following exception in the log file at the server startup time.

        Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileUploadException
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402)
        at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:619)

        2. With EnableChildFirstClassLoading=true in axis2.xml and and with PARENT_LAST in class-loading policy of application in WebSphere, I see following exception in the log file at the server startup time.

        [6/20/11 9:03:32:656 GMT+05:30] 00000008 SystemOut O [INFO] The XYZ service, which is not valid, caused java.lang.ClassCastException: org.apache.axis2.classloader.JarFileClassLoader incompatible with org.apache.axis2.deployment.DeploymentClassLoader
        at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:131)
        at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:101)
        at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109)
        at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:178)
        at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82)
        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:661)
        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:337)
        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:241)
        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
        at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
        at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:567)
        at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:452)
        at org.apache.axis2.transport.http.AxisAdminServlet.init(AxisAdminServlet.java:55)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)

        3. With EnableChildFirstClassLoading=false in axis2.xml and and with PARENT_LAST in class-loading policy of application in WebSphere, I see following exception in the log file at the server startup time.

        [6/20/11 9:22:51:571 GMT+05:30] 0000000a SystemOut O [INFO] The XYZ service, which is not valid, caused java.lang.ClassCastException: org.apache.axis2.classloader.JarFileClassLoader incompatible with org.apache.axis2.deployment.DeploymentClassLoader
        at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:131)
        at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:101)
        at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109)
        at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:178)
        at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82)
        at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
        at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:661)
        at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
        at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:337)
        at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:241)
        at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
        at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95)
        at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:567)
        at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:452)
        at org.apache.axis2.transport.http.AxisAdminServlet.init(AxisAdminServlet.java:55)
        at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)
        at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:169)

        Show
        Deepak Pant added a comment - Using WebSphere 7.0.0.17 and Apache Axis2 1.5.5, I tested following without any success. 1. With EnableChildFirstClassLoading=true in axis2.xml and no change in class-loading policy of application in WebSphere, I see following exception in the log file at the server startup time. Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileUploadException at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:619) 2. With EnableChildFirstClassLoading=true in axis2.xml and and with PARENT_LAST in class-loading policy of application in WebSphere, I see following exception in the log file at the server startup time. [6/20/11 9:03:32:656 GMT+05:30] 00000008 SystemOut O [INFO] The XYZ service, which is not valid, caused java.lang.ClassCastException: org.apache.axis2.classloader.JarFileClassLoader incompatible with org.apache.axis2.deployment.DeploymentClassLoader at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:131) at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:101) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:178) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:661) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:337) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:241) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131) at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:567) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:452) at org.apache.axis2.transport.http.AxisAdminServlet.init(AxisAdminServlet.java:55) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358) 3. With EnableChildFirstClassLoading=false in axis2.xml and and with PARENT_LAST in class-loading policy of application in WebSphere, I see following exception in the log file at the server startup time. [6/20/11 9:22:51:571 GMT+05:30] 0000000a SystemOut O [INFO] The XYZ service, which is not valid, caused java.lang.ClassCastException: org.apache.axis2.classloader.JarFileClassLoader incompatible with org.apache.axis2.deployment.DeploymentClassLoader at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:131) at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:101) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:178) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:82) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:661) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:337) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:241) at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131) at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284) at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:95) at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:567) at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:452) at org.apache.axis2.transport.http.AxisAdminServlet.init(AxisAdminServlet.java:55) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:169)
        Hide
        Andreas Veithen added a comment -

        @Deepak: Option 2 is the correct one. Note that it is the class loader policy of the Web module that needs to be changed. The class loader policy of the enterprise application is irrelevant.

        I finally took the time to document this properly:

        https://builds.apache.org/job/Axis2/site/docs/app_server.html

        Show
        Andreas Veithen added a comment - @Deepak: Option 2 is the correct one. Note that it is the class loader policy of the Web module that needs to be changed. The class loader policy of the enterprise application is irrelevant. I finally took the time to document this properly: https://builds.apache.org/job/Axis2/site/docs/app_server.html
        Hide
        Hendy Irawan added a comment -

        Still happens in Axis2 1.5.1.

        Show
        Hendy Irawan added a comment - Still happens in Axis2 1.5.1.
        Show
        Sagara Gunathunga added a comment - @Hendy Please see https://issues.apache.org/jira/browse/AXIS2-2972?focusedCommentId=13047319&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13047319 Try with Axis2 1.5.6 or 1.6.2
        Hide
        Hendy Irawan added a comment -

        My use case is with Pentaho Data Integration 4.2.1, which bundles Axis2 1.4.1.

        A develop a PDI plugin which requires a newer Axis2 version. I try to bundle Axis2 1.5.1 or 1.6.1 with my plugin but got the "java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apache.axis2.engine.MessageReceiver" error.
        This error doesn't happen when I try to override other (non-Axis2) libraries with newer ones.

        The solution for me was to replace the PDI-bundled Axis2 JARs and replace them with Axis 1.6.1. Not as clean as I hoped but it works.

        Show
        Hendy Irawan added a comment - My use case is with Pentaho Data Integration 4.2.1, which bundles Axis2 1.4.1. A develop a PDI plugin which requires a newer Axis2 version. I try to bundle Axis2 1.5.1 or 1.6.1 with my plugin but got the "java.lang.ClassCastException: org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver cannot be cast to org.apache.axis2.engine.MessageReceiver" error. This error doesn't happen when I try to override other (non-Axis2) libraries with newer ones. The solution for me was to replace the PDI-bundled Axis2 JARs and replace them with Axis 1.6.1. Not as clean as I hoped but it works.
        Hide
        Sagara Gunathunga added a comment -

        I think it's better to report this issue and workaround in PDI forum or mailing list and ask them to upgrade Axis2 version for their next release. It's better to move Axis2 1.6.1 version.

        Show
        Sagara Gunathunga added a comment - I think it's better to report this issue and workaround in PDI forum or mailing list and ask them to upgrade Axis2 version for their next release. It's better to move Axis2 1.6.1 version.
        Hide
        Hendy Irawan added a comment -

        Sorry OOT... BTW, what is the difference between axis2.jar and axis2-kernel.jar ? Should both be used? And which one depends or incorporates axis2-transport-local.jar and axis2-transport-http.jar ?

        Show
        Hendy Irawan added a comment - Sorry OOT... BTW, what is the difference between axis2.jar and axis2-kernel.jar ? Should both be used? And which one depends or incorporates axis2-transport-local.jar and axis2-transport-http.jar ?
        Hide
        Hendy Irawan added a comment -

        @Sagara : Thanks. Reported as http://jira.pentaho.com/browse/PDI-7236

        Show
        Hendy Irawan added a comment - @Sagara : Thanks. Reported as http://jira.pentaho.com/browse/PDI-7236
        Hide
        chamnan so added a comment -

        @Hendy What are the steps you used replace the PDI-bundled Axis2 jars? I've tried replacing all axis2 jars with axis2 1.6.2 jars in the libext folder but spoon is still throwing the same error when I'm running my plugin. Thanks.

        Show
        chamnan so added a comment - @Hendy What are the steps you used replace the PDI-bundled Axis2 jars? I've tried replacing all axis2 jars with axis2 1.6.2 jars in the libext folder but spoon is still throwing the same error when I'm running my plugin. Thanks.

          People

          • Assignee:
            Unassigned
            Reporter:
            Jason Kania
          • Votes:
            3 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development