Cannot run EE client
Hi all.
I created a simple stateless EE EJB3 and its client.
I succeed the execute the client with appclient:
C:\j2ee-projects>appclient -client testclient.jar
But I have a problem when running it with jar name:
C:\j2ee-projects>java -jar testclient.jar
Exception in thread "main" java.lang.NullPointerException
at testclient.main(testclient.java:9)
And also when running it with class name:
C:\j2ee-projects>java -cp chapter1-ejb.jar;testbeans.jar testclient
Exception in thread "main" java.lang.NoClassDefFoundError: testclient
Caused by: java.lang.ClassNotFoundException: testclient
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
Could not find the main class: testclient. Program will exit.
This is the manifest file inside testclient.jar:
Manifest-Version: 1.0
Class-Path: chapter1-ejb.jar testbeans.jar
Main-Class: testclient
Could someone tell what is the problem there?
|