-
1. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
nickarls Nov 29, 2012 6:48 AM (in response to mp_lbi)(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?
-
2. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
mp_lbi Nov 29, 2012 9:00 AM (in response to nickarls)Thanks for your time.
from domain.xml:
<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.
-
3. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
nickarls Nov 29, 2012 2:17 PM (in response to mp_lbi)domain.xml? If you run standalone.sh/bat you should edit standalone.xml
-
4. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
mp_lbi Nov 29, 2012 9:56 PM (in response to nickarls)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.
-
5. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
nickarls Nov 30, 2012 1:24 AM (in response to mp_lbi)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...
-
6. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
jaikiran Nov 30, 2012 3:29 AM (in response to nickarls)Can one of you attach the entire domain.xml being used?
-
7. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
nickarls Nov 30, 2012 9:50 AM (in response to jaikiran)I'm not at work anymore but it was an unmodified domain.xml
-
8. Re: Unable to lookup datasource in jboss-as-7.2.0.Alpha1-SNAPSHOT
nickarls Dec 3, 2012 1:47 AM (in response to mp_lbi)Appears to be a bug, https://issues.jboss.org/browse/AS7-6062 filed