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

Stateless Session Bean NullPointerException ?

2 views
Skip to first unread message

Vic

unread,
Nov 5, 2001, 3:58:10 PM11/5/01
to
Has anyone found a solution / workaround to this bug ?

(2) NullPointerException:
Sometimes, we encountered NullPointerException, when we take a look
at the
*EOImpl_WLStub.java wich is generated by ejbc, we guess we find the
possible reason
why it encountered this error, following is its ensureInitialized():

private static void ensureInitialized() {
if (initialized) return;
try {
synchronized (lock) {

if (initialized) return;

initialized = true;

}
$method_0 = javax.ejb.EJBObject.class.getMethod("isIdentical",
new java.lang.Class[]
{javax.ejb.EJBObject.class});
methods[0] = $method_0;
$method_1 =
glog.database.security.Security.class.getMethod("getAutoGrantee",
new java.lang.Class[] {java.lang.String.class, java.lang.String.class});

methods[1] = $method_1;
..


If we have many methods for this session bean, then the
initialization method
will have to initialize all these methods,
suppose we have two threads come in to ask the service of the session
bean, then
it initalize the first *EOImpl_WLStub, because it will first mark it as
initialized
then do the method initlization job, it should take time for we have
around 100
methods, then the second thread initliaze *EOImpl_WLStub, because the
first thread
has mark it as intialized, while this time the first thread is still in
the processing
the method initialization, the method, ie, method100, has not been
initalized,
since the second thread see that the stub is been initalized, it will
call method100
which is null actually, then a NUllPointerException was thrown out.

Any comments?

Thanks

Vic.

Dimitri Rakitine

unread,
Nov 5, 2001, 4:42:33 PM11/5/01
to
It is a bug - it uses DCL and does it incorrectly. Did you try
asking sup...@bea.com about this?

> if (initialized) return;

> initialized = true;

> Any comments?

> Thanks

> Vic.


--
Dimitri

Vic

unread,
Nov 6, 2001, 3:48:30 PM11/6/01
to
Hi Dimitri,

I contacted bea about this, still waiting...

This is the stack trace that we're getting from weblogic.

Looks like it's a different problem then the one you mention.

One of the objects is returning null sometimes (we still don't know why but
the
methods are all initialized) and later when that object's method is accessed,
a
NullPointerException is being thrown.

Any ideas ?

Thanks,

Vic.

####<Oct 29, 2001 7:48:06 PM GMT+02:00> <Info> <EJB> <lumme> <agserver>
<ExecuteThread: '38' for
queue: 'default'> <> <23717:370f6dcb> <010051> <EJB Exception during
invocation from home:
com.nokia.ag.configmanager.ConfigManagerBeanHomeImpl@18cecd threw
exception:java.lang.NullPointerException>
java.lang.NullPointerException
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:250)

at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)

at
com.nokia.ag.da.ConfigurationParameterSLBean.ConfigurationParameterBeanEOImpl_WLStub.getConfigParameterLeaf(ConfigurationParameterBeanEOImpl_WLStub.java:299)

at
com.nokia.ag.configmanager.ConfigManagerBean.getAllConfigAttributes(ConfigManagerBean.java:521)

at
com.nokia.ag.configmanager.ConfigManagerBeanImpl.getAllConfigAttributes(ConfigManagerBeanImpl.java:290)

at
com.nokia.ag.configmanager.ConfigManagerBean.getAllConfigAttributes(ConfigManagerBean.java:534)

at
com.nokia.ag.configmanager.ConfigManagerBeanImpl.getAllConfigAttributes(ConfigManagerBeanImpl.java:290)

at
com.nokia.ag.configmanager.ConfigManagerBeanEOImpl.getAllConfigAttributes(ConfigManagerBeanEOImpl.java:380)

at
com.nokia.ag.configmanager.ConfigManagerBeanEOImpl_WLSkel.invoke(ConfigManagerBeanEOImpl_WLSkel.java:264)

at
weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:373)
at
weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:128)

at
weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:237)
at
weblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestHandler.java:118)

at
weblogic.rmi.internal.BasicRequestDispatcher.dispatch(BasicRequestDispatcher.java:115)

at weblogic.rmi.internal.ServerRequest.sendOneWayRaw(ServerRequest.java:88)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:108)
at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)

at
weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)

at
com.nokia.ag.configmanager.ConfigManagerBeanEOImpl_WLStub.getAllConfigAttributes(ConfigManagerBeanEOImpl_WLStub.java:362)

at
com.nokia.ag.logger.tools.ConfigEventManager.initialise(ConfigEventManager.java:124)

at
com.nokia.ag.logger.listener.LogHandlerMDBean.ejbCreate(LogHandlerMDBean.java:163)

at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.ejb20.internal.MessageDrivenEJBHome.createBean(MessageDrivenEJBHome.java:297)

at
weblogic.ejb20.pool.MessageDrivenPool.createBean(MessageDrivenPool.java:98)
at weblogic.ejb20.pool.MessageDrivenPool.getBean(MessageDrivenPool.java:79)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:212)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Dimitri Rakitine

unread,
Nov 6, 2001, 5:19:02 PM11/6/01
to
Strange. BTW, why EJB invocations do not look local - do you deploy them in
a single application ?

> Any ideas ?

> Thanks,

> Vic.

> at
> weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)

> at
> com.nokia.ag.da.ConfigurationParameterSLBean.ConfigurationParameterBeanEOImpl_WLStub.getConfigParameterLeaf(ConfigurationParameterBeanEOImpl_WLStub.java:299)

> at
> com.nokia.ag.configmanager.ConfigManagerBean.getAllConfigAttributes(ConfigManagerBean.java:521)

> at
> com.nokia.ag.configmanager.ConfigManagerBeanImpl.getAllConfigAttributes(ConfigManagerBeanImpl.java:290)

> at
> com.nokia.ag.configmanager.ConfigManagerBean.getAllConfigAttributes(ConfigManagerBean.java:534)

> at
> com.nokia.ag.configmanager.ConfigManagerBeanImpl.getAllConfigAttributes(ConfigManagerBeanImpl.java:290)

> at
> com.nokia.ag.configmanager.ConfigManagerBeanEOImpl.getAllConfigAttributes(ConfigManagerBeanEOImpl.java:380)

> at
> com.nokia.ag.configmanager.ConfigManagerBeanEOImpl_WLSkel.invoke(ConfigManagerBeanEOImpl_WLSkel.java:264)

> at
> weblogic.rmi.internal.BasicRequestDispatcher.dispatch(BasicRequestDispatcher.java:115)

> at
> weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)

> at
> com.nokia.ag.configmanager.ConfigManagerBeanEOImpl_WLStub.getAllConfigAttributes(ConfigManagerBeanEOImpl_WLStub.java:362)

> at
> com.nokia.ag.logger.tools.ConfigEventManager.initialise(ConfigEventManager.java:124)

> at
> com.nokia.ag.logger.listener.LogHandlerMDBean.ejbCreate(LogHandlerMDBean.java:163)

> Dimitri Rakitine wrote:


--
Dimitri

Vikas Chawla

unread,
Nov 8, 2001, 8:44:26 PM11/8/01
to
Thats true.. The web application & the ejb is deployed as different applications. One thing we tried to it to package them in an one Enterprise application. To our
surprise it worked perfectly fine.

Is it a classloader problem or something else? Since the EJB app is a kind of common component to many different applications, packaging everything as one big
enterprise application can be a problem.

Me & Vic are working in the same group.

Thanks,
Vikas

Dimitri Rakitine

unread,
Nov 8, 2001, 11:24:01 PM11/8/01
to
This doc describes 6.x classloading and why local RMI optimization only works
int the same deployment unit:

http://e-docs.bea.com/wls/docs61/programming/packaging.html#1051556

> Thanks,
> Vikas


> Dimitri Rakitine wrote:


--
Dimitri

0 new messages