We are using RDBMS Realm in our J2ee application for security authentication of the users.For this we have defined groups, users and principals who can access the resources of the applications (like ejbs).The application is deployed in weblogic server 6.1 , service pack 2 and also in weblogic server 6.1, server pack 4.But we are facing some problems while our application is running in service pack 4.

The whole scene in SP4 is that

Inside the entity bean (WorkItemBean) ejbStore() method we are calling

context.getCallerPrincipal().getName() to get the name of the user who is updating some information necessary for the Business purpose. Here "context" is the EJBcontext.

But it gets NULL principal and the following error is displayed

javax.ejb.EJBException
 - with nested exception:
[weblogic.ejb20.interfaces.PrincipalNotFoundException: Error. Method SecurityHelper.getCallerPrincipal returned a NULL Principal. The CallerPrincipal Stack has been corrupted. One cause of corruption might be: A Bean has Created its own Threads.
 Note that this would be in violation of EJB2.0 Final Spec Chapter: Runtime Management 24.1.2]
at weblogic.ejb20.internal.BaseEJBContext.getCallerPrincipal(BaseEJBContext.java, Compiled Code)
at com.dhl.wpx.framework.workflow.WorkItemBean.ejbStore(Unknown Source)
at com.dhl.wpx.framework.workflow.WorkItemBean_1n1hic_Impl.ejbStore(WorkItemBean_1n1hic_Impl.java, Compiled Code)
at weblogic.ejb20.manager.DBManager.storeBean(DBManager.java, Compiled Code)
at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java, Compiled Code)
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java, Compiled Code)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java, Compiled Code)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java, Compiled Code)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java, Compiled Code)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java, Compiled Code)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java, Compiled Code)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java, Compiled Code)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java, Compiled Code)
at weblogic.kernel.ExecuteThread.<init>(ExecuteThread.java, Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)




But this Error is not replicated while i am using Weblogic Service pack 2. I question is does the above problem is occuring puperly because of the service pack difference or because of some other problem.