EXECUTING THE CODE IN macOS Sierra Version 10.12.3

Unable to generate Java Stub File.

Code executing in Terminal

java -classpath /Users/main/Desktop/MWC/force-wsc-39.0.3.jar:/Users/main/Desktop/MWC/rhino- com.sforce.ws.tools.wsdlc /Users/main/Desktop/MWC/enterprise.wsdl /Users/main/Desktop/MWC/enterprise_stub.jar

I have downloaded enterprise.wsdl from salesforce org.

I have downloaded force-wsc-39.0.3.jar , rhino1.7.7.1.jar and ST-4.0.8.jar from maven

I am using the current Java version

java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Davidss-MacBook-Air:~ main$ java -classpath /Users/main/Desktop/MWC/force-wsc-39.0.3.jar:/Users/main/Desktop/MWC/rhino- com.sforce.ws.tools.wsdlc /Users/main/Desktop/MWC/enterprise.wsdl /Users/main/Desktop/MWC/enterprise_stub.jar
Exception in thread "main" java.io.FileNotFoundException: /Users/main/Desktop/MWC/enterprise.wsdl (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at java.net.URL.openStream(URL.java:1045)
    at com.sforce.ws.wsdl.WsdlFactory.create(WsdlFactory.java:47)
    at com.sforce.ws.codegen.Generator.generate(Generator.java:94)
    at com.sforce.ws.tools.wsdlc.run(wsdlc.java:115)
    at com.sforce.ws.tools.wsdlc.run(wsdlc.java:149)
    at com.sforce.ws.tools.wsdlc.main(wsdlc.java:71)
  • Is the enterprise WSDL at the path /Users/main/Desktop/MWC/enterprise.wsdl? Commented Mar 29, 2017 at 20:28
  • Yes all the files are in the same folder force-wsc-39.0.3, rhino1.7.7.1,ST-4.0.8 and enterprise.wsdl
    – david raj
    Commented Mar 30, 2017 at 4:31
  • All indications from the stack trace is that it can't open a FileInputStream to that path. It's hard to find an authoritative source for WsdlFactory it see what it is doing. Can you create a FileInputStream to that path in your own Java application? Commented Mar 30, 2017 at 6:49
  • How to do that would you please help
    – david raj
    Commented Mar 30, 2017 at 6:51
  • I'm more of a C# person than Java myself, but just make the simplest Java program you can that runs this line: java.io.InputStream in = new java.io.FileInputStream("/Users/main/Desktop/MWC/enterprise.wsdl"); Commented Mar 30, 2017 at 7:00


You must log in to answer this question.

Browse other questions tagged .