[jboss-as7-dev] Special content overlays (Was: Re: Oracle datasource missing dependencies)

David M. Lloyd david.lloyd at redhat.com
Wed May 4 09:43:04 EDT 2011


On 05/04/2011 07:54 AM, Stefano Maestri wrote:
> The problem is the driver itself.
> Oracle 10.2 jdbc driver is type 3 driver and it can't be loaded by
> java.util.ServiceLoader using the META-INF/services directory in the jar.
> And it's the only way we are supporting jdbc as module or deployment.
> IOW we are just supporting type 4 driver.
>
> Use Oracle 11g driver, I've tested it and it's working.

Exactly right.  We do need an easier way to support JDBC 3 drivers 
though.  Once https://issues.jboss.org/browse/AS7-431 is merged we 
should have more options though.

First option would be to deploy a neighboring content root which 
includes the requisite META-INF/services file alongside the JDBC driver 
JAR like this:

    <deployment name="my-driver.jar">
       <fs-archive path="deployments/my-driver.jar" 
relative-to="jboss.server.deploy.dir"/>
       <fs-exploded path="user-stuff/my-driver-overlay" 
relative-to="jboss.server.base.dir"/>
    </deployment>

Where user-stuff/my-driver-overlay contains the 
META-INF/services/java.sql.Driver file.

Or, we could introduce a new content type just for services:

    <deployment name="my-driver.jar">
       <fs-archive path="deployments/my-driver.jar" 
relative-to="jboss.server.deploy.dir"/>
       <service type="java.sql.Driver">
          <class name="com.foo.blah.SomeDriver"/>
       </service>
    </deployment>

Granted opens a door to a whole new concept: including deployment 
description in the management model.

-- 
- DML


More information about the jboss-as7-dev mailing list