NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
mthalis
Joined: 04 Sep 2009 Posts: 5
|
Posted: Fri Sep 04, 2009 2:31 am Post subject: Can't Run EJB |
|
|
My Bean class
| Code: | package ejb;
import javax.ejb.Stateless;
@Stateless
public class HelloUserBean implements HelloUserRemote {
public void sayHello(String name) {
System.out.println("Hello " + name + " welcome to EJB 3 InAction!");
}
} |
Bean Interface
| Code: | package ejb;
import javax.ejb.Remote;
@Remote
public interface HelloUserRemote {
public void sayHello(String name);
} |
Client Code
| Code: | package chapter2appclient;
import ejb.HelloUserRemote;
import javax.ejb.EJB;
public class Main {
@EJB
private static HelloUserRemote helloUserBean;
public static void main(String[] args) {
helloUserBean.sayHello("Dinesh");
System.out.println("Invoked EJB successfully .. see server consolefor output");
}
} |
After run client program below Exception Throw
| Code: | Sep 4, 2009 7:53:32 AM com.sun.enterprise.appclient.MainWithModuleSupport <init>
WARNING: ACC003: Application threw an exception.
java.lang.NullPointerException
at chapter2appclient.Main.main(Main.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:461)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
... 2 more
Caused by: java.lang.NullPointerException
at chapter2appclient.Main.main(Main.java:23)
... 8 more
Java Result: 1 |
I'm using netbeans 6.7 in ubuntu environment. Please help me how to solve
this problem.
--
View this message in context: http://www.nabble.com/Can%27t-Run-EJB-tp25287317p25287317.html
Sent from the Netbeans - J2EE mailing list archive at Nabble.com.[/code] |
|
| Back to top |
|
 |
mthalis
Joined: 04 Sep 2009 Posts: 5
|
Posted: Sat Sep 05, 2009 4:17 pm Post subject: Can't Run EJB |
|
|
If I try to run netbeans sample J2EE project AnnotOvdInterceptor same error happen
I'm using netbeans 6.7
| Code: |
run-tool:
java.lang.NullPointerException
at enterprise.annot_ovd_interceptor_appclient.StatelessSessionAppClient.main(StatelessSessionAppClient.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
Sep 5, 2009 9:41:14 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
WARNING: ACC003: Application threw an exception.
java.lang.NullPointerException
at enterprise.annot_ovd_interceptor_appclient.StatelessSessionAppClient.main(StatelessSessionAppClient.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:461)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
... 2 more
Caused by: java.lang.NullPointerException
at enterprise.annot_ovd_interceptor_appclient.StatelessSessionAppClient.main(StatelessSessionAppClient.java:51)
... 8 more
Java Result: 1
run-jar:
run-display-browser:
run:
BUILD SUCCESSFUL (total time: 1 minute 1 second)
|
Why this happen....
Please help me.
This is netbeans bugs or not. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|