How do you install an Oracle Datasource in AS7.x/EAP6.0.1 domain mode using CLI?
sboscarine Feb 20, 2013 1:53 PMHello All,
I ask both for myself and hoping this will be helpful to other users. I have a CLI script for EAP 6.0.1 that works great for standalone mode and am having challenges getting it working in domain mode.
Standalone Script:
#Register driver as JBoss module (update path to ojdbc6.jar)module add --name=com.oracle.jdbc --resources=ojdbc6.jar --dependencies=javax.api,javax.transaction.api #Register module as driver /subsystem=datasources/jdbc-driver=oracle:add(driver-module-name=com.oracle.jdbc,driver-name=oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource) #Create our main DataSource /subsystem=datasources/data-source=myds:add( \ jndi-name=java:/myds, \ #CHANGE ME! connection-url=jdbc:oracle:thin:@localhost:1521:XE,\ #CHANGE ME! user-name=ChangeMePlease, \ #CHANGE ME! password=ChangeMePlease, \ use-java-context=false, \ check-valid-connection-sql="select 1 from dual", \ min-pool-size=2,\ max-pool-size=50,\ driver-name=oracle,\ flush-strategy=FailingConnectionOnly) #Enable /subsystem=datasources/data-source=myds:enable #reload server to apply changes /:reload
I am starting a default domain:
Here's how far I could get:
I think I was successful in installing the driver as a global module:
#Start CLI on server without connecting [user@vm003 ~]$ jboss-cli.sh You are disconnected at the moment. Type 'connect' to connect to the server or ' [disconnected /] module add --name=com.oracle.jdbc --resources=ojdbc6.jar --dependencies=javax.api,javax.transaction.api #Now verify [user@vm003 ~]$ ls $JBOSS_HOME/modules/com/oracle/jdbc/main/ module.xml ojdbc6.jar
I am stuck on the next command, where I am trying to register my module as a driver.
#Confirm that we have a server named "server-one" on "master" [domain@192.168.1.142:9999 /] /host=master/server=server-one/subsystem=datasources:installed-drivers-list { "outcome" => "success", "result" => [{ "driver-name" => "h2", "deployment-name" => undefined, "driver-module-name" => "com.h2database.h2", "module-slot" => "main", "driver-datasource-class-name" => "", "driver-xa-datasource-class-name" => "org.h2.jdbcx.JdbcDataSource", "driver-class-name" => "org.h2.Driver", "driver-major-version" => 1, "driver-minor-version" => 3, "jdbc-compliant" => true }] } #Now try to run our command to register a datasource against server-one on master [domain@192.168.1.142:9999 /] /host=master/server=server-one/subsystem=datasources/jdbc-driver=oracle:add(driver-module-name=com.oracle.jdbc,driver-name=oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource) Failed to get the list of the operation properties: "JBAS014753: There is no operation add registered at address [ ("subsystem" => "datasources"), ("jdbc-driver" => "oracle") ]"
How do you register a driver in domain mode?
Is there a way to make this commad global across all servers?