Hi Ricardo,
for me it works fine in JBoss 5.1. I think your JDBC URL is wrong:
jdbc:h2:tcp://localhost:9092/${jboss.server.data.dir}$/data/DixtalDB;
At least the $ before /data must be omitted. Also: the property
jboss.server.data.dir points already to a directory data. Maybe you
can try the following JDBC URL:
jdbc:h2:tcp://localhost:9092/${jboss.server.data.dir}/DixtalDB
Best,
Manfred
On Mar 22, 3:27 pm, Ricardo Tatsch <[email protected]> wrote:
> Hello Felows,
>
> I'm trying to use the H2 in embedded mode with JBOSS. No errors occur when
> starting the AS, but occurs when I try to connect the H2. I've done MANY
> Google searches and found little information.
>
> Below the error:
>
> 10:48:22,573 INFO [STDOUT] H2ClienteDAO.initDb()
> 10:48:24,001 WARN [JBossManagedConnectionPool] *Throwable while attempting
> to get a new connection: null*
> org.jboss.resource.JBossResourceException: Could not create connection; -
> nested throwable: (org.h2.jdbc.JdbcSQLException: *Connection is broken:
> "session closed" [90067-131])*
> at
> org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:155)
> at
> org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619)
> at
> org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:264)
> at
> org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:575)
> at
> org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:347)
> at
> org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)
> at
> org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:402)
> at
> org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
> at
> org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
> at dixtal.basico.server.PersistenciaContainer.getPersistencia(Unknown
> Source)
> at dixtal.basico.server.AbstractSqlDAO.getConnection(Unknown Source)
> at dixtal.sgdb.h2.model.H2DatabaseDAO.initDb(H2DatabaseDAO.java:31)
>
> Below is the code of the routine that tries to connect.
>
> public Object getPersistencia() {
> try {
> InitialContext ic = new InitialContext();
> javax.sql.DataSource ds = (javax.sql.DataSource)
> ic.lookup("java:/H2Ds");
> return ds.getConnection();
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> return null;
> }
>
> Attached the h2-xa-ds.xml.
>
> Ricardo Santana Tatsch
> Development Analyst / P & D
> (55+51) 3019-4625
> [email protected]/tatsch_dixtal
> Dixtal Biomédica
>
> Philips Healthcare Cardiac and Critical Care
>
> h2-xa-ds.xml
> 2KViewDownload
--
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.