Re: exposing exceptions that caused a rollback
Hi Djencks/Dblevins, As we had discussed earlier about this issue and the possible patch. It seems we cannot use javax.transaction. TransactionRolledbackException.initCause(e) instead there is another class with in openEJB org.apache.openejb.core.transaction.TransactionRolledbackException which can be utilized. So can we go ahead and use this exception class. Are there any reasons why we had not used this class earlier? For your reference have a look at line no 146 in the class https://svn.apache.org/repos/asf/openejb/tags/openejb-3.0.3/container/openejb-core/src/main/java/org/apache/openejb/core/transaction/TransactionPolicy.java Once I use this class I see better logging however it stills seems incomplete. What can we do to get more logging in this case? Snippets of log from my eclipse when I run the client Caused by: java.lang.Exception: Transaction has timed out at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:261) ... 18 more Snippets of log from my geronimo.log 2011-02-24 14:35:50,625 DEBUG [OpenEJB] finished invoking method create. Return value:proxy=com.test.ibm.TestTransactionInterface;deployment=test4/TestTransaction;pk=205efedb35aa1fff:ef95222:12e56ea419b:-7fe4 2011-02-24 14:35:50,640 DEBUG [jndi] JNDI REQUEST: JNDI_LOOKUP:null:TestTransactionRemote -- RESPONSE: JNDI_BUSINESS_OBJECT:STATEFUL:test4/TestTransaction:com.test.ibm.TestTransactionInterface:205efedb35aa1fff:ef95222:12e56ea419b:-7fe4 2011-02-24 14:35:50,718 INFO [Transaction] TX RequiresNew: Suspended transaction null 2011-02-24 14:35:50,718 INFO [Transaction] TX RequiresNew: Started transaction org.apache.geronimo.transaction.manager.TransactionImpl@f5472d 2011-02-24 14:35:50,750 INFO [Runtime] Starting OpenJPA 1.2.2 2011-02-24 14:35:50,843 INFO [JDBC] Using dictionary class org.apache.openjpa.jdbc.sql.DerbyDictionary (Apache Derby 10.5.3.0 - (802917) ,Apache Derby Embedded JDBC Driver 10.5.3.0 - (802917)). 2011-02-24 14:36:02,015 INFO [Transaction] TX RequiresNew: Committing transaction org.apache.geronimo.transaction.manager.TransactionImpl@f5472d 2011-02-24 14:36:02,109 INFO [Transaction] The transaction has been rolled back rather than commited: Unable to commit: transaction marked for rollback 2011-02-24 14:36:02,109 INFO [Transaction] TX RequiresNew: No transaction to resume 2011-02-24 14:36:02,109 DEBUG [ejb] EJB REQUEST: EJB_OBJECT.BUSINESS_METHOD:test4/TestTransaction:firstMethod:205efedb35aa1fff:ef95222:12e56ea419b:-7fe4 -- RESPONSE: EJB_APP_EXCEPTION:org.apache.openejb.core.transaction.TransactionRolledbackException: Transaction was rolled back, presumably because setRollbackOnly was called during a synchronization: Unable to commit: transaction marked for rollback Thanks Ashish On Thu, Feb 24, 2011 at 9:26 AM, David Jencks david_jen...@yahoo.comwrote: On Feb 23, 2011, at 7:35 PM, Kevan Miller wrote: On Feb 22, 2011, at 4:37 PM, David Jencks wrote: cf https://issues.apache.org/jira/browse/GERONIMO-4576 https://issues.apache.org/jira/browse/OPENEJB-1091 For a long time we've known of this problem where an exception thrown by a transaction synchronization that causes a transaction to be marked for rollback only is lost. When the user or openejb tries to commit the transaction the transaction manager throws a RollbackException which currently doesn't have any information about the original exception. People have complained about this for a long time now we're trying to fix it. There are two parts AFAICT. I think in openejb we just need to take the TransactionRolledBackException we are currently throwing and call initCause with the RollbackException from the tm. In TransactionPolicy this would be something like } catch (RollbackException e) { txLogger.info(The transaction has been rolled back rather than commited: + e.getMessage()); // TODO can't set initCause on a TransactionRolledbackException, update the convertException and related code to handle something else Throwable txe = new javax.transaction.TransactionRolledbackException(Transaction was rolled back, presumably because setRollbackOnly was called during a synchronization: +e.getMessage()); --throw new ApplicationException(txe); ++throw new ApplicationException(txe.initCause(e); In the transaction implementation we need to keep track of the exception that caused us to mark rollback only and then use it as the cause of the RollbackException, e.g. private Exception markRollbackCause; ... RollbackException rollbackException = new RollbackException(Unable to commit: transaction marked for rollback); if (markRollbackCause != null) { rollbackException.initCause(markRollbackCause); } throw rollbackException; ... private void markRollbackCause(Exception e) { if (markRollbackCause == null) { markRollbackCause = e; } }
Re: How to make a contribution to the community
Hi Manu, Apologies for delay in reply. Yes I have started looking on to the spec and will come up with test cases soon. Thanks Ashish On Mon, Mar 31, 2008 at 5:01 PM, Manu George [EMAIL PROTECTED] wrote: Hi Ashish, I know that my reply is very late but once you are comfortable with building OpenEJB running the samples and debugging in eclipse a nice way to start will be to write some unit tests. There are some tests still to be written . http://issues.apache.org/jira/browse/OPENEJB-142 is the jira with all the tests. Mohammad and myself started our contributions to OpenEJB by writing tests and it will really help you in understanding the spec better :). Regards Manu On Thu, Mar 20, 2008 at 11:42 PM, Ashish Jain [EMAIL PROTECTED] wrote: HI Jacek, I just found out the class that has the error, Trying to setup my eclipse development environment to have a look at the code. Thanks Ashish On Thu, Mar 20, 2008 at 10:30 PM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Thu, Mar 20, 2008 at 5:47 PM, Ashish Jain [EMAIL PROTECTED] wrote: I was able to successfully run the build this time but I escaped all the tests. Is that the correct way of building openEjb? No as you're (about to be) a openejb developer than a mere user. If the tests fail we should fix it right now. I had to publish openejb-tomcat-* artifacts to build openejb with a clean repo until it failed with the known issue in openejb-ejbd module. Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: where to find the latest Eclipse plugin for OpenEJB
Hi Jacek, I will be happy to that but I need access to add contents to OpenEJB wiki. Please provide me the contributor access. Thanks Ashish On Sat, Mar 22, 2008 at 9:30 PM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Fri, Mar 21, 2008 at 10:17 AM, Ashish Jain [EMAIL PROTECTED] wrote: I am looking to setup development environment for OpenEJB. These are the steps I followed *4) Finally I followed the steps as mentioned in * https://issues.apache.org/jira/browse/OPENEJB-674. It's still work in progress so expect unexpected, esp. no docs - only source code and mailing list. I think your next assignment could be to document what Jonathan Gallimore have done so far. What do you think? To download the Eclipse plugin for OpenEJB, do the following: 1. svn co http://svn.apache.org/repos/asf/openejb/trunk/sandboxopenejb-sandbox 2. cd openejb-sandbox/openejb-eclipse-plugin 3/ mvn clean install ...install the plugin - assembly\target\openejb-eclipse-plugin-1.0.0-SNAPSHOT-deployable.zip - as you do with other plugins (I copy it over to a directory with .eclipseextension and link it with *.link file). Run Eclipse and you should notice OpenEJB menu. I've just committed the latest changes of Jonathan's. They built fine and worked well. Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: where to find the latest Eclipse plugin for OpenEJB
yeah I too get the same error message :). Thanks Ashish On Sun, Mar 23, 2008 at 6:46 PM, Jonathan Gallimore [EMAIL PROTECTED] wrote: I'm having a similar problem too, the error message is: You do not have permission to view this page. You have to be a member of *all* the following groups to access this page. If this is incorrect please contact your administrator. And the list of groups underneath is empty.. :-) Jon On Sun, Mar 23, 2008 at 10:46 AM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Sun, Mar 23, 2008 at 10:51 AM, Ashish Jain [EMAIL PROTECTED] wrote: I will be happy to that but I need access to add contents to OpenEJB wiki. Please provide me the contributor access. You say you couldn't sign in and add content to wiki? That's strange. What error message did you get? I know the policy of adding content to Wiki changed as some ASF projects asked people to put the content to a jira so it could be added to a project. I'll have to dig it up in the ASF docs. Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
where to find the latest Eclipse plugin for OpenEJB
Hi, I am looking to setup development environment for OpenEJB. These are the steps I followed 1) Checkout the code. 2) Ran the build. 3) Ran the command *C:\OpenEjbmvn -Peclipse eclipse:eclipse *4) Finally I followed the steps as mentioned in * https://issues.apache.org/jira/browse/OPENEJB-674. *5) For Step4 I downloaded *xxx_final.zip. * Now I am a stuck at *B. Adding a new installed runtime * 4. Click next and specify the location of the installation directory of OpenEJB During the 4th step I get the error *Missing classpath entry C:\openejb3.0b2\openejb- 3.0-beta-2\lib\openejb-core-3.0.0-SNAPSHOT.jar * There are no snapshots jar present in *openejb_home/lib*. what it suggests is plugin is referring to some old jars. Is that the reason? Is there any way we can modify the the classpath entry to point to correct jar. Is there an alternate plugin available? PS: I am using WindowsXp. Thanks Ashish
Re: How to make a contribution to the community
HI Jacek, I just found out the class that has the error, Trying to setup my eclipse development environment to have a look at the code. Thanks Ashish On Thu, Mar 20, 2008 at 10:30 PM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Thu, Mar 20, 2008 at 5:47 PM, Ashish Jain [EMAIL PROTECTED] wrote: I was able to successfully run the build this time but I escaped all the tests. Is that the correct way of building openEjb? No as you're (about to be) a openejb developer than a mere user. If the tests fail we should fix it right now. I had to publish openejb-tomcat-* artifacts to build openejb with a clean repo until it failed with the known issue in openejb-ejbd module. Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: How to make a contribution to the community
Hi Jacek, Thanks for your reply. I will start with building the openejb container and later with the execution of samples. Thanks Ashish On Wed, Mar 19, 2008 at 3:54 AM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Tue, Mar 18, 2008 at 8:43 PM, Ashish Jain [EMAIL PROTECTED] wrote: I am interested in contributing to the community and there by learning more of EJB3. I am a newbie and I need help to start my contribution to the community. Hi Ashish, There're a couple of ways to contribute that depend on your time constraints and knowledge of how open source, ejb3 and openejb work. Let's start simple with the samples. Could you check out the sources, build them and run the examples afterwards? I think it makes a good start. Thanks! Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: How to make a contribution to the community
Hi Jacek, As suggested by you, my build also failed on Windows XP while running the test cases I guess, because I could see a message suggesting *INFO - OpenEJB ready. OpenEJB ready.* Later running the test cases there was failures running the test cases. The stacktrace for the error is as follows: javax.naming.NamingException: Cannot lookup '/client/tests/entity/bmp/BasicBmpHo me'. [Root exception is java.rmi.RemoteException: Cannot read the response from the server (OEJP/2.0) : null; nested exception is: java.io.EOFException] at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java :240) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.apache.openejb.test.entity.bmp.BmpEjbHomeTests.setUp (BmpEjbHomeTe sts.java:36) at org.apache.openejb.test.NumberedTestCase.run( NumberedTestCase.java:93 ) at org.apache.openejb.test.TestSuite.run(TestSuite.java:49) at org.apache.openejb.test.TestSuite.run(TestSuite.java:49) at org.junit.internal.runners.JUnit38ClassRunner.run (JUnit38ClassRunner. java:81) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute (JUnit4TestSet. java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes tSet(AbstractDirectoryTestSuite.java:140) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab stractDirectoryTestSuite.java:165) at org.apache.maven.surefire.Surefire.run(Surefire.java:107) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl. java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su refireBooter.java:285) at org.apache.maven.surefire.booter.SurefireBooter.main( SurefireBooter.j ava:976) Caused by: java.rmi.RemoteException: Cannot read the response from the server (O EJP/2.0) : null; nested exception is: java.io.EOFException at org.apache.openejb.client.Client.processRequest(Client.java:172) at org.apache.openejb.client.Client.request(Client.java:42) at org.apache.openejb.client.JNDIContext.request(JNDIContext.java :87) at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java :234) ... 16 more Caused by: java.io.EOFException at java.io.ObjectInputStream$BlockDataInputStream.readByte (ObjectInputSt ream.java:2690) at java.io.ObjectInputStream.readByte(ObjectInputStream.java:890) at org.apache.openejb.client.EJBMetaDataImpl.readExternal (EJBMetaDataImp l.java:172) at org.apache.openejb.client.JNDIResponse.readExternal( JNDIResponse.java :86) at org.apache.openejb.client.Client.processRequest(Client.java:167) ... 19 more Tests run: 752, Failures: 5, Errors: 1, Skipped: 0, Time elapsed: 19.578 sec FAILURE! Results : Failed tests: Stateless.RMI_IIOP.returnEJBHomeArray( org.apache.openejb.test.NumberedTestCase $NamedTest) Stateless.EJBObject.isIdentical_stateless( org.apache.openejb.test.NumberedTest Case$NamedTest) Entity.BMP.HomeIntfc.findEmptyEnumeration( org.apache.openejb.test.NumberedTest Case$NamedTest) Entity.BMP.JNDI_ENC.lookupStatelessBusinessLocal( org.apache.openejb.test.Numbe redTestCase$NamedTest) Entity.BMP.RMI_IIOP.returnEJBMetaData( org.apache.openejb.test.NumberedTestCase $NamedTest) Tests in error: Entity.BMP.EJBHome..setUp()( org.apache.openejb.test.NumberedTestCase$TestSetup ) Tests run: 1499, Failures: 12, Errors: 4, Skipped: 0 [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] There are test failures. Please refer to C:\OpenEjb\server\openejb-ejbd\target\surefire-reports for the i ndividual test results. [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 83 minutes 39 seconds [INFO] Finished at: Wed Mar 19 18:55:28 IST 2008 [INFO] Final Memory: 36M/99M [INFO] How do I resolve this error? Thanks Ashish On Wed, Mar 19, 2008 at 3:47 PM, Ashish Jain [EMAIL PROTECTED] wrote: I use Windows XP. Thanks Ashish On Wed, Mar 19, 2008 at 2:37 PM, Jacek Laskowski [EMAIL PROTECTED] wrote: On Wed, Mar 19, 2008 at 9:18 AM, Ashish Jain [EMAIL PROTECTED] wrote: Hi Jacek, Thanks for your reply. I will start with building the openejb container and later with the execution of samples. What OS do you use? I keep having troubles with building openejb on WinXP and can't figure
How to make a contribution to the community
Hi All, I am interested in contributing to the community and there by learning more of EJB3. I am a newbie and I need help to start my contribution to the community. Thanks Ashish
Re: allowHosts in OpenEjb3.0
Hi Kevan, Thanks for your suggestion. Can you suggest me how can I use openejb start -Dadmin.only_from=127.0.0.1 in geronimo? I guess setting - Dadmin.only_from=127.0.0.1 in geronimo classpath will make things work. Thanks Ashish On 10/17/07, Kevan Miller [EMAIL PROTECTED] wrote: On Oct 17, 2007, at 3:05 AM, Ashish Jain wrote: Any help on this issue?? Ashish, OpenEJB 3.0 supports an 'only_from' configuration option. Running openejb standalone, you should be able to accomplish what you want. E.g.: openejb start -Dadmin.only_from=127.0.0.1 (note: I've never used this...) As I've noted on Geronimo dev list, we may be able to get this configured with existing codebase in Geronimo. If this feature is important to users, we should probably get 'allowedHosts' support back into Geronimo... Either way, it's a discussion for the geronimo list... --kevan
allowHosts in OpenEjb3.0
Hi, Is the attribute allowHosts removed in OpenEjb3.0? Is there any other alternative for this attribute? Thanks Ashish
What new in OpenEjb 3.0?
Hi All!! I am new to OpenEjb. Can someone tell me what is new in OpenEjb 3.0compared to the previous version. Thanks in advance Regards Ashish