It doesn't work on Linux :o(
alexis Sep 18, 2002 9:27 AMHi all,
I currently encounters a very curious problem on my Linux box, running RH 7.1, MySQL-Max 3.23.51, Sun JDK 1.4.0 and JBoss/Jetty 3.0.2.
But when I try to get data using an Entity Bean CMP 2.0, I have the following error:
13:23:18,892 ERROR [STDERR] javax.ejb.ObjectNotFoundException: No such entity!
13:23:18,906 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:46)
13:23:18,907 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:541)
13:23:18,909 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:336)
13:23:18,912 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:301)
13:23:18,914 ERROR [STDERR] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:687)
13:23:18,915 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:23:18,918 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
13:23:18,920 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13:23:18,922 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
13:23:18,924 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1116)
13:23:18,927 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
13:23:18,928 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:209)
13:23:18,931 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
13:23:18,933 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:88)
13:23:18,935 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
13:23:18,938 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
13:23:18,940 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
13:23:18,941 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
13:23:18,944 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
13:23:18,946 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
13:23:18,949 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
13:23:18,951 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
13:23:18,953 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:738)
13:23:18,955 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
13:23:18,958 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
13:23:18,959 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
13:23:18,961 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
13:23:18,964 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
13:23:18,965 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
13:23:18,968 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
13:23:18,970 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
13:23:18,972 ERROR [STDERR] at $Proxy43.findByPrimaryKey(Unknown Source)
13:23:18,974 ERROR [STDERR] at nix.util.sequenceblock.RemoteTestBean.getString(RemoteTestBean.java:63)
...
It seems this is not not a JNDI problem. I guess it come from JDBC/persistence and I'm unable to fix this. But I have made several test. And the result is very strange. I can access to my Datasourse (my previuos Entity Bean uses the same) and my data with the following code into a Session Bean:
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/myDS");
Connection con = ds.getConnection();
PreparedStatement stmt = con.prepareStatement("SELECT * FROM user");
ResultSet rs = stmt.executeQuery();
if(rs.next())
{
str = rs.getString("email");
}
stmt.close();
con.close();
More curious: I have this issue only on my 2 Linux box. But it's working fine on Win XP workstation. Windows working better than Linux, I can believe that!!
Quid.
I hope someone can help me.
Thanks,
Alexis