- This topic has 6 replies, 3 voices, and was last updated 20 years, 2 months ago by Riyad Kalla.
-
AuthorPosts
-
MurtuzaMemberI am a beginner on MyEclipse platform. I was very quickly able to make the first EJB program from http://www.laliluna.de/35.html thanks to the author. The XDoclet ran perfect and bean deployed on JBoss 4.0 in first go. Everything seems to go perfect but when it came to testing, a simple exmple to insert in a record int the database throws below mentioned error. Can anyone help me on this.
I am using MyEclipse 3.1M2, JBoss 4.0, MySql 4.1 and i have created entity bean for table Units (unitno – int, unitname-string, unitsym-string, description-string). From the error it looks like EJB engine failed to find units table. I am sure the table is there and its empty.
javax.ejb.CreateException: Error checking if entity exists:java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 2
at org.jboss.ejb.plugins.cmp.jdbc.JDBCInsertPKCreateCommand.beforeInsert(JDBCInsertPKCreateCommand.java:92)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:136)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:572)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:222)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:266)
at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:192)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:113)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:129)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:106)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
at org.jboss.ejb.Container.invoke(Container.java:876)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:73)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy0.create(Unknown Source)
at com.mv.test.TesBeans.main(TesBeans.java:41)
Riyad KallaMemberI will ask someone to look at this, but just an FYI: Eclipse 3.1 is not currently supported, so YMMV and it makes troubleshooting the weirder issues (like “Cannot create part”) impossible for us if you run into them. So just be wary of that.
Scott AndersonParticipantAll I can contribute is that this looks like an application configuration problem. Either your CMP mapping doesn’t agree with the database, or the database isn’t set up properly for some reason. It’s really impossible to tell exactly what the mis-configuration is, just from the exception.
MurtuzaMemberI reinstalled mysql database and checked all the configuration. I have number of other application running on MySQL using JDBC. They are working fine including my apache server with PHP.
I am not sure what the problem is but I’ll try to reinstall JBoss and MyEclipse. Another thing i noticed is this very program without single like change works fine on my friends computer. Is there anything else i can do apart from re-install everything.
Riyad KallaMemberYou can try and zip up his JBoss/MYSQL install and move it to your machine and see if that helps.
MurtuzaMemberFinally, i was sure there is no misconfiguration on the MySQL, JBoss or MyEclipse. The other machine where it this program ran had MySQL version 4.0.18 and my machine has MySQL verion 4.1.3beta1. To clarify my hunch that mysql 4.1 is not yet support, i ran two versions of mysql on machine on different ports. Retest my applicaton on both server version and bingo. It fails on 4.1 but runs fine on 4.0.
So the final conclusion is the newer MySQL version is not ready for MyEclipse yet. I really wanted to use this version as it allows nested queries and this is what i am using for my other applications.
I am still not able to figure out what the problem with MySQL 4.1 version is? If anybody wants to investigate and fix this bug, you can contact me at murtuza@murtuza.net and i get give you complete program with all log files to check.
Riyad KallaMembermurtuzavohra,
Thank you for digging so much into this… we do have a policy to avoid supporting beta applications as you never know what might change between beta and final. Once MySQL stabalizes their 4.1 release we will aboslutely look into this and your information will be key for us. I have a hunch it doesn’t have anything to do with MySQL and MyEclipse though… as your application server is making use of the DB, and all MyEclipse is doing is creating the valid EJBs for you… if somebody isn’t following a spec here properly, there isn’t much we can do to fix that. -
AuthorPosts