(This is more a question for main forum and not the dev section)
What does your datasource definition look like in standalone.xml? Can you see it deployed in the log?
Thanks for your time.
<datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" > <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource> <drivers> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> </drivers> </datasources>
I haven't changed anything in the domain.xml
Another point is I don't see any logs indicating that the above datasource is being bound to the JNDI.
Below is the only log statements i do find about he h2 driver:
18:55:07,803 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 57) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
Just fyi, this works fine in 7.1.1.Final version and i do see the log statements showing the datasource being bound to the jndi.
domain.xml? If you run standalone.sh/bat you should edit standalone.xml
I started the server using domain.bat.
Below the steps i have performed:
1. downloaded the jboss-as-7.2.0.Alpha1-SNAPSHOT from 'https://ci.jboss.org/jenkins/job/JBoss-AS-7.x-latest/'
2. started the server using domain.bat
3. I can see the datasource(
java:jboss/datasources/ExampleDS) in the admin console under 'Datasources' section.
4. I deployed my simple web application(you can find it attached) via the admin console, the application has a servlet and has the logic to lookup the datasource in the init method.
Eventhough the datasource is shown in the admin console, the lookup is failing inside the servlet.
But when i deploy the same web application in jboss-as-7.1.1.Final , it works.
Strange thing is that the lookup succeds in standalone mode. Have to do some googling on how the jndi looks differ between standalone and domain modes...
Can one of you attach the entire domain.xml being used?
I'm not at work anymore but it was an unmodified domain.xml