Hello, I'm using the SmartGWT Pro trial, and can't seem to get the admin console to recognize my ORACLE database via JNDI. I receive a NullPointerException, but I'm not sure why, as there isn't any information provided in the message explaining it - here is the log snippet:
I'm running JBoss 4.2.3.GA with SmartGWTEE 2.3, and I'm using the GWT 2.0.4 compiler.
Here's my datasource:
Here's the resource configuration in jboss-web.xml:
And finally my web.xml:
Samples using the built-in HSQLDB datasource work fine, and I can access this datasource via JNDI in servlet code without any problems (of course, being a resource-ref, I need to use java:comp/env/ in code):
I've tried many combinations of the JNDI name, include with/without 'java:', with/without 'comp/env', etc. Any idea what I'm doing wrong here? And this might sound dumb, but do I even need to use resource-refs? I can access JNDI resources in my servlets with or without mapping them like this.
Is it possible I need to specify some configuration in server.properties to set up the JNDI context? (I haven't yet found the documentation for the available configuration parameters in server.properties.)
Your assistance is appreciated. Thanks!
Code:
2010-08-05 12:13:38,913 INFO [STDOUT] === 2010-08-05 12:13:38,913 [80-3] DEBUG BuiltinRPC - Testing DB connection for database: testDB with config: { "driver.context":"_container_", "driver.serverName":"localhost", "interface.credentialsInURL":true, "driver.driverType":"thin", "driver.networkProtocol":"tcp", "driver.portNumber":"1521", useURL:false, driver:null, "driver.url":null, driverName:null, "database.type":"oracle", autoJoinTransactions:true, "interface.type":"jndi", name:"testDB", dbName:"testDS" } 2010-08-05 12:13:38,955 INFO [STDOUT] === 2010-08-05 12:13:38,955 [80-3] DEBUG PoolableSQLConnectionFactory - Initializing SQL config for 'testDS' via JNDI 2010-08-05 12:13:38,958 INFO [STDOUT] === 2010-08-05 12:13:38,958 [80-3] DEBUG JNDI - No configuration for JNDI context _container_ - assuming default initialContext 2010-08-05 12:13:38,961 INFO [STDOUT] === 2010-08-05 12:13:38,961 [80-3] DEBUG JNDI - Detected container context, using new InitialContext(env) lookup method 2010-08-05 12:13:38,964 INFO [STDOUT] === 2010-08-05 12:13:38,964 [80-3] INFO BuiltinRPC - testDB (testDB) error: java.lang.NullPointerException 2010-08-05 12:13:38,967 INFO [STDOUT] === 2010-08-05 12:13:38,967 [80-3] DEBUG RPCDMI - rpc returned RPCResponse 2010-08-05 12:13:38,970 INFO [STDOUT] === 2010-08-05 12:13:38,970 [80-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
Here's my datasource:
Code:
<DataSource ID="testDataSource" serverType="sql" dbName="testDS" tableName="EMPLOYEES"> <fields> <field name="EMPLOYEE_ID" primaryKey="true"/> <field name="EMPLOYEE_NAME" /> </fields> </DataSource>
Code:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd"> <jboss-web> <resource-ref> <res-ref-name>testDS</res-ref-name> <jndi-name>java:/testDS</jndi-name> </resource-ref> </jboss-web>
Code:
<resource-ref> <res-ref-name>testDS</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
Code:
try { InitialContext context = new InitialContext(); System.out.println("Context: " + context.lookup("java:comp/env/testDS")); } catch (Exception ex) { System.out.println(ex); } 2010-08-05 12:32:48,097 INFO [STDOUT] Context: org.jboss.resource.adapter.jdbc.WrapperDataSource@35c41b
Is it possible I need to specify some configuration in server.properties to set up the JNDI context? (I haven't yet found the documentation for the available configuration parameters in server.properties.)
Your assistance is appreciated. Thanks!
Comment