Hi,
I have problems to connect to the connection pool of my application server. I used the search function, but I didn' find any answers to my problem.
Application Server: Glassfish
DB: Oracle
SmartGwt: Version 2.1 (Eval) [The Power Version is already ordered)
Configuration web.xml:
<resource-ref>
<res-ref-name>jdbc/SdomPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Configuration sun.web.xml:
<sun-web-app>
<resource-ref>
<res-ref-name>jdbc/SdomPool</res-ref-name>
<jndi-name>jdbc/SdomPool</jndi-name>
</resource-ref>
<security-role-mapping>
<role-name>ASADMIN</role-name>
<group-name>asadmin</group-name>
</security-role-mapping>
</sun-web-app>
With the following Code on the Server-Side the access to the Connection-Pool is working:
InitialContext context = new InitialContext();
javax.sql.DataSource dataSource = (javax.sql.DataSource) context .lookup("jdbc/SdomPool")connection = dataSource.getConnection();
If I'm using the Admin Console to configure the JDNI-Datsource I get the following Exception:
Failure: Unable to connect. Error from Driver: java.lang.NullPointerException
=== 2010-07-22 13:41:49,106 [7-21] DEBUG BuiltinRPC - Testing DB connection for database: jdbc/SdomPool with config: {
"driver.networkProtocol":"tcp",
"interface.credentialsInURL":true,
dbName:"jdbc/SdomPool",
"database.type":"oracle",
isDefault:true,
"interface.type":"jndi",
dbStatus:"Unable to connect",
"driver.serverName":"localhost",
"pool.enabled":"false",
"driver.driverType":"thin",
"driver.context":"_container_",
"driver.portNumber":"1521",
_selection_3:true,
name:"jdbc/SdomPool"
}
=== 2010-07-22 13:41:49,106 [7-21] DEBUG PoolableSQLConnectionFactory - Initializing SQL config for 'jdbc/SdomPool' via JNDI
=== 2010-07-22 13:41:49,107 [7-21] DEBUG JNDI - No configuration for JNDI context _container_ - assuming default initialContext
=== 2010-07-22 13:41:49,108 [7-21] DEBUG JNDI - Detected container context, using new InitialContext(env) lookup method
=== 2010-07-22 13:41:49,110 [7-21] INFO BuiltinRPC - testDB (jdbc/SdomPool) error: java.lang.NullPointerException
Regards
Christian
I have problems to connect to the connection pool of my application server. I used the search function, but I didn' find any answers to my problem.
Application Server: Glassfish
DB: Oracle
SmartGwt: Version 2.1 (Eval) [The Power Version is already ordered)
Configuration web.xml:
<resource-ref>
<res-ref-name>jdbc/SdomPool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Configuration sun.web.xml:
<sun-web-app>
<resource-ref>
<res-ref-name>jdbc/SdomPool</res-ref-name>
<jndi-name>jdbc/SdomPool</jndi-name>
</resource-ref>
<security-role-mapping>
<role-name>ASADMIN</role-name>
<group-name>asadmin</group-name>
</security-role-mapping>
</sun-web-app>
With the following Code on the Server-Side the access to the Connection-Pool is working:
InitialContext context = new InitialContext();
javax.sql.DataSource dataSource = (javax.sql.DataSource) context .lookup("jdbc/SdomPool")connection = dataSource.getConnection();
If I'm using the Admin Console to configure the JDNI-Datsource I get the following Exception:
Failure: Unable to connect. Error from Driver: java.lang.NullPointerException
=== 2010-07-22 13:41:49,106 [7-21] DEBUG BuiltinRPC - Testing DB connection for database: jdbc/SdomPool with config: {
"driver.networkProtocol":"tcp",
"interface.credentialsInURL":true,
dbName:"jdbc/SdomPool",
"database.type":"oracle",
isDefault:true,
"interface.type":"jndi",
dbStatus:"Unable to connect",
"driver.serverName":"localhost",
"pool.enabled":"false",
"driver.driverType":"thin",
"driver.context":"_container_",
"driver.portNumber":"1521",
_selection_3:true,
name:"jdbc/SdomPool"
}
=== 2010-07-22 13:41:49,106 [7-21] DEBUG PoolableSQLConnectionFactory - Initializing SQL config for 'jdbc/SdomPool' via JNDI
=== 2010-07-22 13:41:49,107 [7-21] DEBUG JNDI - No configuration for JNDI context _container_ - assuming default initialContext
=== 2010-07-22 13:41:49,108 [7-21] DEBUG JNDI - Detected container context, using new InitialContext(env) lookup method
=== 2010-07-22 13:41:49,110 [7-21] INFO BuiltinRPC - testDB (jdbc/SdomPool) error: java.lang.NullPointerException
Regards
Christian
Comment