无法在Glassfish上部署JAX-WS Web服务

时间:2013-04-04 10:46:29

标签: java web-services jax-ws glassfish-3 myeclipse

我在使用Glassfish应用程序服务器运行JAX_WS Webservices时遇到问题。以前,我曾经使用Apache tomcat,它可以很好地工作。但现在,有了Glassfish,这个问题阻止了应用程序的部署......请在下面查看:

2013-04-04T13:09:23.028+0300 com.sun.xml.ws.wspolicy.com.sun.xml.ws.api.policy.ModelTranslator
SEVERE: [failed to localize] WSP_0071_ERROR_MULTIPLE_ASSERTION_CREATORS_FOR_NAMESPACE(http://schemas.xmlsoap.org/ws/2004/08/addressing, com.sun.xml.ws.security.addressing.impl.policy.AddressingPolicyAssertionCreator, com.sun.xml.ws.addressing.impl.policy.AddressingPolicyAssertionCreator)
2013-04-04T13:09:23.028+0300 com.sun.xml.ws.wspolicy.jaxws.PolicyWSDLParserExtension
SEVERE: [failed to localize] WSP_0071_ERROR_MULTIPLE_ASSERTION_CREATORS_FOR_NAMESPACE(http://schemas.xmlsoap.org/ws/2004/08/addressing, com.sun.xml.ws.security.addressing.impl.policy.AddressingPolicyAssertionCreator, com.sun.xml.ws.addressing.impl.policy.AddressingPolicyAssertionCreator)
2013-04-04T13:09:23.028+0300 com.sun.xml.ws.wspolicy.jaxws.PolicyWSDLParserExtension
SEVERE: WSP1007: Policy exception occurred when finishing WSDL parsing.
com.sun.xml.ws.policy.PolicyException: [failed to localize] WSP_0071_ERROR_MULTIPLE_ASSERTION_CREATORS_FOR_NAMESPACE(http://schemas.xmlsoap.org/ws/2004/08/addressing, com.sun.xml.ws.security.addressing.impl.policy.AddressingPolicyAssertionCreator, com.sun.xml.ws.addressing.impl.policy.AddressingPolicyAssertionCreator)
    at com.sun.xml.ws.policy.sourcemodel.PolicyModelTranslator.<init>(PolicyModelTranslator.java:188)
    at com.sun.xml.ws.api.policy.ModelTranslator.<init>(ModelTranslator.java:85)
    at com.sun.xml.ws.api.policy.ModelTranslator.<clinit>(ModelTranslator.java:74)
    at com.sun.xml.ws.policy.jaxws.BuilderHandler.getPolicies(BuilderHandler.java:102)
    at com.sun.xml.ws.policy.jaxws.BuilderHandler.getPolicySubjects(BuilderHandler.java:110)
    at com.sun.xml.ws.policy.jaxws.BuilderHandlerEndpointScope.doPopulate(BuilderHandlerEndpointScope.java:72)
    at com.sun.xml.ws.policy.jaxws.BuilderHandler.populate(BuilderHandler.java:82)
    at com.sun.xml.ws.policy.jaxws.PolicyMapBuilder.getNewPolicyMap(PolicyMapBuilder.java:109)
    at com.sun.xml.ws.policy.jaxws.PolicyMapBuilder.getPolicyMap(PolicyMapBuilder.java:91)
    at com.sun.xml.ws.policy.jaxws.PolicyWSDLParserExtension.postFinished(PolicyWSDLParserExtension.java:960)
    at com.sun.xml.ws.wsdl.parser.DelegatingParserExtension.postFinished(DelegatingParserExtension.java:191)
    at com.sun.xml.ws.wsdl.parser.WSDLParserExtensionFacade.postFinished(WSDLParserExtensionFacade.java:338)
    at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:234)
    at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:191)
    at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:160)
    at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:307)
    at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:269)
    at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:205)
    at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:195)
    at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
    at javax.xml.ws.Service.<init>(Service.java:92)
    at com.sun.xml.ws.tx.webservice.member.at.WSATCoordinator.<init>(WSATCoordinator.java:73)
    at com.sun.xml.ws.tx.at.ATCoordinator.<clinit>(ATCoordinator.java:1063)
    at sun.misc.Unsafe.ensureClassInitialized(Native Method)
    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
    at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
    at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
    at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
    at java.lang.reflect.Field.get(Field.java:358)
    at org.glassfish.web.loader.WebappClassLoader.clearReferences(WebappClassLoader.java:1798)
    at org.glassfish.web.loader.WebappClassLoader.stop(WebappClassLoader.java:1662)
    at org.glassfish.web.loader.WebappClassLoader.preDestroy(WebappClassLoader.java:1631)
    at org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:236)
    at org.glassfish.deployment.common.DeploymentContextImpl.getClassLoader(DeploymentContextImpl.java:186)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:450)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:353)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
    at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:575)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:461)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:389)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:220)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)

有人知道如何解决这个错误吗? 请注意,我使用MyEclipse作为我的Glassfish版本3.1.2

1 个答案:

答案 0 :(得分:6)

我已经看到了类似问题的引用,其中安装Glassfish Web配置文件而不是完整安装解决了这个问题。如果您需要完整安装,这显然无济于事。

尝试导出war文件并手动部署它,以防MyEclipse部署应用程序时出现问题。

某些服务器将包含一些常见的jar文件,而其他服务器则不包含。因此,您可以尝试通过MyEclipse-&gt; Web下的项目属性中的Deployment标记来调整所引用的jars部署的内容。

我也看到了通过删除对webservice-rt的依赖来部分解决的问题。我不知道这是否适用于您的项目,但是,如果是这样,您可以看看是否可以删除该依赖项。