Hi Ranchers,
My stateless session bean(FooBean) has only @Stateless annotation. My
JSP (di_foo_test.jsp) simply has @EJB annotation for injecting the remote biz interface(FooRemote) annotated with @Remote.
I have index.htm as:
I have di_foo_test.jsp defined as:
My web.xml contains
I tried deploying the ejb-jar(foo.jar) first and foowebapp.war next in glassfish. Then when I hit index.htm and submit some message, I got org.apache.jasper.JasperException: java.lang.NullPointerException. I checked logs and found following:
[#|2009-07-25T08:48:42.343+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=httpSSLWorkerThread-8080-1;_RequestID=c70c606b-697b-4da0-a9cd-074c932a7a0f;|StandardWrapperValve[EJBTestJsp]: PWC1406: Servlet.service() for
servlet EJBTestJsp threw exception
java.lang.NullPointerException
at org.apache.jsp.di_005ffoo_005ftest_jsp._jspService(di_005ffoo_005ftest_jsp.java:58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
...
...
...
Then I undeployed both the ejb-jar and webapp. Created fooapp.ear containing foo.jar and foowebapp.war. Deployed it in glassfish. Tried to access my
EJB client via
http://localhost:8080/foowebapp . Tried to send some message via index.htm, but still getting the same error.
1. Can some one explain me what's going wrong? The DI works fine if I create a servlet EJb client(FooServlet ).
2. Inspired by succesful EJB DI in jsp in the posting
https://coderanch.com/t/414899/EJB-Other-Java-EE-Technologies/java/Glassfish-EJB-web-client-EJB , I am very much keen to see it working. But despite lots n lots of attempts getting failures. Please help ?
3. In the posting Raf Szczypiorski, stated "one has to specify the jsp explicitly in web.xml for injection to work". Is it true ? Doesn't seem to work for me.
FYI, I am using Sun
Java System Application Server 9.1_02 (build b04-fcs) installed via(glassfish-installer-v2ur2-b04-windows.jar) and JDK1.5.0.11 .