Boa tarde. Quando fiz as alterações propostas no último exercício opcional de @RequestWrapper, não consegui iniciar o serviço e apareceu a exception:
Exception in thread "main" com.sun.xml.internal.ws.spi.db.DatabindingException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Duas classes têm o mesmo nome do tipo XML "{http://ws.estoque.caelum.com.br/}listaItens". Use @XmlType.name e @XmlType.namespace para atribuir outros nomes a elas.
this problem is related to the following location:
at br.com.caelum.estoque.ws.jaxws.GetItens
this problem is related to the following location:
at br.com.caelum.estoque.modelo.item.ListaItens
at public br.com.caelum.estoque.modelo.item.ListaItens br.com.caelum.estoque.ws.jaxws.GetItensResponse.item
at br.com.caelum.estoque.ws.jaxws.GetItensResponse
at com.sun.xml.internal.ws.db.glassfish.JAXBRIContextFactory.newContext(JAXBRIContextFactory.java:90)
at com.sun.xml.internal.ws.spi.db.BindingContextFactory.create(BindingContextFactory.java:167)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:203)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:176)
at com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:95)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:309)
at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)
at com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:453)
at com.sun.xml.internal.ws.server.EndpointFactory.create(EndpointFactory.java:269)
at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:144)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:563)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:545)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:308)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:231)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:126)
at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
at br.com.caelum.estoque.ws.PublicaWebService.main(PublicaWebService.java:14)
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Duas classes têm o mesmo nome do tipo XML "{http://ws.estoque.caelum.com.br/}listaItens". Use @XmlType.name e @XmlType.namespace para atribuir outros nomes a elas.
this problem is related to the following location:
at br.com.caelum.estoque.ws.jaxws.GetItens
this problem is related to the following location:
at br.com.caelum.estoque.modelo.item.ListaItens
at public br.com.caelum.estoque.modelo.item.ListaItens br.com.caelum.estoque.ws.jaxws.GetItensResponse.item
at br.com.caelum.estoque.ws.jaxws.GetItensResponse
at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:445)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:124)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1123)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:147)
at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:152)
at com.sun.xml.internal.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:96)
at com.sun.xml.internal.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:98)
at com.sun.xml.internal.ws.db.glassfish.JAXBRIContextFactory.newContext(JAXBRIContextFactory.java:79)
... 21 more
Alguém poderia dar uma ajuda?
Att,