2015-02-24 57 views
0

我在地鐵2.1開發Web服務,與GlassFish服務器3.1。 服務器端異常。錯誤而序列化Timestamp元素髮生在執行的規範化

[#|2015-01-30T08:00:37.325- 

0500|SEVERE|glassfish3.1.1|com.sun.xml.wss.logging.impl.opt|_ThreadID=26;_ThreadName=Thread-2;|WSS1609: Error while serializing Timestamp element|#] 

[#|2015-01-30T08:00:37.330-0500|SEVERE|glassfish3.1.1|com.sun.xml.wss.logging.impl.opt.signature|_ThreadID=26;_ThreadName=Thread-2;|WSS1759: Following error com.sun.xml.wss.XWSSecurityException: WSS1609: Error while serializing Timestamp element occured while performing canonicalization com.sun.xml.wss.XWSSecurityException: WSS1609: Error while serializing Timestamp element 
javax.xml.crypto.dsig.TransformException: com.sun.xml.wss.XWSSecurityException: WSS1609: Error while serializing Timestamp element 
    at com.sun.xml.ws.security.opt.crypto.dsig.Exc14nCanonicalizer.transform(Exc14nCanonicalizer.java:191) 
    at com.sun.xml.ws.security.opt.crypto.dsig.Transform.transform(Transform.java:183) 
    at com.sun.xml.ws.security.opt.crypto.dsig.Reference.transform(Reference.java:188) 
    at com.sun.xml.ws.security.opt.crypto.dsig.Reference.digest(Reference.java:129) 
    at com.sun.xml.ws.security.opt.crypto.dsig.Signature.sign(Signature.java:218) 
    at com.sun.xml.ws.security.opt.impl.dsig.SignatureProcessor.sign(SignatureProcessor.java:127) 
    at com.sun.xml.wss.impl.filter.SignatureFilter.sign(SignatureFilter.java:649) 
    at com.sun.xml.wss.impl.filter.SignatureFilter.process(SignatureFilter.java:608) 
    at com.sun.xml.wss.impl.HarnessUtil.processWSSPolicy(HarnessUtil.java:99) 
    at com.sun.xml.wss.impl.HarnessUtil.processDeep(HarnessUtil.java:278) 
    at com.sun.xml.wss.impl.SecurityAnnotator.processMessagePolicy(SecurityAnnotator.java:194) 
    at com.sun.xml.wss.impl.SecurityAnnotator.secureMessage(SecurityAnnotator.java:155) 
    at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.secureOutboundMessage(SecurityTubeBase.java:386) 
    at com.sun.xml.wss.jaxws.impl.SecurityServerTube.processResponse(SecurityServerTube.java:481) 
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:651) 
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:600) 
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:585) 
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:482) 
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:314) 
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:608) 
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:259) 
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.invokeAsync(ServletAdapter.java:213) 
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:159) 
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:194) 
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:80) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217) 
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:186) 
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) 
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) 
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) 
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) 
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) 
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) 
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231) 
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174) 
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828) 
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725) 
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019) 
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) 
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) 
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) 
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) 
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) 
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) 
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) 
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) 
    at java.lang.Thread.run(Thread.java:662) 
Caused by: com.sun.xml.wss.XWSSecurityException: WSS1609: Error while serializing Timestamp element 
    at com.sun.xml.ws.security.opt.impl.crypto.JAXBDataImpl.writeTo(JAXBDataImpl.java:126) 
    at com.sun.xml.ws.security.opt.crypto.dsig.Exc14nCanonicalizer.transform(Exc14nCanonicalizer.java:185) 
    ... 59 more 
Caused by: javax.xml.stream.XMLStreamException: javax.xml.bind.JAXBException: Error occurred while setting security marshaller properties 
- with linked exception: 
[javax.xml.bind.PropertyException: property "com.sun.xml.bind.namespacePrefixMapper" must be an instance of type com.sun.xml.bind.marshaller.NamespacePrefixMapper, not com.sun.xml.ws.security.opt.impl.util.WSSNamespacePrefixMapper] 
    at com.sun.xml.ws.security.opt.impl.tokens.Timestamp.writeTo(Timestamp.java:216) 
    at com.sun.xml.ws.security.opt.impl.crypto.JAXBDataImpl.writeTo(JAXBDataImpl.java:123) 
    ... 60 more 
Caused by: javax.xml.bind.JAXBException: Error occurred while setting security marshaller properties 
- with linked exception: 
[javax.xml.bind.PropertyException: property "com.sun.xml.bind.namespacePrefixMapper" must be an instance of type com.sun.xml.bind.marshaller.NamespacePrefixMapper, not com.sun.xml.ws.security.opt.impl.util.WSSNamespacePrefixMapper] 
    at com.sun.xml.ws.security.opt.impl.util.JAXBUtil.createMarshaller(JAXBUtil.java:141) 
    at com.sun.xml.ws.security.opt.impl.tokens.Timestamp.getMarshaller(Timestamp.java:221) 
    at com.sun.xml.ws.security.opt.impl.tokens.Timestamp.writeTo(Timestamp.java:214) 
    ... 61 more 

和客戶端它會給我異常像下面

Web service failed falling back A required header representing a Message Addressing Property is not present 
javax.xml.ws.soap.SOAPFaultException: A required header representing a Message Addressing Property is not present 
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189) 
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122) 
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119) 
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89) 
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:140) 
at $Proxy80.getAllSecretHavingWebServiceAccess(Unknown Source) 
at 

問題產生案例: 當我打電話的服務,我不會面臨這個問題,每一個時代。但在某些情況下,像我已經重新啓動GlassFish服務器10次,然後它的工作以及9次了10年,但它會在一次失敗,並在服務器和客戶端上面的錯誤給出。

的問題是由GlassFish的3.1與罐子裝,但我沒有得到正確的解決方案。

Glassfish的使用**/GlassFish中/模塊/ * - osgi.jar

任何有關這對我來說是很大的幫助建議。

+0

[規範化](https://www.java.net/forum/topic/glassfish/metro-and-jaxb/problem-serializing-body-message-response-when-using-saml-sender-vouches-security -模型) – 2015-02-27 11:11:54

回答

0

Jaxb-impl-2.0.1.jar罐子在GlassFish *-osgi.jar API衝突。 我已刪除了Jaxb-impl-2.0.1.jar,是所有時間運作良好。

相反的jaxb-osgi.jar,我的應用程序加載Jaxb-impl-2.0.1.jar