cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Freeman Fang <freeman.f...@gmail.com>
Subject Re: ServiceConstructionException
Date Mon, 16 Sep 2013 09:48:24 GMT
Hi,

You need have woodstox 4.2.0 on your class path, which can provide a secure XMLInputFactory
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋



On 2013-9-16, at 下午5:43, Darko Androcec wrote:

> Hi all,
> 
> in my code I need to dynamically call web services, and I use Apache CFX for that purpose:
> 
> public static void dynamicCallToWebService(String serviceUrl, String serviceName){
> 
>        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
>        Client client = dcf.createClient(serviceUrl);
> 
>        Object[] res;
>        try {
>            res = client.invoke(serviceName);
>            System.out.println("Service response: " + res[0]);
>        } catch (Exception ex) {
> Logger.getLogger(TestExecuteAction.class.getName()).log(Level.SEVERE, null, ex);
>        }
> 
>    }
> 
> When I call the dynamicCallToWebService method from Java console application, everything
is fine, the appropriate web services are successfully invoked and they return the expected
results. But when I use the aforementioned method in web service in Java web application that
is deployed on GlassFish Server Open Source Edition 3.1.2.2, I 've got the org.apache.cxf.service.factory.ServiceConstructionException.
> 
> Do anyone know what I have to do in order to solve this problem?
> 
> Thanks,
> Darko
> 
> Complete error from Glassfish log:
> 
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:86)
>    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:295)
>    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:240)
>    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:233)
>    at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:188)
>    at hr.org.foi.aiplanning.services.WebServicesFromPlanExecutor.dynamicCallToWebService(WebServicesFromPlanExecutor.java:52)
>    at hr.org.foi.aiplanning.services.WebServicesFromPlanExecutor.findWebServiceFromSAWSDL(WebServicesFromPlanExecutor.java:174)
>    at hr.org.foi.aiplanning.services.WebServicesFromPlanExecutor.execute(WebServicesFromPlanExecutor.java:93)
>    at hr.org.foi.aiplanning.services.AiPlanningService.executeServicesFromPlan(AiPlanningService.java:40)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>    at java.lang.reflect.Method.invoke(Method.java:597)
>    at org.glassfish.webservices.InstanceResolverImpl$1.invoke(InstanceResolverImpl.java:143)
>    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)
>    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:94)
>    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:961)
>    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
>    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
>    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
>    at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
>    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:961)
>    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
>    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
>    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
>    at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:116)
>    at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:212)
>    at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:144)
>    at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
>    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:961)
>    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:910)
>    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:873)
>    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:775)
>    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:386)
>    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:640)
>    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:263)
>    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)
>    at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:145)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
>    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
>    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
>    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
>    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
>    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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
>    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
>    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
>    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
>    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
>    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
>    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
>    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:619)
> Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException:
Cannot create a secure XMLInputFactory
>    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:254)
>    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:203)
>    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:84)
>    ... 70 more
> Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
>    at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:303)
>    at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:258)
>    at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1469)
>    at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1371)
>    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:244)
>    ... 72 more
> 
> SEVERE: WebModule[/SemanticCloudClient1]Exception while dispatching incoming RPC call
> com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void
dandrocec.gwt.interoperability.client.GwtInteroperabilityService.executeFoundPlan(java.lang.String)'
threw an unexpected exception: com.sun.xml.ws.fault.ServerSOAPFaultException: Client received
SOAP Fault from server: Failed to create service. Please see the server log to find more detail
regarding exact cuase of the failure.
>    at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385)
>    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588)
>    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
>    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
>    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
>    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
>    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
>    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
>    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
>    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 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
>    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
>    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
>    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
>    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
>    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
>    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
>    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:619)
> Caused by: com.sun.xml.ws.fault.ServerSOAPFaultException: Client received SOAP Fault
from server: Failed to create service. Please see the server log to find more detail regarding
exact cuase of the failure.
>    at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:193)
>    at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:126)
>    at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:247)
>    at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:177)
>    at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:256)
>    at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:128)
>    at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:102)
>    at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:151)
>    at $Proxy275.executeServicesFromPlan(Unknown Source)
>    at dandrocec.gwt.interoperability.server.GwtInteroperabilityServiceImpl.executeServicesFromPlan(GwtInteroperabilityServiceImpl.java:101)
>    at dandrocec.gwt.interoperability.server.GwtInteroperabilityServiceImpl.executeFoundPlan(GwtInteroperabilityServiceImpl.java:28)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>    at java.lang.reflect.Method.invoke(Method.java:597)
>    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
>    ... 34 more
> 
> 
> 
> 
> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message