Forum Discussion

apoorva's avatar
apoorva
Occasional Contributor
16 years ago

Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/Cr

Hi All,

I created java program which create mockresponses for web service. I put java file (CreateWsdlProject.java) under com.eviware.soapui and I created bat file under dist_standalone\bin. along with xxxrunner.bat files. I set all classpath as well.

My bat file looks like this


set JAVA=..\jre\bin\java
rem init classpath

set CLASSPATH=soapui-2.0.2.jar
set CLASSPATH=%CLASSPATH%;..\lib\activation-1.1.jar
set CLASSPATH=%CLASSPATH%;..\lib\javamail-1.4.jar
...........
......
set CLASSPATH=%CLASSPATH%;..\lib\bcprov-jdk15-138.jar

rem JVM parameters, modify as appropriate
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx256m -Dsoapui.properties=soapui.properties

"%JAVA%" %JAVA_OPTS% -cp "%CLASSPATH%" com.eviware.soapui.CreateWsdlProject %*


But when I run this bat file it shows me error like

Exception in thread "main" java.lang.NoClassDefFoundError: com/eviware/soapui/CreateWsdlProject

I also make sure that class file is also available at above mentioned location..

Is there any other dependencies that I have to look..

I will appreciate if any input will be available.

Regards,
Jim

3 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    where have you put the compiled class file for your CreateWsdlProject class?

    regards,

    /Ole
    eviware.com
  • apoorva's avatar
    apoorva
    Occasional Contributor
    Hi Ole,

    I put my class file under following path
    soapui-2.0.2\target\classes\com\eviware\soapui\CreateWsdlProject.class

    and my source file is under following path
    soapui-2.0.2\src\java\com\eviware\soapui\CreateWsdlProject.java


    and bat file which run CreateWSdlProject class is under
    soapui-2.0.2\src\dist_standalone\bin\createprojectRunner.bat

    Looking forward to hear from you.

    Thanks,
    Jim
  • apoorva's avatar
    apoorva
    Occasional Contributor
    Hi,

    I found the solution.. when we compile the project using maven.. It create target directory.. In this directory we can find soapui-VersionName.jar I am using soapui 2.0.2 so mine jar file is soapui-2.0.2.jar

    This jar file contains information about all classes and u have to put the path of this file in classpath then and only then your class will be identify.
    Does not matter whether u have class file in correct location or not.. make sure u have latest soapui-2.0.2.jar file in ur classpath

    May be there is alternative solution also but this is working for me now

    Regards,
    Jim