[ 
https://issues.apache.org/jira/browse/OPENEJB-802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616899#action_12616899
 ] 

Jean-Louis MONTEIRO commented on OPENEJB-802:
---------------------------------------------

Hi David,

I faced this problem few weeks ago with a jrockit JVM.
In fact after some investigations and after having a look at the end of the 
stack trace (Caused by: java.lang.NumberFormatException: For input string: "" 
), it seems that the problem comes from the default value defined in the 
META-INF/org.apache.openejb/service-jar.xml

  <ServiceProvider
          id="Default JDBC Database"
          service="Resource"
          types="javax.sql.DataSource, DataSource"
          factory-name="create"
          constructor="JtaManaged"
          class-name="org.apache.openejb.resource.jdbc.DataSourceFactory">

[...]

    # The default TransactionIsolation state of new connections
    # If not set then the setTransactionIsolation method will not
    # be called. The allowed values for this property are:
    #     NONE
    #     READ_COMMITTED
    #     READ_UNCOMMITTED
    #     REPEATABLE_READ
    #     SERIALIZABLE
    #
    # Note: Most JDBC drivers do not support all isolation levels

    DefaultTransactionIsolation

[...]

  </ServiceProvider>

The default value being "", that is why you have this exception. One workaround 
is to change the value in your openejb.xml
The case is that regarding OpenEJB jdbc resource management, I can not 
understand why this error occurs

   public synchronized void setDefaultTransactionIsolation(String s) {
        if (s == null || s.equals("")) return;
        int level = IsolationLevels.getIsolationLevel(s);
        super.setDefaultTransactionIsolation(level);
    }

Kind regards,
Jean-Louis MONTEIRO




> Support for IBM JDK 1.5
> -----------------------
>
>                 Key: OPENEJB-802
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-802
>             Project: OpenEJB
>          Issue Type: New Feature
>          Components: general
>    Affects Versions: 3.0-beta-1, 3.0-beta-2, 3.0
>            Reporter: David Blevins
>             Fix For: 3.0.1
>
>
> OpenEJB 3.0 is not currently supported for the IBM JDK.  A stack trace
> Attempted to
> load OpenEJB. org.apache.xbean.recipe.ConstructionException: Error
> setting property: public synchronized void
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int): 
> Error setting property: public synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int) 
> [Root exception is org.apache.openejb.OpenEJBException: 
> org.apache.xbean.recipe.ConstructionException: Error setting property: public 
> synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int): 
> Error setting property: public synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int)]
>       at com.whitestein.fe.it.cal.CalUtils.newComm(CalUtils.java:74)
>       at
> com.whitestein.fe.it.cal.AbstractCalDbTest.setUp(AbstractCalDbTest.java:101)
>       at
> com.whitestein.fe.it.cal.db.TransactionTest.setUp(TransactionTest.java:35)
>       at junit.framework.TestCase.runBare(TestCase.java:125)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:118)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>       at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>       at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: javax.naming.NamingException: Attempted to load OpenEJB.
> org.apache.xbean.recipe.ConstructionException: Error setting property:
> public synchronized void
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int): 
> Error setting property: public synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int) 
> [Root exception is org.apache.openejb.OpenEJBException: 
> org.apache.xbean.recipe.ConstructionException: Error setting property: public 
> synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int): 
> Error setting property: public synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int)]
>       at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
>       at
> org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
>       at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:679)
>       at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:259)
>       at javax.naming.InitialContext.init(InitialContext.java:235)
>       at javax.naming.InitialContext.<init>(InitialContext.java:209)
>       at
> com.whitestein.fe.embedded.launcher.OpenEjbAndJettyLauncher.initOpenEJB(OpenEjbAndJettyLauncher.java:266)
>       at
> com.whitestein.fe.embedded.launcher.OpenEjbAndJettyLauncher.launch(OpenEjbAndJettyLauncher.java:149)
>       at
> com.whitestein.fe.embedded.launcher.Launcher.launch(Launcher.java:109)
>       at com.whitestein.fe.it.cal.CalUtils.newComm(CalUtils.java:47)
>       ... 15 more
> Caused by: org.apache.openejb.OpenEJBException:
> org.apache.xbean.recipe.ConstructionException: Error setting property:
> public synchronized void
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int): 
> Error setting property: public synchronized void 
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int)
>       at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:263)
>       at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:149)
>       at org.apache.openejb.OpenEJB.init(OpenEJB.java:288)
>       at org.apache.openejb.OpenEJB.init(OpenEJB.java:267)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:615)
>       at
> org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
>       at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:62)
>       at
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
>       ... 24 more
> Caused by: org.apache.xbean.recipe.ConstructionException: Error setting
> property: public synchronized void
> org.apache.commons.dbcp.BasicDataSource.setDefaultTransactionIsolation(int)
>       at
> org.apache.xbean.recipe.ObjectRecipe.setProperty(ObjectRecipe.java:410)
>       at
> org.apache.xbean.recipe.ObjectRecipe.setProperties(ObjectRecipe.java:363)
>       at
> org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:278)
>       at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
>       at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
>       at
> org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
>       at
> org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:888)
>       at
> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:327)
>       at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:250)
>       ... 34 more
> Caused by: org.apache.xbean.propertyeditor.PropertyEditorException:
> java.lang.NumberFormatException: For input string: ""
>       at
> org.apache.xbean.propertyeditor.IntegerEditor.toObjectImpl(IntegerEditor.java:31)
>       at
> org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:80)
>       at
> org.apache.xbean.propertyeditor.PropertyEditors.getValue(PropertyEditors.java:246)
>       at org.apache.xbean.recipe.RecipeHelper.convert(RecipeHelper.java:172)
>       at
> org.apache.xbean.recipe.ObjectRecipe.setProperty(ObjectRecipe.java:400)
>       ... 42 more
> Caused by: java.lang.NumberFormatException: For input string: ""
>       at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:63)
>       at java.lang.Integer.parseInt(Integer.java:502)
>       at java.lang.Integer.valueOf(Integer.java:587)
>       at
> org.apache.xbean.propertyeditor.IntegerEditor.toObjectImpl(IntegerEditor.java:29)
>       ... 46 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to