JAXWS运行时异常

时间:2013-04-23 16:45:14

标签: java web-services jboss jax-ws jboss5.x

我正在使用JBoss 5.1.0GA和jaxws-api 2.1.1以及maven和我的webservice

@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 个答案:

答案 0 :(得分:1)

如果在Web服务实现中未正确注释参数,则会发生此错误。

确保所有参数都有注释。 例如: @WebParam(名称= “PARAM_NAME”)

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