2 Replies Latest reply on Aug 27, 2018 11:20 PM by fvs_2926

    JBoss 7 EAP Deplyment Error with IllegalAnnotationsException XML Binding

    fvs_2926

      I am currently working on JBoss migration from EAP 5.0.0 to EAP 7.1.0 My project structure is

       

       

      Project structure

      AAA.ear
      -- AAA-ejb.jar
      -- AAA-soap.jar

           -- /**-mapping.xml

      -- lib

       

       

      For now when I try to deploy AAA.ear with only AAA-ejb.jar dependency it doesn’t get any error.

      But with both AAA-ejb.jar and AAA-soap.jar there is error log with the XML binding

      AAA-soap.jar is for Bottom-up (Java to WSDL)

       

       

      Error log

      INFO  [org.jboss.ws.cxf.deployment] (MSC service thread 1-5) JBWS024074: WSDL published to: file:/C:/Dev/Tools/JBoss/jboss-eap-7.1/standalone/data/wsdl/AAA.ear/AAA-soap.jar/Address-SOAP11HTTP.wsdl

      INFO  [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-5) Creating Service {www.abcd.co.com/wsdl/AImplemetaion/subscriptiop/subscriptiop-soap11http/v1}Subscription-SOAP11HTTP-v1

      from WSDL: META-INF/wsdl/Subscription-SOAP11HTTP.wsdl

      INFO  [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-2) Creating Service {http://www.abcd.co.com/wsdl/AImplementation/subscription/subscription-soap11http/v1}Subscription-SOAP11HTTP-v1 from WSDL: META-INF/wsdl/Subscription-SOAP11HTTP.wsdl
      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."AAA.ear"."AAA-soap.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."AAA.ear"."AAA-soap.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "AAA-soap.jar" of deployment "AAA.ear"
        at org
      .jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
        at org
      .jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java
      .lang.Thread.run(Thread.java:745)
      Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
        at org
      .apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:375)
        at org
      .jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:79)
        at org
      .apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:255)
        at org
      .apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:543)
        at org
      .jboss.wsf.stack.cxf.configuration.BusHolder.configure(BusHolder.java:235)
        at org
      .jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:97)
        at org
      .jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:59)
        at org
      .jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
        at org
      .jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
        
      ... 5 more
      Caused by: org.apache.cxf.service.factory.ServiceConstructionException
        at org
      .apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:329)
        at org
      .apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
        at org
      .apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:426)
        at org
      .apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:528)
        at org
      .apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:263)
        at org
      .apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
        at org
      .apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
        at org
      .apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)
        at org
      .apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
        at org
      .apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:460)
        at org
      .apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:338)
        
      ... 13 more
      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 12 counts of IllegalAnnotationExceptions
      Two classes have the same XML type name "{http://www.abcd.co.com/schema/bus/money/money/v1}InvestmentTypeType". Use @XmlType.name and @XmlType.namespace to assign different names to them.
        
      this problem is related to the following location:
        at com
      .co.abcd.subscriptionv1.schema.bus.money.money.InvestmentTypeType
        at
      protected com.co.abcd.subscriptionv1.schema.bus.money.money.InvestmentTypeType com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType.investmentType
        at com
      .co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType
        at
      public com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.SubscriptionByInvestmentTypeType com.co.abcd.subscriptionv1.schema.bus.subscription.subscription.ObjectFactory.createSubscriptionByInvestmentTypeType()
        at com
      .co.abcd.subscriptionv1.schema.bus.subscription.subscription.ObjectFactory
        
      this problem is related to the following location:
        at com
      .co.abcd.schema.bus.money.money.v1.InvestmentTypeType
        at
      protected com.co.abcd.schema.bus.money.money.v1.InvestmentTypeType com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyType.investmentType
        at com
      .co.abcd.schema.bus.account.account.v1.ValuationByMoneyType
        at
      protected java.util.List com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType.valuationByMoney
        at com
      .co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType
        at
      protected com.co.abcd.schema.bus.account.account.v1.ValuationByMoneyListType com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceType.valuationByMoneyList
        at com
      .co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceType
        at
      protected java.util.List com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType.productHoldingInstance
        at com
      .co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType
        at
      public com.co.abcd.schema.bus.account.account.v1.ProductHoldingInstanceListType com.co.abcd.schema.bus.account.account.v1.ObjectFactory.createProductHoldingInstanceListType()
        at com
      .co.abcd.schema.bus.account.account.v1.ObjectFactory
      .
      .
      .

       

      My currently jboss-deployment-structure.xml in AAA.ear is

       

      Header 1

      <jboss-deployment-structure>
        
      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
        
      <deployment>
        
      <dependencies>
          
      <module name="org.hibernate" export="true"/>
          
      <module name="org.jboss.as.system-jmx" export="true"/>
          
      <module name="org.dom4j" export="true"/>
          
      <module name="deployment.AAA.ear.AAA-ejb.jar" export="true"/>
          
      <module name="deployment.AAA.ear.AAA-soap.jar" export="true"/>
        
      </dependencies>
        
      </deployment>
          
      <sub-deployment name="AAA-ejb.jar">
        
      </sub-deployment>
         
      <sub-deployment name="AAA-soap.jar">
            
      <dependencies>
              
      <module name="deployment.AAA.ear.AAA-ejb.jar" />
            
      </dependencies>

         </sub-deployment>

      </jboss-deployment-structure>

       

      And I recognized that my project can deploy and run successfullly in Jboss 5 with JBoss Web Services Native 3.1.2 SP3. Does this error occured because of the JBoss Web services is changed to JBossWS 5.1.9 ? If yes, what should I do.

      I try update org.apache.cxf version to 3.2.6 but the error still exist

      Can anyone please advice? Thanks in advance

        • 1. Re: JBoss 7 EAP Deplyment Error with IllegalAnnotationsException XML Binding
          jewellgm

          I'm not positive, but my guess is that the class "InvestmentTypeType" is being loaded multiple times, and is visible to the same classloader.  Since the same namespace is being assigned to the type, the deployment doesn't know how to handle it.

           

          My suggestion is to clean up your jboss-deployment-structure.xml.  There aren't too many occasions where setting the subdeployments to not have isolated classloaders is necessary.  If your SOAP jar is dependent on the EJB jar, then the dependency in the sub-deployment should be sufficient.  If your EJB jar is also dependent on your SOAP jar, then you've got bigger problems.  You would need to resolve that circular dependency.

           

          Try to remove the following lines:

          <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

           

          and from the top-level dependencies section:

          <module name="deployment.AAA.ear.AAA-ejb.jar" export="true"/>

          <module name="deployment.AAA.ear.AAA-soap.jar" export="true"/>

           

          Incidentally, why is your SOAP deployment packaged in a jar, as opposed to a war?

          • 2. Re: JBoss 7 EAP Deplyment Error with IllegalAnnotationsException XML Binding
            fvs_2926

            I solved the issue now as in the Jboss EAP 7 Webservice issue "Could not unwrap Operation", Incorrect SOAP request is generated 

             

            It happened that because the subscription-wsimport.jar (Jar stub for generate the WSDL) is not working on EAP 7 anymore .

             

            So I try to re-generate the Stub with the new generator and deploy again. It has no error and WSDL Service is run successfully.