[jboss-as7-dev] Installing a JDBC driver as a deployment

Jason T. Greene jason.greene at redhat.com
Thu Apr 14 09:54:28 EDT 2011


The syntax for driver isn't the jar name. I believe its the Driver class 
and version although it should not require a version and pick the latest.


On 4/14/11 8:51 AM, Heiko Braun wrote:
>
> 1.) so, I deploy it
>
> [localhost:9999 /] :read-children-names(child-type=deployment)
> {
>      "outcome" =>  "success",
>      "result" =>  [
>          "demo-application.war",
>          "mysql-connector-java-5.1.6.jar"
>      ],
>      "compensating-operation" =>  undefined
> }
>
>
>
> 2.) then reference it
>
> [localhost:9999 /] /profile=default/subsystem=datasources/jdbc-driver=mysql-connector-java-5.1.6.jar:add(driver=mysql-connector-java-5.1.6.jar)
> {
>      "outcome" =>  "failed",
>      "result" =>  {"server-groups" =>  {
>          "staging-servers" =>  {"staging-server" =>  {
>              "host" =>  "local",
>              "response" =>  {
>                  "outcome" =>  "failed",
>                  "failure-description" =>  "Failed to load module for driver [mysql-connector-java-5.1.6.jar]"
>              }
>          }},
>          "main-server-group" =>  {
>              "server-one" =>  {
>                  "host" =>  "local",
>                  "response" =>  {
>                      "outcome" =>  "failed",
>                      "failure-description" =>  "Failed to load module for driver [mysql-connector-java-5.1.6.jar]"
>                  }
>              },
>              "server-two" =>  {
>                  "host" =>  "local",
>                  "response" =>  {
>                      "outcome" =>  "failed",
>                      "failure-description" =>  "Failed to load module for driver [mysql-connector-java-5.1.6.jar]"
>                  }
>              }
>          }
>      }},
>      "failure-description" =>  "Operation was not applied successfully to any servers"
> }
>
>
> regardless of the error, the driver exists:
>
> [localhost:9999 /] /profile=default/subsystem=datasources/jdbc-driver=mysql-connector-java-5.1.6.jar:read-resource
> {
>      "outcome" =>  "success",
>      "result" =>  {
>          "name" =>  "mysql-connector-java-5.1.6.jar",
>          "driver" =>  "mysql-connector-java-5.1.6.jar"
>      },
>      "compensating-operation" =>  undefined
> }
>
>
> The remaining question is: why the errors?
>
>
> Ike
>
>
>
> On Apr 14, 2011, at 3:34 PM, Jason T. Greene wrote:
>
>> 2 is not checking installed jdbc drivers, it is dumping the jdbc-driver element of a configured resource. You first have to deploy a driver, and then you can refer to it via the resource configuration, which contains things like pool sizes and so on.
>>
>> I think the thing that's missing here is a way for you to know the available jdbc drivers. It sounds like we need a new management operation....
>>
>> On 4/14/11 6:58 AM, Heiko Braun wrote:
>>>
>>> (Referring to http://community.jboss.org/wiki/DataSourceConfigurationinAS7#Installing_a_JDBC_driver_as_a_deployment)
>>>
>>> How is this supposed to work?
>>> I manage to install the driver as a deployment and then what?
>>> It's not listed as a driver but seems to be installed successfully.
>>>
>>>
>>> 1) deployment of the driver
>>>
>>> [localhost:9999 /] deploy /Users/hbraun/Desktop/mysql-connector-java-5.1.6.jar
>>> undefined
>>>
>>> [localhost:9999 /] deploy /Users/hbraun/Desktop/mysql-connector-java-5.1.6.jar
>>> 'mysql-connector-java-5.1.6.jar' is already deployed (use -f to force re-deploy).
>>>
>>>
>>> 2) check installed driver
>>>
>>> [localhost:9999 /] /profile=default/subsystem=datasources:read-children-names(child-type=jdbc-driver)
>>> {
>>>      "outcome" =>   "success",
>>>      "result" =>   ["com.h2database.h2"],
>>>      "compensating-operation" =>   undefined
>>> }
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> jboss-as7-dev mailing list
>>> jboss-as7-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>
>>
>> --
>> Jason T. Greene
>> JBoss, a division of Red Hat
>


-- 
Jason T. Greene
JBoss, a division of Red Hat



More information about the jboss-as7-dev mailing list