Home » Developer & Programmer » JDeveloper, Java & XML » EJB object - Getting Null Pointer Exception (merged 4)
EJB object - Getting Null Pointer Exception (merged 4) [message #412882] Mon, 13 July 2009 04:10 Go to next message
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

Null EJB object -Sorry, please assist to delete [message #412885 is a reply to message #412882] Mon, 13 July 2009 04:16 Go to previous messageGo to next message
ying
Messages: 143
Registered: May 2002
Senior Member
Hi, I'm so sorry, this was due to the network connection, it was too slow until I refresh it for few times.
Ying Ying

[Updated on: Mon, 13 July 2009 04:20]

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 Go to previous message
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
Previous Topic: how to extract hierarchy xml into oracle relational table
Next Topic: extract from XML
Goto Forum:
  


Current Time: Mon Jul 28 14:00:34 CDT 2014

Total time taken to generate the page: 0.10183 seconds