WebService

2 respostas
CristianPalmaSola10

Seguinte eu tenho um webservice que estou criando, mas devo estar esquecendo alguma configuração

Codigo do webservice

@WebService(endpointInterface = "com.consisa.site.webservice.tipocontato.ServiceTipoContato", serviceName = "ServiceTipoContato", portName = "ServiceTipoContatoPort")
public class ServiceTipoContatoImpl implements ServiceTipoContato {

	@Override
	public List<Tipocontato> buscarTipoContato() {
		return new TipoContatoBO().buscarTodosTipoContato();
	}

}

e quando rodo tenho o seguinte erro

javax.xml.ws.WebServiceException: Não é possível criar o JAXBContext
	at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:166)
	at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
	at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
	at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:338)
	at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
	at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:505)
	at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
	at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
	at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:124)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at java.util.List
java.util.List does not have a no-arg default constructor.
	this problem is related to the following location:
		at java.util.List

	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
	... 18 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at java.util.List
java.util.List does not have a no-arg default constructor.
	this problem is related to the following location:
		at java.util.List

	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.api.JAXBRIContext.newInstance(JAXBRIContext.java:106)
	at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:109)
	at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:161)
	at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:154)
	... 20 more

Ago 22, 2012 8:46:12 AM org.apache.catalina.core.StandardContext listenerStart
Grave: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: falha ao fazer parse do descritor de runtime: javax.xml.ws.WebServiceException: Não é possível criar o JAXBContext
	at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:139)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.ws.WebServiceException: Não é possível criar o JAXBContext
	at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:166)
	at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
	at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
	at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:338)
	at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
	at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:505)
	at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
	at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
	at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:124)
	... 10 more
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at java.util.List
java.util.List does not have a no-arg default constructor.
	this problem is related to the following location:
		at java.util.List

	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:153)
	... 18 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at java.util.List
java.util.List does not have a no-arg default constructor.
	this problem is related to the following location:
		at java.util.List

	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.api.JAXBRIContext.newInstance(JAXBRIContext.java:106)
	at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:109)
	at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:161)
	at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:154)
	... 20 more

porem se eu fizer isso

@WebService(endpointInterface = "com.consisa.site.webservice.tipocontato.ServiceTipoContato", serviceName = "ServiceTipoContato", portName = "ServiceTipoContatoPort")
public class ServiceTipoContatoImpl implements ServiceTipoContato {

	@Override
	public String buscarTipoContato() {
		return "";
	}

}

quando inicializo a minha aplicação naum tenho nenhum tipo de erro, alguem saberia do que eu estou esquecendo, na verdade naum sei mesmo o que fazer para resolver

Valeu pela ajuda …

2 Respostas

duardor

Seu problema está bem claro no stacktrace:

java.util.List is an interface, and JAXB can't handle interfaces. this problem is related to the following location: at java.util.List java.util.List does not have a no-arg default constructor. this problem is related to the following location: at java.util.List

Provavelmente usando ArrayList deve eliminar o erro.

CristianPalmaSola10

Valeu duardor troquei o retorno para ArrayList e funcionou certinho value pela ajuda …

Criado 22 de agosto de 2012
Ultima resposta 22 de ago. de 2012
Respostas 2
Participantes 2