1

我有一个 JAX-WS Web 服务部署到 Weblogic 12c 服务器。我正在使用 Eclipse 进行开发,并且我有一个 Maven 项目,我在其中创建了 Web 服务。到目前为止,它工作正常。

现在我想给它添加一个安全策略(UsernameToken)。因此,我为 Metro 项目添加了 maven 依赖项:

<dependency>
    <groupId>org.glassfish.metro</groupId>
    <artifactId>webservices-rt</artifactId>
    <version>2.3</version>
</dependency>

但是当我尝试部署时,我得到以下堆栈跟踪:

<30/Out/2013 12H32m WET> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "1383136332821" for task "7". Error is: "

Unable to deploy EJB: webservices-0.0.1-SNAPSHOT.jar from webservices-0.0.1-SNAPSHOT.jar:

[HTTP:101216]Servlet: "WSEE_SERVLET" failed to preload on startup in Web application: "/ServiceImpl".
java.lang.NullPointerException
    at com.sun.xml.ws.security.opt.impl.util.CertificateRetriever.getEndpointOROperationalLevelPolicy(CertificateRetriever.java:341)
    at com.sun.xml.ws.security.opt.impl.util.CertificateRetriever.checkforEPRIdentity(CertificateRetriever.java:224)
    at com.sun.xml.wss.provider.wsit.IdentityEPRExtnContributor.getEPRExtension(IdentityEPRExtnContributor.java:111)
    at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:210)
    at weblogic.wsee.jaxws.WLSContainer$WLSEndpointFactory$WLSEndpointImpl.<init>(WLSContainer.java:611)
    at weblogic.wsee.jaxws.WLSContainer$WLSEndpointFactory.createEndpoint(WLSContainer.java:564)
    at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:263)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:546)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:525)
    at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:601)
    at weblogic.wsee.jaxws.JAXWSDeployedServlet.getEndpoint(JAXWSDeployedServlet.java:183)
    at weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:139)
    at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:68)
    at weblogic.wsee.jaxws.JAXWSDeployedServlet.init(JAXWSDeployedServlet.java:54)
    at javax.servlet.GenericServlet.init(GenericServlet.java:240)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
    at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:60)
    at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:34)
    at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:624)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:565)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1874)
    at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1848)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1738)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
    at weblogic.wsee.deploy.WseeWebappModule.activate(WseeWebappModule.java:151)
    at weblogic.wsee.deploy.WSEEEjbModule.activate(WSEEEjbModule.java:446)
    at weblogic.wsee.deploy.AppDeploymentExtensionFactory.activate(AppDeploymentExtensionFactory.java:112)
    at weblogic.wsee.deploy.AppDeploymentExtensionFactory.access$200(AppDeploymentExtensionFactory.java:15)
    at weblogic.wsee.deploy.AppDeploymentExtensionFactory$1.activate(AppDeploymentExtensionFactory.java:186)
    at weblogic.application.internal.flow.AppDeploymentExtensionFlow.activate(AppDeploymentExtensionFlow.java:37)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:61)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:582)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:148)
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:114)
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:335)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
    at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)


"

有人可以对此提出一些想法吗?

4

1 回答 1

1

Weblogic 有它自己的 WS 实现。提供更好的使用范围以防止部署 Metro 版本:

<dependency> <groupId>org.glassfish.metro</groupId> <artifactId>webservices-rt</artifactId> <version>2.3</version> <scope>provided</scope> </dependency>

于 2014-07-31T09:19:08.000 回答