I am having problem with the trial example given in the first chapter of the HeadFirst
EJB book. I followed all the steps for creation/deployment. Now when I am trying to execute the client I am getting a noclassdeffound error or NoSuchMethodError.
I have seen the previous posts about this problem and I tried all possible way but no Luck.
Would appreciate if any one can explain the reason for this error
I have working Folder like
C:\Vishnu\SCBCD\Examples\Example1
12/22/2004 07:32 PM <DIR> .
12/22/2004 07:32 PM <DIR> ..
12/22/2004 06:24 PM 173 Advice.java
12/22/2004 07:05 PM 3,442 AdviceApp.ear
12/22/2004 07:06 PM 21,819 AdviceAppClient.jar
12/22/2004 06:44 PM 817 AdviceBean.java
12/22/2004 08:08 PM 202 AdviceClient.class
12/22/2004 07:07 PM 226 AdviceClient.java
12/22/2004 06:50 PM 187 AdviceHome.java
12/22/2004 06:55 PM <DIR> headfirst
I was able to compile the file AdviceClient.java in both the below ways successfully
javac AdviceClient.java
and
C:\Vishnu\SCBCD\Examples\Example1>
java -cp %MYEJB%;AdviceAppClient.jar AdviceClient
Here %MYEJB% is C:\j2sdkee1.3.1\lib\j2ee.jar (MYEJB my System Variable)
I am trying to run the Class file AdviceClient like below
Style 1
========
C:\Vishnu\SCBCD\Examples\Example1>java -cp %MYEJB%;AdviceAppClient.jar;. AdviceClient
Error : Exception in
thread "main" java.lang.NoSuchMethodError: main
Style 2
========
C:\Vishnu\SCBCD\Examples\Example1>java -cp C:\j2sdkee1.3.1\lib\j2ee.jar;AdviceAppClient.jar;C:\Vishnu\SCBCD\Examples\Example1 AdviceClient
Error: Exception in thread "main" java.lang.NoSuchMethodError: main
Style 3:
===============
C:\Vishnu\SCBCD\Examples\Example1>java -cp %MYEJB%;AdviceAppClient.jar AdviceClient
Error: Exception in thread "main" java.lang.NoClassDefFoundError: AdviceClient
No luck on any of these trials.
Thanks for any suggestions