• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem using the java command.  RSS feed

 
Rohan Chaudhari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written and deployed a EJB on my J2EE server. To access this service, I have written a Simple java client. However I am not able to access the service.

When I give the below command :

c:\rohan\JavaProject\ejb\Advice> java AdviceClient

It throws a RemoteException while trying to access the EJB exposed method.

While Deploying the EJB object, the tool had created a Client jar which contains the Stub by which the EJB service can be accessed by the outside world.

However when I give the below command

c:\rohan\JavaProject\ejb\Advice> java -classpath <EJB created Client jar> AdviceClient

It throws a NoClassDefFoundError exception.

Can anybody help me out in resolving this issue?

Thanks and Regards,
Rohan
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try?
"java -classpath <EJB created Client jar>:. AdviceClient"
 
Rohan Chaudhari
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried using the option suggested by Wise Owen. But that also didn't work, it still gives the NoClassDefFoundError.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What class does the exception call out as being not found?
 
Srinivas Kalvala
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rohan Chaudhari:
Hi,

I have written and deployed a EJB on my J2EE server. To access this service, I have written a Simple java client. However I am not able to access the service.

When I give the below command :

c:\rohan\JavaProject\ejb\Advice> java AdviceClient

It throws a RemoteException while trying to access the EJB exposed method.

While Deploying the EJB object, the tool had created a Client jar which contains the Stub by which the EJB service can be accessed by the outside world.

However when I give the below command

c:\rohan\JavaProject\ejb\Advice> java -classpath <EJB created Client jar> AdviceClient

It throws a NoClassDefFoundError exception.

Can anybody help me out in resolving this issue?

Thanks and Regards,
Rohan


javac -classpath .:<jar> <filename>

i think it will work....try it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!