Scienze  
Syllabus ItalianoSyllabus IngleseindexlogoutArea Personale UNITN
Sistemi distribuiti: design Forum del Corso Messaggi del Thread
 
Sistemi distribuiti: design - Forum del Corso
Messaggi del Thread

Autore Messaggio
a.chiasera
Thread
  Post Postato: 5 dicembre 2005
   Titolo: Exception raised by findByPrimaryKey
 

Hi,
I have tried to run the Cabin_Demo example in the web site of last year and I have some problems.

I have tried to run the code of Client_2: the table in the mySQL database is filled in with the data given as arguments to the method makeCabins but when I reach the line
CabinRemote cabin = home.findByPrimaryKey(pk); 
I get the exception reported below. I have the same problem if I run Client_1. I don?t know where is the problem: it is strange that I am able to connect to the database and insert rows in the table but then the findByPrimaryKey method does not work.

Thank you in advance.
Annamaria.

Exception:

     [java] javax.ejb.ObjectNotFoundException: No such entity!
     [java]     at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:50)
     [java]     at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:589)
     [java]     at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:300)
     [java]     at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionIntercept
or.java:298)
     [java]     at org.jboss.ejb.EntityContainer.findSingleObject(EntityContainer.java:1086)
     [java]     at org.jboss.ejb.EntityContainer.find(EntityContainer.java:715)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:324)
     [java]     at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
     [java]     at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
     [java]     at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
     [java]     at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.ja
va:192)
     [java]     at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionIntercept
or.java:212)
     [java]     at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
     [java]     at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:117)
     [java]     at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
     [java]     at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
     [java]     at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
     [java]     at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
     [java]     at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
     [java]     at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
     [java]     at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
     [java]     at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
     [java]     at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)

     [java]     at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
     [java]     at org.jboss.ejb.Container.invoke(Container.java:894)
     [java]     at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:324)
     [java]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
     [java]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
     [java]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
     [java]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
     [java]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
     [java]     at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
     [java]     at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
     [java]     at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:324)
     [java]     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
     [java]     at sun.rmi.transport.Transport$1.run(Transport.java:148)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
     [java]     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
     [java]     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
     [java]     at java.lang.Thread.run(Thread.java:534)
     [java]     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
     [java]     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
     [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
     [java]     at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
     [java]     at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
     [java]     at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
     [java]     at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
     [java]     at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
     [java]     at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
     [java]     at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
     [java]     at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
     [java]     at $Proxy0.findByPrimaryKey(Unknown Source)
     [java]     at com.titan.clients.Client_2.main(Client_2.java:53)

a.chiasera
  Post Postato: 6 dicembre 2005
   Titolo: Re: Exception raised by findByPrimaryKey
 

Sorry for the stupid question: I have found the problem.
I have just do a typing error in the code. For sure I will get this exception if I supply a wrong id in the method call!!
 
Progetto eLeaf
Contact eLeaf team