0 Replies Latest reply on Jul 16, 2011 4:56 AM by Joseph Hwang

    JAXB Exception....!

    Joseph Hwang Novice

      When I coded the return value to java.String, I can deploy my web services. But After I changed my return value to java class with JAXB, I can't deploy my web services. Pls,check my code. I need your advice! Thanks in advance.

       

      - Persons.java

      package com.aaa.ws;

       

      import javax.xml.bind.annotation.XmlAccessType;

      import javax.xml.bind.annotation.XmlAccessorType;

      import javax.xml.bind.annotation.XmlElement;

      import javax.xml.bind.annotation.XmlType;

       

      @XmlAccessorType(XmlAccessType.FIELD)

      @XmlType(name="",    propOrder = {"id", "name", "passwd"})

      public class Persons {

       

          @XmlElement

          protected String id;

         

          @XmlElement

          protected String passwd;

         

          @XmlElement

          protected String name;

             

          //getter and setter method

      .....

      }

       

      - WSLoginTestPort.java

      package com.aaa.ws;

       

      import javax.jws.WebService;

      import javax.jws.WebMethod;

      import javax.jws.WebResult;

      import javax.jws.WebParam;

       

      import com.aaa.ws.Persons;

       

      @WebService

      public interface WSLoginTestPort {

          @WebMethod

          @WebResult

          public Persons loginFunc(@WebParam String id, @WebParam String passwd);

      }

       

      - WSLoginTest.java

      package com.aaa.ws;

       

      import javax.jws.WebService;

       

      import com.aaa.ws.Persons;

       

      @WebService

      public class WSLoginTest implements WSLoginTestPort {

        

          public Persons loginFunc(String ID, String Passwd) {

              // TODO Auto-generated method stub

             p.setId(ID);

             p.setPasswd(Passwd);

             p.setName("Jo");

       

             return p;

          }

      }

       

      But I can't deploy this web service. The Exception is like below

       

      org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/home/julian/workplace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1305009211342/deploy/TotalTestEAR.ear/TotalTest.war/

          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException

          at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:335)

          at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:62)

          at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:238)

          at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:481)

          at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:112)

          at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:110)

          at org.jboss.webservices.integration.deployers.WSDeploymentAspectDeployer.internalDeploy(WSDeploymentAspectDeployer.java:107)

          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

          ... 25 more

      Caused by: org.apache.cxf.service.factory.ServiceConstructionException

          at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:341)

          at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)

          at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:442)

          at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:680)

          at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:505)

          at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:242)

          at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)

          at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)

          at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:148)

          at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:183)

          at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:407)

          at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:314)

          ... 33 more

      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions

      Two classes have the same XML type name "{http://ws.aaa.com/}loginFunc". Use @XmlType.name and @XmlType.namespace to assign different names to them.

          this problem is related to the following location:

              at com.aaa.ws.jaxws.LoginFunc

          this problem is related to the following location:

              at com.aaa.ws.LoginFunc

              at public com.aaa.ws.LoginFunc com.aaa.ws.ObjectFactory.createLoginFunc()

              at com.aaa.ws.ObjectFactory

      Two classes have the same XML type name "{http://ws.aaa.com/}loginFuncResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.

          this problem is related to the following location:

              at com.aaa.ws.jaxws.LoginFuncResponse

          this problem is related to the following location:

              at com.aaa.ws.LoginFuncResponse

              at public com.aaa.ws.LoginFuncResponse com.aaa.ws.ObjectFactory.createLoginFuncResponse()

              at com.aaa.ws.ObjectFactory

       

          at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)

          at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)

          at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)

          at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)

          at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)

          at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)

          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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:201)

          at javax.xml.bind.ContextFinder.find(ContextFinder.java:362)

          at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)

          at org.apache.cxf.jaxb.JAXBDataBinding.createContext(JAXBDataBinding.java:564)

          at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:504)

          at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:324)

          ... 44 more

      17:38:25,420 WARN  [HDScanner] Failed to process changes

      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

       

      *** DEPLOYMENTS IN ERROR: Name -> Error

       

      vfsfile:/home/julian/workplace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1305009211342/deploy/TotalTestEAR.ear/ -> org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/home/julian/workplace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1305009211342/deploy/TotalTestEAR.ear/TotalTest.war/

       

       

      DEPLOYMENTS IN ERROR:

        Deployment "vfsfile:/home/julian/workplace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1305009211342/deploy/TotalTestEAR.ear/" is in error due to the following reason(s): com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions

      Two classes have the same XML type name "{http://ws.aaa.com/}loginFunc". Use @XmlType.name and @XmlType.namespace to assign different names to them.

          this problem is related to the following location:

              at com.aaa.ws.jaxws.LoginFunc

          this problem is related to the following location:

              at com.aaa.ws.LoginFunc

              at public com.aaa.ws.LoginFunc com.aaa.ws.ObjectFactory.createLoginFunc()

              at com.aaa.ws.ObjectFactory

      Two classes have the same XML type name "{http://ws.aaa.com/}loginFuncResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.

          this problem is related to the following location:

              at com.aaa.ws.jaxws.LoginFuncResponse

          this problem is related to the following location:

              at com.aaa.ws.LoginFuncResponse

              at public com.aaa.ws.LoginFuncResponse com.aaa.ws.ObjectFactory.createLoginFuncResponse()

              at com.aaa.ws.ObjectFactory

       

       

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)

          at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

          at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

          at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)