function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

generate partner.jar from related wsdl file

I have the force-wsc-27.0.0.jar from maven repo and wsdl file from my org.

I am trying to generate partner.jar using following command:

java -classpath force-wsc-29.0.0.jar partener.wsdl  partenerNew.jar

Error :-

Exception in thread "main" java.lang.NoClassDefFoundError: org/stringtemplate/v4/STGroupDir
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(
        at java.lang.Class.getMethod0(
        at java.lang.Class.getMethod(
        at sun.launcher.LauncherHelper.validateMainClass(
        at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: org.stringtemplate.v4.STGroupDir
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        ... 6 more

please guide me..
thanks in advance.. 
Colm MitchellColm Mitchell

I had the same issue last week and needed to download and reference additional JAR files to get it sorted.  I took a note of what I ran at the time (windows) - I maybe had to use an older version of java too by the looks of it:

C:\Development\Salesforce\API>C:\Development\jdk1.6.0_21\bin\java.exe -Dpackage-prefix=wsc -classpath force-wsc-29.0.0.jar;js-1.7R2.jar;stringtemplate-4.0.2.jar;antlr-complete-3.5.1.jar partner.wsdl partner.jar

The additonal JAR files are available from here:

Perhaps if you install maven and reference it in your windows environment settings then it might find these packages automatically...

Good luck,

Leslie NikielLeslie Nikiel
Yeah, it looks like the force-wsc package in turn depends on the org.antlr ST4 and antlr-runtime packages.  After adding the dependencies to my maven pom.xml file and updated dependencies, I was able to find them in my $HOME/.m2 directory.  Then the following worked for me:
java -classpath force-wsc-34.0.0.jar:$HOME/.m2/repository/org/antlr/ST4/4.0.7/ST4-4.0.7.jar:$HOME/.m2/repository/org/antlr/antlr-runtime/3.5/antlr-runtime-3.5.jar metadata.wsdl metadata.jar

Home this helps.