The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

anoir (1) [Avatar] Offline
#1
I know this question has been answered 100 times but I really don't know how to work with J2EE5 + Eclipse + GlassfishV2.1.1

I searched the forum and followed the example in
http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html
and has no problem

I tried the method in appendix E to use "ant" "ant run" to run the HelloWorld example with no problem..

but when I run the example in elipse, it always show

Exception in thread "main" java.lang.NullPointerException
at ejb3inaction.example.HelloUserClient.main(HelloUserClient.java:12)

if I change to use

@Stateless(mappedName="ejb/testJNDI")

in the bean class and use

HelloUser bean = (HelloUser) ctx.lookup("ejb/testJNDI");
bean.sayHello("Curious George");

to lookup, then it is ok

but i want to use @EJB annotation. I don't know how to setup to use it correctly because it always show NullPointerException, and the book keep telling me that how good annotation is.

After searching from goolge and this forum, I know I have to setup something called ACC for the client, but I have no idea what it is and how to set it up.
So.. please just tell me how to run the client. or at least tell me which part in the book shows how to setup the ACC and run the client

I believe 9 out of 10 beginner have this problem since so many people have asked.

Please help! many thanks

Message was edited by:
anoir

Message was edited by:
anoir

Message was edited by:
anoir

Message was edited by:
anoir