• Post Reply Bookmark Topic Watch Topic
  • New Topic

findByPrimary kEy for CMP raises exception

 
Nova Bhojwani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are using iplanet application builder for developing a EJB application.
We are calling an entity bean from a servlet to check the login authentication...we are using container managed persistence and are using findByPrimaryKey() to check for record
wehn we give a rigth entry as in the database the result is perfect but when we give a wrong entry that is not in the database it throws an object not found exception....we are catching the exception and displaying the message that the record not found...it works well but followin it if we give a right entry some sql.persistence exception is there and the findbyprimarykey() is not called.....please help
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if we give a right entry some sql.persistence exception is there and the findbyprimarykey() is not called

Could you please specify and elaborate when you get the above error.
------------------

Mahindrakar
IBM Application Server Forum Moderator
Consultant - Zensar Technologies.
SCJP2 & SCJEA (Part I)
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, please, give us the precise exception; if you have a stack trace, give the first dozen lines or so and the part of the code where the stack trace indicates the exception is thrown (I'm not familiar with iplanet but you may even find the relevant server-generated EJB code lying around in the its working directories).
- Peter
 
Nova Bhojwani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

well actually my architecture is like
boundary servlet -----> entitybean
this is a snippet of code in boundary servlet---

EjbPractice.IEntityLoginHome home = (EjbPractice.IEntityLoginHome) beanObject;
home.findByPrimaryKey(id);
msg="logged in";
}
catch(Exception e)
{
System.out.print("exception a gaya"+e);
msg="not logged in";
}
In my database "id" is the primary key and id has a entry for 31125 so when i give id=31125 it works fine but when i give id=31128 followin thing is thrown....i have caught the exception and i m displayin an error message tooo......but problem is when i again give id=31125 it's not working
31128 nova
EJB Lookup
nameStr=EntityLogin key=com.kivasoft.gds.GDSKey@75d386 nameStr=EntityLogin guidStr={39c07a73-205a-11d4-80ef-00b0d0aca403}
FINDER FOR : ejbFindByPrimaryKey
javax.ejb.ObjectNotFoundException
at com.netscape.server.ejb.SQLPersistenceManager.find(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
at EjbPractice.ejb_home_EjbPractice_EntityLoginBean.findByPrimaryKey(ejb_home_EjbPractice_EntityLoginBean.java:117)
at EjbPractice.ejb_kcp_skel_IEntityLoginHome.findByPrimaryKey__EjbPractice_IEntityLogin__indir_wstring(ejb_kcp_skel_IEntityLoginHome.java:255)
at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
at EjbPractice.ejb_kcp_stub_IEntityLoginHome.findByPrimaryKey(ejb_kcp_stub_IEntityLoginHome.java:339)
at EjbPractice.ejb_stub_IEntityLoginHome.findByPrimaryKey(ejb_stub_IEntityLoginHome.java:86)
at EjbPractice.BoundaryServlet.defaultAction(BoundaryServlet.java:95)
aexception a gaya
javax.ejb.ObjectNotFoundException EjbPractice.BoundaryServlet.doPost(BoundaryServlet.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at[05/May/2000 05:58:29:1] info: --------------------------------------
[05/May/2000 05:58:29:1] info com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
at com.kivasoft.applogic.AppLogi: BoundaryServlet: destroy
[05/May/2000 05:58:29:1] info: --------------------------------------
c.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kiva[05/May/2000 05:58:29:5] error: Exception: SERVLET-execution_failed: Error in executing servlet Bousoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)
ndaryServlet: java.lang.ClassCastException: com.netscape.server.deployment.EntityBeanDescriptor
Exception Stack Trace:
java.lang.ClassCastException: com.netscape.server.deployment.EntityBeanDescriptor
at com.netscape.server.servlet.servletrunner.AppInfo.popWebAppDescriptor(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)

---- this was the error it gave on server console for wrong entry now when i again give a right entry it's givin following error...
please do help

31125
nameStr=EntityLogin key=com.kivasoft.gds.GDSKey@5009b4 nameStr=EntityLogin guidStr={39c07a73-205a-11d4-80ef-00b0d0aca403}
FINDER FOR : ejbFindByPrimaryKey
[05/May/2000 06:00:14:8] error: EBFP-marshal_internal: internal exception caught in kcp skeleton, exception = com.netscape.server.ejb.PersistenceException
[05/May/2000 06:00:14:8] error: Exception Stack Trace:
com.netscape.server.ejb.PersistenceException
at com.netscape.server.ejb.SQLPersistenceManager.start(Unknown Source)
at com.netscape.server.ejb.SQLPersistenceManager.find(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
at EjbPractice.ejb_home_EjbPractice_EntityLoginBean.findByPrimaryKey(ejb_home_EjbPractice_EntityLoginBean.java:117)
at EjbPractice.ejb_kcp_skel_IEntityLoginHome.findByPrimaryKey__EjbPractice_IEntityLogin__indir_wstring(ejb_kcp_skel_IEntityLoginHome.java:255)
at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
at EjbPractice.ejb_kcp_stub_IEntityLoginHome.findByPrimaryKey(ejb_kcp_stub_IEntityLoginHome.java:339)
at EjbPractice.ejb_stub_IEntityLoginHome.findByPrimaryKey(ejb_stub_IEntityLoginHome.java:86)
at EjbPractice.BoundaryServlet.defaultAction(BoundaryServlet.java:95)
at EjbPractice.BoundaryServlet.doPost(BoundaryServlet.java:39)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)

exception a gayajava.rmi.RemoteException: internal error; nested exception is:
com.netscape.server.ejb.PersistenceException05/May/2000 06:00:15:4] info: --------------------------------------
[05/May/2000 06:00:15:4] info: BoundaryServlet: destroy
[05/May/2000 06:00:15:4] info: --------------------------------------
[05/May/2000 06:00:17:7] error: Exception: SERVLET-execution_failed: Error in executing servlet BoundaryServlet: java.lang.ClassCastException: com.netscape.server.deployment.EntityBeanDescriptor
Exception Stack Trace:
java.lang.ClassCastException: com.netscape.server.deployment.EntityBeanDescriptor
at com.netscape.server.servlet.servletrunner.AppInfo.popWebAppDescriptor(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown Source)
at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
at com.kivasoft.thread.ThreadBasic.run(Native Method)
at java.lang.Thread.run(Thread.java:479)

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!