-
1. Re: java.lang.reflect.InvocationTargetException while creating Java Files from WSDL
slayercode2 Feb 14, 2015 6:27 PM (in response to amit4497)1 of 1 people found this helpfulYour wsdl file contains these lines to include xsd files:
<xsd:include schemaLocation="common/MXMeta.xsd"/>
<xsd:include schemaLocation="MXINCIDENT_WSTB.xsd"/>
<xsd:include schemaLocation="common/mxincident_wst.xsd"/>
Check if the common/MXMeta.xsd, MXINCIDENT_WSTB.xsd and common/mxincident_wst.xsd files are present in your root directory (i.e., at the same level of "web_MXINCIDENT_WS.wsdl").
-
2. Re: java.lang.reflect.InvocationTargetException while creating Java Files from WSDL
amit4497 May 8, 2015 2:48 AM (in response to amit4497)The xsd files are present in the root directory, still I am facing that issue.
Also I have one more wsdl, with that wsdl also I was facing the same issue.
Is there any way to see the logs while Switchyard tries to generate the Java files from wsdl?
-
3. Re: java.lang.reflect.InvocationTargetException while creating Java Files from WSDL
bfitzpat May 8, 2015 8:44 AM (in response to amit4497)1 of 1 people found this helpfulIn order to try and reproduce this issue, can you provide all the required xsds in a zip? Also, can you see anything in the error log in Eclipse (the workspace .metadata/.log file) that might point us in a direction?
I suspect you may have to change the schema locations for those three schemas.
Description Resource Path Location Type
schema_reference.4: Failed to read schema document 'file:///E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/java/common/mxincident_wst.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. web_MXINCIDENT_WS.wsdl /switchyard-example/src/main/resources line 7 WSDL Problem
schema_reference.4: Failed to read schema document 'file:///E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/java/common/MXMeta.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. web_MXINCIDENT_WS.wsdl /switchyard-example/src/main/resources line 5 WSDL Problem
schema_reference.4: Failed to read schema document 'file:///E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/java/MXINCIDENT_WSTB.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. web_MXINCIDENT_WS.wsdl /switchyard-example/src/main/resources line 6 WSDL Problem
Is the common directory a subdirectory of src/main/resources? Is MXINCIDENT_WSTB.xsd in the same directory as web_MXINCIDENT_WS.wsdl?
I am seeing this when I try locally:
!ENTRY org.switchyard.tools.ui 4 0 2015-05-08 06:39:20.344
!MESSAGE Java generation failed.
!STACK 0
java.lang.reflect.InvocationTargetException
at org.switchyard.tools.cxf.WSDL2JavaOperation.run(WSDL2JavaOperation.java:77)
at org.switchyard.tools.ui.operations.CreateJavaFromWSDLOperation.run(CreateJavaFromWSDLOperation.java:58)
at org.switchyard.tools.ui.wizards.WSDL2JavaOptionsWizardPage.createType(WSDL2JavaOptionsWizardPage.java:109)
at org.switchyard.tools.ui.wizards.WSDL2JavaWizard$1.run(WSDL2JavaWizard.java:56)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
at org.switchyard.tools.ui.wizards.WSDL2JavaWizard.performFinish(WSDL2JavaWizard.java:71)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction.run(WizardShortcutAction.java:98)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: org.apache.cxf.tools.common.ToolException: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/resources/web_MXINCIDENT_WS.wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'common/MXMeta.xsd'.: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:294)
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.switchyard.tools.cxf.WSDL2JavaOperation.run(WSDL2JavaOperation.java:75)
... 50 more
Caused by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/resources/web_MXINCIDENT_WS.wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'common/MXMeta.xsd'.: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
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:84)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:61)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:171)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
... 54 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'common/MXMeta.xsd'.: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:242)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:78)
... 60 more
Caused by: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:619)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
... 70 more
Root exception:
org.apache.cxf.tools.common.ToolException: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/resources/web_MXINCIDENT_WS.wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'common/MXMeta.xsd'.: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:294)
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.switchyard.tools.cxf.WSDL2JavaOperation.run(WSDL2JavaOperation.java:75)
at org.switchyard.tools.ui.operations.CreateJavaFromWSDLOperation.run(CreateJavaFromWSDLOperation.java:58)
at org.switchyard.tools.ui.wizards.WSDL2JavaOptionsWizardPage.createType(WSDL2JavaOptionsWizardPage.java:109)
at org.switchyard.tools.ui.wizards.WSDL2JavaWizard$1.run(WSDL2JavaWizard.java:56)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:466)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:374)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1059)
at org.switchyard.tools.ui.wizards.WSDL2JavaWizard.performFinish(WSDL2JavaWizard.java:71)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:853)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:438)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:619)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
at org.eclipse.jface.window.Window.open(Window.java:808)
at org.eclipse.ui.internal.navigator.wizards.WizardShortcutAction.run(WizardShortcutAction.java:98)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/E:/workspaces/runtime-New_configuration-04-MAY-2015/switchyard-example/src/main/resources/web_MXINCIDENT_WS.wsdl
Caused by : WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'common/MXMeta.xsd'.: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
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:84)
at org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.build(JAXWSDefinitionBuilder.java:61)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:171)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:138)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
... 54 more
Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/types/xsd:schema): faultCode=PARSER_ERROR: Problem parsing 'common/MXMeta.xsd'.: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:242)
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:191)
at org.apache.cxf.wsdl11.WSDLDefinitionBuilder.parseWSDL(WSDLDefinitionBuilder.java:78)
... 60 more
Caused by: java.io.FileNotFoundException: C:\fusetools-luna\eclipse\common\MXMeta.xsd (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:619)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
... 70 more
-
4. Re: java.lang.reflect.InvocationTargetException while creating Java Files from WSDL
slayercode2 May 8, 2015 4:07 PM (in response to bfitzpat)Hi
I suggest to try using the wsimport tool to solve your issue.
Here a good example how to use this tool JAX-WS : wsimport tool examplehttp://www.mkyong.com/webservices/jax-ws/jax-ws-wsimport-tool-example/.
You can use the argument -verbose to see the output messages about what the compiler is doing.