如何使用wsit-client设置glassfish soap安全性?

时间:2014-12-01 07:29:18

标签: java security soap

我花了几乎所有的时间来解决以下问题,但没有成功。

我编写了一个客户端soap应用程序并构建到一个jar文件中。当我在main函数中调用send请求时它工作正常,但是当我在servlet中调用glassfish时,我收到以下错误。我使用wsit-client,我将它放在jar文件中的META-INF / wsit-client.xml中。

我还在glassfish上将xws_clientProvider设置为“xws_clientProvider”。

[2014-12-01T06:45:13.209+0000] [glassfish 4.1] [INFO] [] [com.sun.metro.policy] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1417416313209] [levelValue: 800] 

[[WSP5018: Loaded WSIT configuration from file: jar:file:/C:/www/apps/glassfish4/glassfish/domains/domain1/lib/usi-0.1.jar!/META-INF/wsit-client.xml.]]

    [2014-12-01T06:45:14.445+0000] [glassfish 4.1] [SEVERE] [] [com.sun.xml.wss.jaxws.impl] [tid: _ThreadID=25 _ThreadName=http-listener-1(2)] [timeMillis: 1417416314445] [levelValue: 1000] [[
      WSSTUBE0025: Error in Verifying Security in the Inbound Message.
    com.sun.xml.wss.XWSSecurityException: Security Requirements not met - No Security header in message
        at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.createMessage(SecurityRecipient.java:943)
        at com.sun.xml.ws.security.opt.impl.incoming.SecurityRecipient.validateMessage(SecurityRecipient.java:256)
        at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.verifyInboundMessage(SecurityTubeBase.java:456)
        at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processClientResponsePacket(SecurityClientTube.java:436)
        at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processResponse(SecurityClientTube.java:364)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1147)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
        at com.sun.xml.ws.client.Stub.process(Stub.java:463)
        at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:191)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:161)
        at sun.proxy.$Proxy366.createUSI(Unknown Source)
        at com.abscgroup.tutis.usi.USIService.CreateUSI(USIService.java:163)
        at com.abscgroup.tutis.servlets.USIDocumentServlet.submitUSIRequest(USIDocumentServlet.java:187)
        at com.abscgroup.tutis.servlets.USIDocumentServlet.doPost(USIDocumentServlet.java:162)
        at com.abscgroup.tutis.servlets.TutisServlet.doPost(TutisServlet.java:61)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at com.abscgroup.tutis.filters.ServletFilter.doFilter(ServletFilter.java:191)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at com.abscgroup.tutis.filters.RequestFilter.doFilter(RequestFilter.java:160)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
        at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
        at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
        at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
        at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
        at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
        at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
        at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
        at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
        at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
        at java.lang.Thread.run(Thread.java:722)
    ]]

1 个答案:

答案 0 :(得分:0)

我发现了问题。

Glassfish不会从JDK默认cacerts文件中读取证书。它在glassfish \ domains \ domain1 \ config中有自己的cacerts.jks文件。

我应该在glassfish cacerts文件中安装外部服务器证书。