| Forum: Web Tools Project (WTP) |
|---|
| Topic: Web Service Client creation problem with Apache CXF |
|---|
| Web Service Client creation problem with Apache CXF [message #1060455] |
Fri, 24 May 2013 14:22 |
Marco Bertini Messages: 1 Registered: May 2013 |
Junior Member |
|
|
I'm having serious problems with my (initial) attempts to work with Eclipse, CXF and web service wizards.
I've successfully deployed a web service to a Glassfish server 3.1.2. Now I'm trying to create a client using the Eclipse Juno SR2 wizard for Web Service Client creation within a Dynamic Web project created for a Glassfish server 3.1.2. I can see the WSDL file from a web browser, I can create a client when using the AXIS runtime, but when I try to create the client with CXF 2.x runtime (either CXF 2.6.8 and 2.7.5) I get (http edited to obey eclipse.org forum rules about links in posts):
==
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -client -d /Users/bertini/Documents/presentazioni/lezioni/SOA/workspace/TestServiceClientGlassfish/.cxftmp/src -classdir /Users/bertini/Documents/presentazioni/lezioni/SOA/workspace/TestServiceClientGlassfish/target/classes -p http_://testservice.csiaf.unifi.it/=it.unifi.csiaf.testservice -impl -validate -exsh false -dns true -dex true -wsdlLocation http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
wsdl2java - Apache CXF 2.6.8
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/bertini/glassfish3/glassfish/modules/weld-osgi-bundle.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/apache-cxf-2.6.8/lib/slf4j-jdk14-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http_://www.slf4j.org/codes.html#multiple_bindings for an explanation.
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
org.apache.cxf.tools.common.ToolException: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:420)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
Caused by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Caused by : WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:97)
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.build(WSDLDefinitionBuilder.java:69)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:82)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:59)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:198)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
... 4 more
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:243)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:78)
... 10 more
Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:299)
at org.apache.cxf.staxutils.StaxUtils.getXMLInputFactory(StaxUtils.java:254)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1423)
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1317)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:233)
... 12 more
==
If I try to execute the wsdl2java script from command line it works and the messages are:
/usr/local/apache-cxf-2.6.8/bin/wsdl2java -client -d /Users/bertini/Documents/presentazioni/lezioni/SOA/workspace/gf/.cxftmp/src -classdir /Users/bertini/Documents/presentazioni/lezioni/SOA/workspace/gf/build/classes -p http_://testservice.csiaf.unifi.it/=it.unifi.csiaf.testservice -impl -validate -exsh false -dns true -dex true -wsdlLocation http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
Loading FrontEnd jaxws ...
Loading DataBinding jaxb ...
wsdl2java -client -d /Users/bertini/Documents/presentazioni/lezioni/SOA/workspace/gf/.cxftmp/src -classdir /Users/bertini/Documents/presentazioni/lezioni/SOA/workspace/gf/build/classes -p http_://testservice.csiaf.unifi.it/=it.unifi.csiaf.testservice -impl -validate -exsh false -dns true -dex true -wsdlLocation http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl -verbose -defaultValues -fe jaxws -db jaxb -wv 1.1 http_://localhost:8888/TestServiceGlassfish/TeamsService?wsdl
wsdl2java - Apache CXF 2.6.8
I've also seen that the code is correctly generated.
Apparently there's some problem with my Eclipse+CXF combo, but I can't figure what is causing the issue. ANy help ?
|
|
|
| Topic: Eclipse wsdl validator doesn't show exact error |
|---|
| Eclipse wsdl validator doesn't show exact error [message #1059420] |
Sat, 18 May 2013 03:05 |
Lasith Chandrasekara Messages: 3 Registered: July 2009 |
Junior Member |
|
|
Hi All,
Got a chance to work with eclipse WSDL validator. But it seems like it doesn't return exact error message when not having network connection to the ws-i.org site. It would be better if it can give detailed message by saying "this resource on ws-i.org can't find".
i.e. can't find resource ws-i.org/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml
As I can understand the connection to ws-i.org is not mandatory for WSDL validation. But since it attempts to connect to ws-i.org, when doing validation with a machine doesn't have internet connection this may consume 2-3 minutes (depending on the DNS and proxy configuration on networks). In that case it is better to have descriptive message.
Following stack-trace might be useful to understanding,
at org.eclipse.wst.wsi.internal.core.profile.impl.ProfileAssertionsReaderImpl.readProfileAssertions(ProfileAssertionsReaderImpl.java:130)
at org.eclipse.wst.wsi.internal.core.profile.impl.ProfileAssertionsReaderImpl.readProfileAssertions(ProfileAssertionsReaderImpl.java:72)
at org.eclipse.wst.wsi.internal.WSITestToolsProperties.getProfileAssertions(WSITestToolsProperties.java:93)
at org.eclipse.wst.wsi.internal.core.analyzer.BasicProfileAnalyzer.validateConformance(BasicProfileAnalyzer.java:209)
at org.eclipse.wst.wsi.internal.core.analyzer.Analyzer.validateAll(Analyzer.java:198)
at org.eclipse.wst.wsi.internal.analyzer.WSDLAnalyzer.validateConformance(WSDLAnalyzer.java:158)
at org.eclipse.wst.wsi.internal.validate.wsdl.WSDLValidator.validate(WSDLValidator.java:291)
As my understanding here the problem is in WSITestToolsProperties.getProfileAssertions(). Where it catches the exception and return null results.
-------------------------------
catch (Exception e)
{
result = null;
}
-------------------------------
So from this point onwards we are not throwing the excact error message.
Anyway the final log message is (it don't have information about ws-r resource path),
WS-I: A problem occured while running the WS-I WSDL conformance check: org.eclipse.wst.wsi.internal.analyzer.WSIAnalyzerException: The WS-I Test Assertion Document (TAD)document was either not found or could not be processed.The WSDLAnalyzer was unable to validate the given WSDL File.
Reagards,
-Lasith Chandrasekara
|
|
|
Powered by
FUDForum. Page generated in 0.03008 seconds