-
1. Re: FinderException on findByPrimaryKey
thohawk Aug 21, 2002 7:44 AM (in response to gneeri)Hi
I'm having the exact same problem and i think it might relate to this post http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ .... but in that post it is *not* solved - a suggestion made by davidjencks, but no reply on whether it works or not.
What i found out is that when calling getPrimaryKey() within the EntityBean it returns null...
So, basically, i'm also interested in some help on this problem :-)
Regards -
2. Re: FinderException on findByPrimaryKey
dsundstrom Aug 27, 2002 11:48 AM (in response to gneeri)> Amongst the stack trace, I get:
>
> $Proxy158.findByPrimaryKey(Unknown Source)
This is normal. The proxy is the dynamically generated subclass of your abstract bean implementation class.
What is the exception message? What is the top part of the stacktrace? -
3. Re: FinderException on findByPrimaryKey
martinw Aug 30, 2002 7:07 PM (in response to gneeri)I get the same problem. Here is the top of my stack trace:
00:11:44,390 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
java.lang.NullPointerException
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:513)
at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:165)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:251)
at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:294)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:209)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:76)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
at org.jboss.ejb.Container.invoke(Container.java:729)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy181.findByPrimaryKey(Unknown Source)
Thanks for any help...
Martin -
4. Re: FinderException on findByPrimaryKey
martinw Aug 30, 2002 7:21 PM (in response to gneeri)I'm getting a similar problem:
00:11:44,390 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
java.lang.NullPointerException
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:513)
at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:165)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createBeanClassInstance(CachedConnectionInterceptor.java:251)
at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:294)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:209)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:76)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
at org.jboss.ejb.Container.invoke(Container.java:729)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy181.findByPrimaryKey(Unknown Source)
Thanks for any help,
Martin -
5. Re: FinderException on findByPrimaryKey
gummy Aug 30, 2002 8:58 PM (in response to gneeri)Hi Dain,
Hi Dain, I got the same error too.
the error:
javax.ejb.ObjectNotFoundException: Object with primary key table1Key@4df1cf5b not found in storage
Note: I am using my own creat key class instead of the default types..
my ejb-jar.xml file under that particular
entity as:
.
.
<prim-key-class>table1Key</prim-key-class>
.
.
Do you know what I might do wrong?
David Li.
ps. thx for the comments on my other post, I am trying to read the docments on JBoss3.0.1 now. and in the progress of testing xdoclet to generate my ejb deployment scripts. -
6. Re: FinderException on findByPrimaryKey
gummy Aug 30, 2002 9:25 PM (in response to gneeri)Hi Dain,
I got the same error too.
here is my stacktrace:
javax.ejb.ObjectNotFoundException: Object with primary userKey@4df1cf5b not found in storage
Note: I am using my own key class.
Thx for any help in advance.
David Li -
7. Re: FinderException on findByPrimaryKey
gummy Aug 30, 2002 9:26 PM (in response to gneeri)Hi Dain,
I got the same error too.
here is my stacktrace:
javax.ejb.ObjectNotFoundException: Object with primary userKey@4df1cf5b not found in storage
Note: I am using my own key class.
Thx for any help in advance.
David Li -
8. Re: FinderException on findByPrimaryKey
gummy Aug 30, 2002 9:27 PM (in response to gneeri)Hi Dain,
I got the same error too.
here is my stacktrace:
javax.ejb.ObjectNotFoundException: Object with primary userKey@4df1cf5b not found in storage
Note: I am using my own key class.
Thx for any help in advance.
David Li -
9. Re: FinderException on findByPrimaryKey
sdixit Sep 23, 2002 5:34 PM (in response to gneeri)I am having the same problem. Is there any solution posting?
Sandeep Dixit -
10. Re: FinderException on findByPrimaryKey
dsundstrom Sep 23, 2002 9:38 PM (in response to gneeri)Ya you all have the same problem. The system can not find your object in the datasotore. This is either because the object is not in the datastore, you are connecting to the wring datastore or most likely you have coded the custom pk wrong.
-
11. Re: FinderException on findByPrimaryKey
sandro Dec 2, 2002 1:06 PM (in response to gneeri)Dear all,
I'm having a similar problem.
My configuration is JBoss3.0.4+ SQLServer.
I'm trying to implement a many-to-one relationship in which one Role has many Users.
My stand-alone client must create the user and set its role via a RoleEntityLocal like below:
*************************************************
UserEntityHome userEntityHome = (UserEntityHome)lContext.lookup("ejb/uk/ac/essex/ueclaa/UserEntity");
RoleEntityLocalHome roleEntityLocalHome = (RoleEntityLocalHome)lContext.lookup("ejb/uk/ac/essex/ueclaa/RoleEntityLocalHome");
RoleEntityPK roleEntityPK= new RoleEntityPK("Administrator");
/*$Proxy2.findByPrimaryKey(Unknown Source)- ERROR IS HERE!!! */
RoleEntityLocal roleEntityLocal= roleEntityLocalHome.findByPrimaryKey(roleEntityPK);
UserEntityData userEntityData = new UserEntityData(new Integer(0),roleEntityLocal, "", "","","","","");
UserEntity userEntity= userEntityHome.create(userEntityData);
*************************************************
This is the error that I got:
Exception in thread "main" java.lang.NullPointerException
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
at $Proxy2.findByPrimaryKey(Unknown Source)
at uk.ac.essex.ueclaa.client.TestClient.main(TestClient.java:45)
I've tried successfully to use remote interfaces like:
RoleEntityHome roleEntityHome = (RoleEntityHome)lContext.lookup("ejb/uk/ac/essex/ueclaa/RoleEntity");
RoleEntity roleEntity =roleEntityHome.findByPrimaryKey(roleEntityPK);
So my question is: Why remote calls for findByPrimaryKey method works and local ones not??
Many Thanks,
Sandro 2:)