2013-04-23 98 views
1

我使用JBoss 5.1.0GA和JAXWS-API 2.1.1和Maven和我的web服務是JAXWS運行時異常

@WebMethod 
public GenericResponse getExternalSystems() throws java.rmi.RemoteException{ 
    return engineExternal.getExternalSystems(); 
} 

的運行時異常,我得到部署如下:

Caused by: org.jboss.ws.WSException: arg0 is not a valid property on class ClassName 
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:971) 
    at org.jboss.ws.metadata.accessor.JAXBAccessorFactory.create(JAXBAccessorFactory.java:49) 
    at org.jboss.ws.metadata.umdm.EndpointMetaData.createAccessor(EndpointMetaData.java:763) 
    at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitializeAccessors(EndpointMetaData.java:697) 
    at org.jboss.ws.metadata.umdm.EndpointMetaData.initializeInternal(EndpointMetaData.java:569) 
    at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitialize(EndpointMetaData.java:557) 
    at org.jboss.ws.metadata.umdm.ServiceMetaData.eagerInitialize(ServiceMetaData.java:433) 
    at org.jboss.ws.metadata.umdm.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:199) 
    at org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect.start(EagerInitializeDeploymentAspect.java:48) 
    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) 
    ... 30 more 

我已經發現了一些解決方案,使用Ant任務:

http://billytee.wordpress.com/2009/09/03/jboss-jax-ws-is-not-a-valid-property-on-class/

http://www.javalinux.it/wordpress/2009/03/16/ant-171-and-package-infojava-compilation-problem-of-jax-ws-generated-classes/

但我使用maven,所以我不能使用這些解決方案。 我能做什麼?

回答

1

當在Web服務實現中未正確註釋參數時會發生此錯誤。

確保所有參數都有註釋。 例如: @WebParam(name =「param_name」)

其中,param_name表示WSDL中存在的元素的名稱。

+0

問題是發生錯誤的方法根本沒有參數。這是最奇怪的事情。 – 2013-04-23 21:15:31