Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help! - ejbRemove(): java.lang.NullPointerException

1 view
Skip to first unread message

Kenneth Chin

unread,
Jan 14, 2002, 2:14:28 PM1/14/02
to
I have a loop that calls the create method of my session bean passing it the
account number.It gets the information it needs for that account, calls the
remove() method
and continues to loop for the next account.

Sometimes(50% of the time) the loop is successful, but then sometimes I get
an "ejbRemove(): java.lang.NullPointerException".

What's happening? Did the bean remove itself before I called the remove
method? Is there a problem with the pool?


Matthew Shinn

unread,
Jan 14, 2002, 3:11:40 PM1/14/02
to
Hi Kenneth,

Can you please post the stack trace of the NullPointerException?

- Matt

Kenneth Chin

unread,
Jan 14, 2002, 3:28:50 PM1/14/02
to
Stack Trace:
java.rmi.RemoteException: java.lang.NullPointerException Start server side
stack trace: java.rmi.RemoteException: java.lang.NullPointerException at
ark.PerformanceBean.ejbRemove(PerformanceBean.java:51) at
ark.PerformanceBean_33mck0_Impl.ejbRemove(PerformanceBean_33mck0_Impl.java:7
5) at
weblogic.ejb20.manager.StatefulSessionManager.remove(StatefulSessionManager.
java:761) at
weblogic.ejb20.internal.StatefulEJBObject.remove(StatefulEJBObject.java:86)
at
ark.PerformanceBean_33mck0_EOImpl.remove(PerformanceBean_33mck0_EOImpl.java:
770) at ark.PerformanceBean_33mck0_EOImpl_WLSkel.invoke(Unknown Source) at
weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:296) at
weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:265)
at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:166) at
weblogic.rmi.internal.ServerRequest.sendOneWayRaw(ServerRequest.java:92) at
weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:112) at
weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:134) at
weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35) at
$Proxy198.remove(Unknown Source) at
jsp_servlet.__perfsummary._jspService(__perfsummary.java:248) at
weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265) at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200) at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
l.java:395) at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
l.java:255) at
weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:116) at
jsp_servlet.__myark._jspService(__myark.java:267) at
weblogic.servlet.jsp.JspBase.service(JspBase.java:27) at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265) at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200) at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2456) at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2039) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139) at
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) End server side
stack trace <>

"Matthew Shinn" <matthe...@bea.com> wrote in message
news:3C433B7C...@bea.com...

Slava Imeshev

unread,
Jan 14, 2002, 4:27:39 PM1/14/02
to
Kenneth,

What do you do at line 51 in PerformanceBean.java?

Regards,

Slava Imeshev

"Kenneth Chin" <klc...@the-ark.com> wrote in message
news:3c433f98$1...@newsgroups.bea.com...

Kenneth Chin

unread,
Jan 15, 2002, 9:35:01 AM1/15/02
to
That's to throw Exception to client application if EJB catches an Exception,
so client can do what ever they want to do.


"Slava Imeshev" <ime...@yahoo.com> wrote in message
news:3c434d2e$1...@newsgroups.bea.com...

Kenneth Chin

unread,
Jan 15, 2002, 12:18:21 PM1/15/02
to
line 51 lands in this method:

public void ejbRemove() throws java.rmi.RemoteException {
// To Do
System.out.println("Calling ejbRemove");
try{
if (_prepStmt != null) _prepStmt.close();
_prepStmt=null;
System.out.println("set _prepStmt to null");
if (_rs != null) _rs.close();
_rs=null;
System.out.println("set _rs to null");
if (_conn!=null) _conn.close();
_conn=null;
System.out.println("set _conn to null");
} //line 51!
catch(Exception e){
System.out.println("ejbRemove(): " + e.getMessage());
throw new java.rmi.RemoteException(e.getMessage());
}
}

"Slava Imeshev" <ime...@yahoo.com> wrote in message
news:3c434d2e$1...@newsgroups.bea.com...

Rob Woollen

unread,
Jan 15, 2002, 7:28:21 PM1/15/02
to
You're swallowing the original NullPointerException stack trace. I would
suggest that you change your code to be something like this:

catch (Exception e) {
System.out.println("ejbRemove exception:");
e.printStackTrace();
// You should consider using javax.ejb.EJBException instead
throw new RemoteException("ejbRemoveException", e);
}

-- Rob

Kenneth Chin

unread,
Jan 16, 2002, 5:03:40 PM1/16/02
to
that doesn't exactly solve my problem...but thanks.

The thing is...this only started happening when I upgraded to WLS6.1
But I'm not entirely positive if it wouldn't have happened in previous
versions because I've only
just begun fully testing the ejb.

So I really don't know what's happening here.
"Rob Woollen" <r...@nomail.com> wrote in message
news:3C44C925...@nomail.com...

Rob Woollen

unread,
Jan 16, 2002, 6:25:33 PM1/16/02
to
Well, what's the "real" exception stack trace?

Kenneth Chin

unread,
Jan 17, 2002, 11:22:12 AM1/17/02
to
Hi...sorry if I sounded unthankful...as the problem was handed to me from
one of my
developers. I do appreciate the change in the exception code you sent me and
have passed it along

Thanks again.

Also, we figured out the problem and have fixed it. The problem was we were
closing the statement before we closed
the resultset. I believe when you close the statement, you lose your
resultset, hence the nullpointer.

What's weird is that sometimes it would work, and sometimes it doesn't. I
guess when closing the statement, the resultset
doesn't get lost immediately.

"Rob Woollen" <r...@nomail.com> wrote in message

news:3C460BED...@nomail.com...

Ramkrishna kumar

unread,
Aug 18, 2004, 6:43:26 AM8/18/04
to
I am using weblogic 6.0 sp2 and rp3
and orcle9i.
without security realm after uploading ejb and ear in weblogic server is running without error.
but after applying realm it is displaying following errors.


java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:380)
at weblogic.security.acl.AbstractListableRealm.authInternal(AbstractList
ableRealm.java:186)
at weblogic.security.acl.AbstractListableRealm.authenticate(AbstractList
ableRealm.java:127)
at weblogic.security.acl.AbstractListableRealm.getUser(AbstractListableR
ealm.java:110)
at weblogic.security.acl.CachingRealm.authenticate(CachingRealm.java:956
)
at weblogic.security.acl.CachingRealm.getUser(CachingRealm.java:863)
at weblogic.security.acl.Realm.authenticate(Realm.java:200)
at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
at weblogic.security.acl.internal.Security.authenticate(Security.java:13
2)
at weblogic.iiop.IIOPJVMConnection.getUser(IIOPJVMConnection.java:65)
at weblogic.iiop.IIOPJVMConnection.claimSocket(IIOPJVMConnection.java:17
8)
at weblogic.iiop.IIOPJVMConnection.claimSocket(IIOPJVMConnection.java:16
1)
at weblogic.socket.JVMSocketManager.accept(JVMSocketManager.java:167)
at weblogic.t3.srvr.ListenThread$RJVMListenRequest.execute(ListenThread.
java:546)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


please reply soon at
gupta_...@yahoo.com
Thanks and regards
Ram

Slava Imeshev

unread,
Aug 18, 2004, 11:21:43 AM8/18/04
to
Ram,

That is likely a weblogic bug. The problem is, version 6.0 was EOL-ed
quite some time ago. The best option for you would be upgrating
to 6.1 or 8.1.

Regards,

Slava Imeshev

"Ramkrishna kumar" <noad...@noaddress.given> wrote in message news:28267497.1092825858495.JavaMail.root@jserv5...

0 new messages