Search code examples
jbossjax-wsredhatjboss-eap-7

JBoss Migration 5 EAP to 7 EAP Error with IllegalAnnotationsException XML Binding


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

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

2018-08-20 11:53:55,565 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
2018-08-20 11:53:55,672 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

<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>

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.

Can anyone please advice? Thanks in advance


Solution

  • I solved the issue now with the https://developer.jboss.org/thread/274491

    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.