Добрый день.
Пытаюсь сформировать сообщения для ФСС(тестовый контур) и подписать его. За основу взял исходный код из
https://www.cryptopro.ru...lzovaniem-kriptopro-jcp. Если запускать полученный код через main-метод, то все замечательно формируется, подписывается и проходит проверки на стороне ФСС.
При попытке использовать полученный код уже на GlassFish на методе javax.xml.crypto.dsig.XMLSignature.sign получаю ошибку:
[2018-06-26T10:10:37.393+0300] [glassfish 5.0] [SEVERE] [] [] [tid: _ThreadID=72 _ThreadName=Thread-9] [timeMillis: 1529997037393] [levelValue: 1000] [[
javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: Couldn't find Transform for:
http://www.w3.org/2001/10/xml-exc-c14n# at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMReference.transform(DOMReference.java:460)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMReference.digest(DOMReference.java:334)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMXMLSignature.digestReference(DOMXMLSignature.java:450)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:349)
at russvet.service.s06.fss.SignMessageFss.signMessageLnData(SignMessageFss.java:176)
at com.oracle.sca.soapservice.bpm_services.s06_cryptopro.s06_cryptopro.S06CryptoProImpl.getLnDataFSS(S06CryptoProImpl.java:425)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.webservices.InstanceResolverImpl$1.invoke(InstanceResolverImpl.java:144)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
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.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:136)
at org.glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:142)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
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.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:136)
at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:209)
at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:141)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
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.server.WSEndpointImpl$2.process(WSEndpointImpl.java:419)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:868)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:422)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169)
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:169)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:706)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:338)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:169)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:463)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)
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:539)
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:593)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:573)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.xml.crypto.dsig.TransformException: Couldn't find Transform for:
http://www.w3.org/2001/10/xml-exc-c14n# at ru.CryptoPro.JCPxml.dsig.internal.dom.ApacheCanonicalizer.transform(ApacheCanonicalizer.java:185)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMTransform.transform(DOMTransform.java:148)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMReference.transform(DOMReference.java:457)
... 71 more
Caused by: java.lang.ClassCastException: org.apache.xml.security.transforms.implementations.TransformC14NExclusive cannot be cast to org.apache.xml.security.transforms.TransformSpi
at org.apache.xml.security.transforms.Transform.initializeTransform(Transform.java:338)
at org.apache.xml.security.transforms.Transform.<init>(Transform.java:131)
at ru.CryptoPro.JCPxml.dsig.internal.dom.ApacheCanonicalizer.transform(ApacheCanonicalizer.java:178)
... 73 more
javax.xml.crypto.dsig.TransformException: Couldn't find Transform for:
http://www.w3.org/2001/10/xml-exc-c14n# at ru.CryptoPro.JCPxml.dsig.internal.dom.ApacheCanonicalizer.transform(ApacheCanonicalizer.java:185)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMTransform.transform(DOMTransform.java:148)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMReference.transform(DOMReference.java:457)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMReference.digest(DOMReference.java:334)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMXMLSignature.digestReference(DOMXMLSignature.java:450)
at ru.CryptoPro.JCPxml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:349)
at russvet.service.s06.fss.SignMessageFss.signMessageLnData(SignMessageFss.java:176)
at com.oracle.sca.soapservice.bpm_services.s06_cryptopro.s06_cryptopro.S06CryptoProImpl.getLnDataFSS(S06CryptoProImpl.java:425)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at j]]
Может кто сталкивался с данной проблемой и знает в чем причина?