I'am trying to migrate websphere 7 to JBoss 7.1 and i have several problem to configure my datasource, here is my whole config(database is oracle 10g) :
Jboss deployement looks fine
JBAS010400: Bound data source [jboss/datasources/xx3_oracle_tu_2]
My standalone-full.xml :
jdbc:oracle:thin:@************:1521:*****
oracle
UD1XXBD
*******
oracle.jdbc.OracleDriver
Seems ok about oracle driver:
JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 1.0)
Here is my bean in spring xml file :
org.jboss.naming.remote.client.InitialContextFactory
remote://localhost:4447
user
******
false
org.jboss.ejb.client.naming
The only error i have is :
Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jboss/datasources/xx3_oracle_tu_2 -- service jboss.naming.context.java.jboss.exported.jboss.datasources.xx3_oracle_tu_2
On Jboss web admin console, no problems datasource appears.
Also with jboss-cli script and this command line, everything seems ok :
jboss-cli.bat -c --command=/subsystem=datasources/data-source=xx3_oracle_tu_2:test-connection-in-pool
{
"outcome" => "success",
"result" => [true]
}
I don't understand why this command line does not work :
jboss-cli.bat -c --command=/subsystem=datasources/data-source=java\:jboss\/datasources\/xx3_oracle_tu_2:test-connection-in-pool
Am i missing something about JBoss 7.1 JNDI configuration ?
Thanks by advance for your help !
EDIT : don't declare jboss/datasources and declare it like this in your standalone file and jboss-web file:
java:/xx3_oracle_tu_2
解决方案
AFAIK That command doesn't accept full JNDI references, it expects a datasource name.
You can view your datasource names with
/subsystem=datasources:read-resource(recursive=true)
Edit: ok, so the problem you have is with remote lookup.
If you look at this thread, you can see that unfortunately:
Remote lookup of datasources is not supported in AS7.
Edit2: so you're not doing a remote lookup after all.
Both this:
jndi-name="java:jboss/datasources/xx3_oracle_tu_2"/>
and this:
should do. JNDI env property you should not use, that's meant for remote lookups.