Hi, Maybe this is related to using multiple threads? Could you try to create a simple standalone test case, or describe your application in more detail?
I will be on vacation this week and will have time to have a look at the problem at the weekend. Regards, Thomas On Tue, Apr 14, 2009 at 7:57 AM, Yonas <[email protected]> wrote: > > Hi, > > I just upgraded to .111 and there seems to an issue where a null > pointer exception is thrown. > > I create the connection using: > > // Create conn... > JdbcDataSource dsl = new JdbcDataSource(); > dsl.setURL(debugURL = "jdbc:h2:"+dbDir+"/emoa- > encrypted;CIPHER=AES;WRITE_DELAY=2000;LOCK_TIMEOUT=2500"); > dsl.setUser(debugUser = "sa"); > dsl.setPassword(xxx); > > // Bind to JNDI so I can look it up from TopLink. > > System.setProperty(Context.INITIAL_CONTEXT_FACTORY, > SimpleNamingContext.Factory.class.getName()); > SimpleNamingContext.Factory.setContext(new > SimpleNamingContext()); > > > InitialContext ic = new InitialContext(); > > ic.createSubcontext("jdbc"); > ic.bind("jdbc/MidwifeMateDS", dsl); > > When I step through it slowly in the debugger, the error does not > occur. But when I break on null pointer exception, I catch a null > pointer exception in: > > /** > * INTERNAL > */ > public JdbcConnection(JdbcConnection clone) { > this.session = clone.session; > trace = session.getTrace(); > int id = getNextId(TraceObject.CONNECTION); > setTrace(trace, TraceObject.CONNECTION, id); > this.user = clone.user; > this.url = clone.url; > } > > On the line where it is calling "session.getTrace()". Pretty much > everything in the session seems to be null, and higher in the stack > trace it looks like it's creating a new connection within the > connection pool. This worked in .108, however the SELECT...ORDER BY > was causing me greif so I upgraded. > > Thanks, Y. > > > > SEVERE: > java.lang.NullPointerException > at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:128) > at org.h2.jdbcx.JdbcXAConnection$PooledJdbcConnection.<init> > (JdbcXAConnection.java:481) > at org.h2.jdbcx.JdbcXAConnection.getConnection(JdbcXAConnection.java: > 121) > at org.h2.jdbcx.JdbcConnectionPool.getConnectionNow > (JdbcConnectionPool.java:225) > at org.h2.jdbcx.JdbcConnectionPool.getConnection > (JdbcConnectionPool.java:201) > at org.eclipse.persistence.sessions.JNDIConnector.connect > (JNDIConnector.java:133) > at org.eclipse.persistence.sessions.JNDIConnector.connect > (JNDIConnector.java:94) > at > org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource > (DatasourceLogin.java:162) > at > org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal > (DatasourceAccessor.java:324) > at > org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal > (DatabaseAccessor.java:265) > at > org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connect > (DatasourceAccessor.java:407) > at > org.eclipse.persistence.sessions.server.ConnectionPool.buildConnection > (ConnectionPool.java:130) > at > org.eclipse.persistence.sessions.server.ExternalConnectionPool.startUp > (ExternalConnectionPool.java:118) > at org.eclipse.persistence.sessions.server.ServerSession.connect > (ServerSession.java:502) > at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login > (DatabaseSessionImpl.java:629) > at > org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login > (EntityManagerFactoryProvider.java:229) > at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy > (EntityManagerSetupImpl.java:255) > at > org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession > (EntityManagerFactoryImpl.java:111) > at > org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl > (EntityManagerFactoryImpl.java:163) > at > org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager > (EntityManagerFactoryImpl.java:150) > at midwifemate.client.conn.DataConfigHelper.getEntityManager > (DataConfigHelper.java:287) > at midwifemate.LoginDialog$5.run(LoginDialog.java:248) > at java.lang.Thread.run(Thread.java:637) > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/h2-database?hl=en -~----------~----~----~----~------~----~------~--~---
