0

I'm running Jboss 7.1.1 under CentOS 6.3. I have a war that I was able to run under Jboss 4.0.2 (old, I know, it's why we're updating) but I am having difficulty getting it to run under Jboss 7.

Under my META-INF/MANIFEST.MF file, I have the following entries:

Dependencies: com.jnetdirect,org.hibernate

and in my META-INF/jboss-deployment-structure.xml I have:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
  <deployment>
      <dependencies>
            <module name="org.hibernate" export="true" />
            <module name="com.jnetdirect" export="true" />
      </dependencies>
  </deployment>
</jboss-deployment-structure>

I created the {JBOSS_HOME}/modules/com/jnetdirect/main folder, and in there I placed JSQLConnect.jar, JSQLConnect.jar.index, and module.xml.

My module.xml file contains:

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.jnetdirect">
    <resources>
        <resource-root path="JSQLConnect.jar"/>
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.servlet.api" optional="true"/>
    </dependencies>
</module>

My JSQLConnect.jar. contains the output of jar -tf JSQLConnect.jar, which I removed the .class entries from using vim and :%s/.class//

When I run ./standalone.sh from {JBOSS_HOME}/bin, I get the following:

13:38:12,402 ERROR [stderr] (MSC service thread 1-1) org.hibernate.HibernateException: Specified JDBC Driver com.jnetdirect.jsql.JSQLDriver class not found
13:38:12,402 ERROR [stderr] (MSC service thread 1-1)    at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:104)
<snip>
13:38:12,430 ERROR [stderr] (MSC service thread 1-1) Caused by: java.lang.ClassNotFoundException: com.jnetdirect.jsql.JSQLDriver from [Module "org.hibernate:main" from local module loader @34985fc6 (roots: /usr/local/src/jboss-as-7.1.1.Final/modules)]
13:38:12,434 ERROR [stderr] (MSC service thread 1-1)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
<snip>
13:38:12,452 INFO  [stdout] (MSC service thread 1-1) com.cs.common.cache.SessionFactoryCache.processRequest : Exception : org.hibernate.HibernateException: Specified JDBC Driver com.jnetdirect.jsql.JSQLDriver class not found
13:38:12,453 INFO  [stdout] (MSC service thread 1-1)    at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:104)
<snip>
13:38:12,484 INFO  [stdout] (MSC service thread 1-1) Caused by: java.lang.ClassNotFoundException: com.jnetdirect.jsql.JSQLDriver from [Module "org.hibernate:main" from local module loader @34985fc6 (roots: /usr/local/src/jboss-as-7.1.1.Final/modules)]
13:38:12,484 INFO  [stdout] (MSC service thread 1-1)    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

I tried including the following in my standalone.xml:

    <subsystem xmlns="urn:jboss:domain:datasources:1.0">
        <datasources>
            <datasource jndi-name="java:jboss/datasources/REDACTED" pool-name="REDACTED" enabled="true" use-java-context="true">
                <connection-url>jdbc:JSQLConnect://redacted.net:1433;DatabaseName=REDACTED</connection-url>
                <driver>jnetdirect</driver>
                <security>
                    <user-name>redacted</user-name>
                    <password>redacted</password>
                </security>
            </datasource>
            <drivers>
                <driver name="jnetdirect" module="com.jnetdirect">
                    <driver-class>com.jnetdirect.jsql.JSQLDriver</driver-class>
                </driver>
            </drivers>
        </datasources>
    </subsystem>

when I do this I see the following entry on startup:

13:38:09,720 WARN  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010402: Unable to instantiate driver class "com.jnetdirect.jsql.JSQLDriver": java.lang.ClassNotFoundException: com.jnetdirect.jsql.JSQLDriver from [Module "com.jnetdirect:main" from local module loader @34985fc6 (roots: /usr/local/src/jboss-as-7.1.1.Final/modules)]
13:38:09,748 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
13:38:09,755 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final
13:38:09,769 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
13:38:09,771 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
13:38:09,786 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 27) Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("jdbc-driver" => "jnetdirect")
]) - failure description: "JBAS010434: Unable to instantiate driver class \"com.jnetdirect.jsql.JSQLDriver\". See log (WARN) for more details"

But the same ClassNotFoundException as before.

Interestingly, when I shut down the server, I see the following:

13:38:17,424 INFO  [org.jboss.as.server.deployment] JBAS015877: Stopped deployment common.war in 40ms
13:38:17,426 INFO  [org.jboss.as.controller] JBAS014774: Service status report
JBAS014776:    Newly corrected services:
      service jboss.jdbc-driver.jnetdirect (new available)

13:38:17,430 INFO  [org.jboss.as] JBAS015950: JBoss AS 7.1.1.Final "Brontes" stopped in 39ms

I am deleting the standalone/log and standalone/tmp directories, and the common.war.deployed file between each run.

I thought since it was a hibernate problem, I should add com.jnetdirect to the hibernate module's dependencies, but that hasn't helped.

I've already looked at jboss 7 AS datasource for sqlserver , JDBC Postgresql driver on JBoss 7 , How to connect Jboss-as-7.1.1 with Postgresql and https://community.jboss.org/thread/202025 , although none of those are specific to JNETDirect.

(We're using JNETDirect due to orders from on high, so I can't switch to another JDBC driver)

Ideas?

Community
  • 1
  • 1
Kane
  • 4,047
  • 2
  • 24
  • 33

1 Answers1

0

Turns out the problem was with my .index file in the module. I deleted that and it loaded fine. No idea what the .index file is supposed to be for or why mine was broken.

Kane
  • 4,047
  • 2
  • 24
  • 33