EJB object - Getting Null Pointer Exception (merged 4) [message #412882] |
Mon, 13 July 2009 04:10 |
ying
Messages: 143 Registered: May 2002
|
Senior Member |
|
|
Hi,
I'm new to EJB 3. Now starting learning EJB 3 by using JDeveloper (10.1.3.3).
I'm trying to create a simple JSP page which call EJB(http://gardiary.wordpress.com/2009/01/05/the-most-basic-call-ejb-3-from-servlet-or-jsp/), but after deploy in the OC4J, I encounter error message as below:
Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
After checking the log file, found that it has error message - > java.lang.NullPointerException
Below is the sample jsp page:
<%@ page import="com.ejbapps.SessionEJBHello" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.naming.Context" %>
<html>
<head><title>Hello EJB 3 !</title></head>
<body>
<%!
SessionEJBHello HelloEjb ;
%>
<%
try {
Context context = new InitialContext();
HelloEjb = (SessionEJBHello) context.lookup(SessionEJBHello.class.getName());
}
catch(Exception e) {
// exception code here
}
%>
Object HelloEjb Directly : <%= HelloEjb %>
Print Hello : <%= HelloEjb.printHello("Ujang") %>
</body>
</html>
When tried to run the page and get the value of <%= HelloEjb %>
it is null.
Attached herewith the text file which contain the java code for my EJB beans.
Pls advise.
Regards,
Ying Ying
[Updated on: Mon, 13 July 2009 06:30] by Moderator Report message to a moderator
|
|
|
|
EJB object - Getting Null Pointer Exception [message #413228 is a reply to message #412882] |
Tue, 14 July 2009 21:26 |
ying
Messages: 143 Registered: May 2002
|
Senior Member |
|
|
Hi,
First I wish to clarify. Previously I did submit this thread, but due to netweork connection problem, I cause to submit three threads so I requested to delete two similiar threads. I still need advise for this thread, on below.
I'm new to EJB 3. Now starting learning EJB 3 by using JDeveloper (10.1.3.3).
I'm trying to create a simple JSP page which call EJB(http://gardiary.wordpress.com/2009/01/05/the-most-basic-call-ejb-3-from-servlet-or-jsp/), but after deploy in the OC4J, I encounter error message as below:
Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
After checking the log file, found that it has error message - > java.lang.NullPointerException
Below is the sample jsp page:
<%@ page import="com.ejbapps.SessionEJBHello" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="javax.naming.Context" %>
<html>
<head><title>Hello EJB 3 !</title></head>
<body>
<%!
SessionEJBHello HelloEjb ;
%>
<%
try {
Context context = new InitialContext();
HelloEjb = (SessionEJBHello) context.lookup(SessionEJBHello.class.getName());
}
catch(Exception e) {
// exception code here
}
%>
Object HelloEjb Directly : <%= HelloEjb %>
Print Hello : <%= HelloEjb.printHello("Ujang") %>
</body>
</html>
When tried to run the page and get the value of <%= HelloEjb %>
it is null.
Attached herewith the text file which contain the java code for my EJB beans.
Pls advise.
Regards,
Ying Ying
|
|
|