6 Replies Latest reply on Jan 4, 2009 4:45 AM by lhein

    Deployment Problem with Marshaler class - need assitance

    liav

      Hi,

       

      My Project consist of 3 SU which one of them is a servicemix-http consumer with an HTTPMarshaler bean & two more simple http providers.

       

      My Marshaler class is located in:

      "http-consumer

      su\src\main\resources\org\apache\servicemix\jbi\HTTPMarshaler.java"

       

      My consumer xbean is as follows:

       

       

        <http:consumer service="GenericProxyImplService"

                       endpoint="GenericProxyImpl"

                       locationURI="http://localhost:8080/GenericProxyService/services/GenericProxyImpl"

                       role="consumer"

                       defaultMep="http://www.w3.org/2004/08/wsdl/in-out"

                       targetService="wsn:RouterBuilderSvc"

                       marshaler="#marshaler"

                       soap="true" />

         <bean id="marshaler" class="org.apache.servicemix.jbi.HTTPMarshaler" />            

      </beans>

       

      I have the following problem reported by the servicemix console after dropping the SA's jar to the hotdeploy directory:

       

      ERROR - AutoDeploymentService          - Failed to update Service Assembly: http-receiver-sa

      java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>

      <jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message" version="1.0">

      <jbi-task-result>

      <frmwk-task-result>

      <frmwk-task-result-details>

      <task-result-details>

      <task-id>deploy</task-id>

      <task-result>FAILED</task-result>

      <message-type>ERROR</message-type>

      </task-result-details>

      </frmwk-task-result-details>

      </frmwk-task-result>

      <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message">

              <component-name>servicemix-http</component-name>

              <component-task-result-details>

                      <task-result-details>

                              <task-id>deploy</task-id>

                              <task-result>FAILED</task-result>

                              <message-type>ERROR</message-type>

                              <task-status-msg>

      <msg-loc-info>

      <loc-token/>

      <loc-message>Could not deploy xbean service unit</loc-message>

      </msg-loc-info>

      </task-status-msg>

                              <exception-info>

                                      <nesting-level>1</nesting-level>

                                      <msg-loc-info>

                                              <loc-token/>

                                              <loc-message>org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class [org.apache.service

      mix.jbi.HTTPMarshaler] not found

      Offending resource: file Bean 'marshaler'; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.jbi.HTTPMarshaler in classloader org.apache.servicemix.jbi.HTTPMarshaler</loc-message>

                                              <stack-trace><![CDATA[org.apache.xbean.kernel.ServiceRegistrationException: org.springframework.beans.factory.parsing.BeanDefinitionParsingE

      xception: Configuration problem: Bean class not found

      Offending resource: file

      Bean 'marshaler'; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.jbi.HTTPMarshaler in classloader org.apache.servicemix.jbi.HTTPMarshaler

              at org.apache.xbean.kernel.standard.ServiceManagerRegistry.registerService(ServiceManagerRegistry.java:424)

              at org.apache.xbean.kernel.standard.StandardKernel.registerService(StandardKernel.java:220)

              at org.apache.xbean.server.spring.loader.SpringLoader.load(SpringLoader.java:152)

              at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:83)

              at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)

              at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)

              at org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAssembly(DeploymentService.java:508)

              at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServiceAssembly(AutoDeploymentService.java:353)

              at org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchive(AutoDeploymentService.java:256)

              at org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirectory(AutoDeploymentService.java:664)

              at org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(AutoDeploymentService.java:62)

              at org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDeploymentService.java:628)

              at java.util.TimerThread.mainLoop(Timer.java:512)

              at java.util.TimerThread.run(Timer.java:462)

      Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class not found

      Offending resource: file

      Bean 'marshaler'; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.jbi.HTTPMarshaler in classloader org.apache.servicemix.jbi.HTTPMarshaler

              at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)

              at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:268)

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:502)

              at org.apache.xbean.spring.context.v2c.XBeanBeanDefinitionParserDelegate.parseBeanDefinitionElement(XBeanBeanDefinitionParserDelegate.java:62)

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:341)

              at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:310)

              at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.processBeanDefinition(XBeanBeanDefinitionDocumentReader.java:174)

              at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseDefaultElement(XBeanBeanDefinitionDocumentReader.java:101)

              at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:81)

              at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)

              at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)

              at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)

              at org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadBeanDefinitions(FileSystemXmlApplicationContext.java:168)

              at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)

              at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)

              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)

              at org.apache.xbean.server.spring.configuration.SpringConfiguration.org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class [org.apache.service

      mix.jbi.HTTPMarshaler] not found

      Offending resource: file

      Bean 'marshaler'; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.jbi.HTTPMarshaler in classloader org.apache.servicemix.jbi.HTTPMarshaler</loc-message>

       

      Can you please assit?

       

      Thanks in advance.

        • 1. Re: Deployment Problem with Marshaler class - need assitance
          lhein

          The marshaler class should be put to java source folder and not into the resources folder. Also don't forget to check if you compile the class when building the SU.

           

          If this doesn't help please post more details on how your SU looks like and what does the pom.xml looks like.

           

          Regards

          Lars

          • 2. Re: Deployment Problem with Marshaler class - need assitance
            liav

            Hi,

             

            According to the ServiceMix tutorial i located the java class in the resources folder.

             

            If it aint right please tell me where should i locate it? Under the SU root directory?

             

             

            Regarding the class compliation - i "eclipsed" my SU project & built it under the eclipse IDE. How would you recomn building this java class?

             

            Maybe with a Maven command along with metadata in the SU's pom.xml?

             

            Thanks.

            • 3. Re: Deployment Problem with Marshaler class - need assitance
              lhein

              Have you had a look at the ServiceMix tutorials?

              I wrote a tutorial which also uses a http marshaler. Maybe you should have a look at it if it helps you.

               

              http://servicemix.apache.org/7-intermediate-writing-a-http-upload-application.html

               

              Regards

              Lars

              • 4. Re: Deployment Problem with Marshaler class - need assitance
                liav

                Hi Lars,

                 

                Thanks for you quick answer.

                 

                Well, i followed this tutorial & i guess i did something wrong.

                 

                In 705-intermediate-writing-the-marshaler-class.html Page you stated:

                 

                "select the src/main folder in your project. Now create a new folder under main called java. Add this new folder to your source folders.

                If you did it correctly the new folder should show up as src/main/java right below the src/main/resources folder."

                 

                I did that & i got 2 directories now in my SU consumer project:

                http-consumer-su\src\main\java\ (empty dir') & http-consumer-su\src\main\resources\org\apache\servicemix\jbi\ which the HTTPMarshaler class reside in.

                 

                I also "eclipsed" mu project & built it there.

                 

                Here is my xbean file follows by my SU pom file:

                 

                <beans xmlns:http="http://servicemix.apache.org/http/1.0"

                       xmlns:oxp="http://servicemix.apache.org/oxp"

                       xmlns="http://www.springframework.org/schema/beans"

                       xmlns:xsi="http://http://www.w3.org/2001/XMLSchema-instance"

                       xsi:schemaLocation="http://servicemix.apache.org/http/1.0 http://servicemix.apache.org/schema/servicemix-http-3.2.2.xsd

                       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

                 

                  <http:soap-consumer  service="GenericProxyImplService"

                                           endpoint="GenericProxyImpl"

                                           locationURI="http://localhost:8080/GenericProxyService/services/GenericProxyImpl"

                                           defaultMep="http://www.w3.org/2004/08/wsdl/in-out"

                                           targetService="oxp:RouterBuilderSvc"

                                             marshaler="#marshaler"                             wsdl="classpath:GenericProxyImpl.wsdl"/>

                          <bean id="marshaler" class="org.apache.servicemix.jbi.HTTPMarshaler" />                         

                              

                </beans>

                pom.xml

                 

                 

                  <groupId>liav.oxp.esb.services</groupId>

                  <artifactId>http-consumer-su</artifactId>

                  <packaging>jbi-service-unit</packaging>

                  <name>HTTP Receiver SU</name>

                  */$

                    <dependency>

                      <groupId>org.apache.servicemix</groupId>

                      <artifactId>servicemix-core</artifactId>

                      <version>${servicemix-version}</version>

                    </dependency>   

                 

                 

                Lots of thanks.

                • 5. Re: Deployment Problem with Marshaler class - need assitance
                  liav

                  Hi Lars,

                   

                  One more thing that i noticed i the following warning while building ("mvn install") my SA:

                   

                  Failed to generate jbi.xml: org.apache.servicemix.maven.plugin.jbi.JbiPluginException: Unable to generate service unit descriptor!

                  org.apache.servicemix.maven.plugin.jbi.JbiPluginException: Unable to generate service unit descriptor!

                  ...

                  Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load type: org.apache.servicemix.jbi.HTTPMarshaler. Reason: java.lang.ClassNotFoundException:

                   

                  It must be related to the deployment message i get:

                   

                  <loc-message>

                  org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class [org.apache.service

                  mix.jbi.HTTPMarshaler] not found

                   

                  Please advise.

                  • 6. Re: Deployment Problem with Marshaler class - need assitance
                    lhein

                    Hi,

                     

                    the project structure should look something like this:

                     

                    • http-consumer-su / src / main / java / org / apache / servicemix / jbi / Your Marshaler Source here

                    • http-consumer-su / src / main / resources / your other resources (not java sources) here

                     

                    If you did your pom correctly, it should compile the marshaler class on building of the project. The error "org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class [org.apache.service

                    mix.jbi.HTTPMarshaler] not found" is the result of placing the source of the marshaler class in the resources. That won't work at all.

                     

                    Regards

                    Lars

                     

                    Edited by: lhein on Jan 4, 2009 10:44 AM

                     

                    Edited by: lhein on Jan 4, 2009 10:45 AM