[EJB 3.0] - Re: EJB3 Transaction with Oracle 10g XE
by abhinav19
This is the stack trace
22:33:06,403 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
|
| 22:33:07,336 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
|
| 22:33:07,531 INFO [STDOUT] Hibernate: insert into tusr (USR_LGN_ID, USR_ROLE_ID, LST_LGN_TS, USR_ADD_INF, CRTD_TS, CRTD_USR, UPDT_TS, UPDT_USR, USR_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
| 22:33:08,309 WARN [JDBCExceptionReporter] SQL Error: 2291, SQLState: 23000
|
| 22:33:08,310 ERROR [JDBCExceptionReporter] ORA-02291: integrity constraint (ATSUSER.SYS_C004032) violated - parent key not found
|
| 22:33:08,310 WARN [JDBCExceptionReporter] SQL Error: 2291, SQLState: 23000
|
| 22:33:08,310 ERROR [JDBCExceptionReporter] ORA-02291: integrity constraint (ATSUSER.SYS_C004032) violated - parent key not found
|
| 22:33:08,321 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
|
| org.hibernate.exception.ConstraintViolationException
| : Could not execute JDBC batch update
|
| at org.hibernate.exception.SQLStateConverter.convert(
| SQLStateConverter.java:71)
|
| at org.hibernate.exception.JDBCExceptionHelper.convert(
| JDBCExceptionHelper.java:43)
|
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(
| AbstractBatcher.java:249)
|
| at org.hibernate.jdbc.AbstractBatcher.prepareStatement(
| AbstractBatcher.java:92)
|
| at org.hibernate.jdbc.AbstractBatcher.prepareStatement(
| AbstractBatcher.java:87)
|
| at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(
| AbstractBatcher.java:218)
|
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(
| AbstractEntityPersister.java:2159)
|
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(
| AbstractEntityPersister.java:2595)
|
| at org.hibernate.action.EntityInsertAction.execute(
| EntityInsertAction.java:51)
|
| at org.hibernate.engine.ActionQueue.execute(
| ActionQueue.java:248)
|
| at org.hibernate.engine.ActionQueue.executeActions(
| ActionQueue.java:232)
|
| at org.hibernate.engine.ActionQueue.executeActions(
| ActionQueue.java:139)
|
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
| AbstractFlushingEventListener.java:298)
|
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
| DefaultFlushEventListener.java:27)
|
| at org.hibernate.impl.SessionImpl.flush(
| SessionImpl.java:1000)
|
| at org.hibernate.impl.SessionImpl.managedFlush(
| SessionImpl.java:338)
|
| at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(
| AbstractEntityManagerImpl.java:515)
|
| at org.jboss.tm.TransactionImpl.doBeforeCompletion(
| TransactionImpl.java:1491)
|
| at org.jboss.tm.TransactionImpl.beforePrepare(
| TransactionImpl.java:1110)
|
| at org.jboss.tm.TransactionImpl.commit(
| TransactionImpl.java:324)
|
| at org.jboss.tm.TxManager.commit(
| TxManager.java:240)
|
| at org.jboss.aspects.tx.TxPolicy.endTransaction(
| TxPolicy.java:175)
|
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(
| TxPolicy.java:87)
|
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(
| TxInterceptor.java:191)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(
| TxPropagationInterceptor.java:76)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(
| StatelessInstanceInterceptor.java:62)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(
| AuthenticationInterceptor.java:77)
|
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(
| Ejb3AuthenticationInterceptor.java:102)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(
| ENCPropagationInterceptor.java:47)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(
| AsynchronousInterceptor.java:106)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(
| StatelessContainer.java:263)
|
| at org.jboss.aop.Dispatcher.invoke(
| Dispatcher.java:106)
|
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(
| AOPRemotingInvocationHandler.java:82)
|
| at org.jboss.remoting.ServerInvoker.invoke(
| ServerInvoker.java:828)
|
| at org.jboss.remoting.ServerInvoker.invoke(
| ServerInvoker.java:681)
|
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(
| ServerThread.java:358)
|
| at org.jboss.remoting.transport.socket.ServerThread.dorun(
| ServerThread.java:398)
|
| at org.jboss.remoting.transport.socket.ServerThread.run(
| ServerThread.java:239)
|
| Caused by:
| java.sql.BatchUpdateException: ORA-02291: integrity constraint (ATSUSER.SYS_C004032) violated - parent key not found
|
| at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(
| DatabaseError.java:343)
|
| at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(
| OraclePreparedStatement.java:10657)
|
| at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(
| WrappedStatement.java:519)
|
| at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(
| BatchingBatcher.java:48)
|
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(
| AbstractBatcher.java:242)
|
| ... 41 more
|
| 22:33:41,582 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
|
| 22:33:41,587 INFO [STDOUT] Hibernate: select hibernate_sequence.nextval from dual
|
| 22:33:41,597 INFO [STDOUT] Hibernate: insert into tusr (USR_LGN_ID, USR_ROLE_ID, LST_LGN_TS, USR_ADD_INF, CRTD_TS, CRTD_USR, UPDT_TS, UPDT_USR, USR_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
| 22:33:41,608 WARN [JDBCExceptionReporter] SQL Error: 2291, SQLState: 23000
|
| 22:33:41,608 ERROR [JDBCExceptionReporter] ORA-02291: integrity constraint (ATSUSER.SYS_C004032) violated - parent key not found
|
| 22:33:41,608 WARN [JDBCExceptionReporter] SQL Error: 2291, SQLState: 23000
|
| 22:33:41,608 ERROR [JDBCExceptionReporter] ORA-02291: integrity constraint (ATSUSER.SYS_C004032) violated - parent key not found
|
| 22:33:41,613 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
|
| org.hibernate.exception.ConstraintViolationException
| : Could not execute JDBC batch update
|
| at org.hibernate.exception.SQLStateConverter.convert(
| SQLStateConverter.java:71)
|
| at org.hibernate.exception.JDBCExceptionHelper.convert(
| JDBCExceptionHelper.java:43)
|
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(
| AbstractBatcher.java:249)
|
| at org.hibernate.jdbc.AbstractBatcher.prepareStatement(
| AbstractBatcher.java:92)
|
| at org.hibernate.jdbc.AbstractBatcher.prepareStatement(
| AbstractBatcher.java:87)
|
| at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(
| AbstractBatcher.java:218)
|
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(
| AbstractEntityPersister.java:2159)
|
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(
| AbstractEntityPersister.java:2595)
|
| at org.hibernate.action.EntityInsertAction.execute(
| EntityInsertAction.java:51)
|
| at org.hibernate.engine.ActionQueue.execute(
| ActionQueue.java:248)
|
| at org.hibernate.engine.ActionQueue.executeActions(
| ActionQueue.java:232)
|
| at org.hibernate.engine.ActionQueue.executeActions(
| ActionQueue.java:139)
|
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
| AbstractFlushingEventListener.java:298)
|
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
| DefaultFlushEventListener.java:27)
|
| at org.hibernate.impl.SessionImpl.flush(
| SessionImpl.java:1000)
|
| at org.hibernate.impl.SessionImpl.managedFlush(
| SessionImpl.java:338)
|
| at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(
| AbstractEntityManagerImpl.java:515)
|
| at org.jboss.tm.TransactionImpl.doBeforeCompletion(
| TransactionImpl.java:1491)
|
| at org.jboss.tm.TransactionImpl.beforePrepare(
| TransactionImpl.java:1110)
|
| at org.jboss.tm.TransactionImpl.commit(
| TransactionImpl.java:324)
|
| at org.jboss.tm.TxManager.commit(
| TxManager.java:240)
|
| at org.jboss.aspects.tx.TxPolicy.endTransaction(
| TxPolicy.java:175)
|
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(
| TxPolicy.java:87)
|
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(
| TxInterceptor.java:191)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(
| TxPropagationInterceptor.java:76)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(
| StatelessInstanceInterceptor.java:62)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(
| AuthenticationInterceptor.java:77)
|
| at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(
| Ejb3AuthenticationInterceptor.java:102)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(
| ENCPropagationInterceptor.java:47)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(
| AsynchronousInterceptor.java:106)
|
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(
| MethodInvocation.java:101)
|
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(
| StatelessContainer.java:263)
|
| at org.jboss.aop.Dispatcher.invoke(
| Dispatcher.java:106)
|
| at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(
| AOPRemotingInvocationHandler.java:82)
|
| at org.jboss.remoting.ServerInvoker.invoke(
| ServerInvoker.java:828)
|
| at org.jboss.remoting.ServerInvoker.invoke(
| ServerInvoker.java:681)
|
| at org.jboss.remoting.transport.socket.ServerThread.processInvocation(
| ServerThread.java:358)
|
| at org.jboss.remoting.transport.socket.ServerThread.dorun(
| ServerThread.java:398)
|
| at org.jboss.remoting.transport.socket.ServerThread.run(
| ServerThread.java:239)
|
| Caused by:
| java.sql.BatchUpdateException: ORA-02291: integrity constraint (ATSUSER.SYS_C004032) violated - parent key not found
|
| at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(
| DatabaseError.java:343)
|
| at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(
| OraclePreparedStatement.java:10657)
|
| at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(
| WrappedStatement.java:519)
|
| at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(
| BatchingBatcher.java:48)
|
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(
| AbstractBatcher.java:242)
|
| ... 41 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030810#4030810
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030810
19Â years, 1Â month
[Testimonials] - Re: Migration from Weblogic to JBoss 4.0.5
by dward
So your ClassCastException is different from your original NameNotFoundException.
The NameNotFoundException was caused by looking up a jndi name that was not bound. It seems like a common thing for people who are used to weblogic to bind beans into jndi with the fully qualified package name of a class. You are also depending upon the global jndi namespace. I would suggest you:
1) look into using local interfaces to your ejbs rather than remote interfaces wherever possible
2) change your jndi names to path-like structures
3) make use of ejb references (<ejb-ref> or <ejb-local-ref>) to bind your beans from the global jndi namespace into a local jndi namespace (so you could lookup "java:comp/env/ejb/UserService" - the standard way of doing it)
How to do the above is in the standard ejb documentation and jboss documentation.
You ClassCastException was caused by your second narrow. You only have to narrow the remote home interface. After that you can just call create() and use the remote interface you get back directly. (If you decide to move to local interfaces rather than remote remember that the narrow would then be unnecessary.)
Last, I know you are just trying to migrate an existing application, but remember if you move to EJB3 and JEE 5, explicit jndi lookups can become a thing of the past as you can use annotations to instruct the container to inject resources into your managed componets.
Hope this helps.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030802#4030802
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030802
19Â years, 1Â month
[Remoting] - Re: timeout specification
by ron.sigalï¼ jboss.com
I just did an experiment in which I set the client's timeout to 1 second and pulled the ethernet plug out of the server machine. I'm using the socket transport, by the way. It took 30 seconds to get a timeout exception. What's happening is that the socket client invoker tries multiple times (30 by default) to get a connection, and each connection timed out after 1 second. The number of attempts can be configured by setting the numberOfRetries parameter.
Similarly, (also in the socket transport) if a connection has been established and then fails during the invocation, the invocation will be retried (3 times by default). The number of retries can be configured by setting the numberOfCallRetries parameter.
You might be experiencing something like this. See what happens if you run the client with the log level for org.jboss.remoting loggers set to DEBUG.
By the way, my client was on a Windows machine and my server was on a linux machine. Java sockets depend on the underlying operating system, and it's just a fact that different environments handle this problem differently. If you have the misfortune to be working in an environment that doesn't give you the support you need, you may have to handle the "unplugged cable" problem at the application level. Just to see that you're not alone, take a look at
http://forum.java.sun.com/thread.jspa?threadID=316842&messageID=1604338
A couple of strategies come to mind. The forum suggests pinging on the connection to see if it's alive, and Remoting can help you with that. Read about leasing and connection validation in Chapter 8 of the Remoting documentation:
http://labs.jboss.com/portal/jbossremoting/docs/guide/chapter-connection-...
Another possibility would be to put the invocation in a separate thread t, and then, in your main thread, call t.join(timeout).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030801#4030801
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030801
19Â years, 1Â month