I'm currently tasked with getting our Java program out of the past and in to the future. It's currently running pseudo-compiled Java 6 (with a target of 1.3 in ANT), and using a lot of hacks to do "cutting" edge things at the time, like using com.sun.apt. I've since gutted all that garbage, and the program runs in full native Java 8 now. However, when I went to run the program in JBoss 4, at first everything was fine, until I tried MKYong's forEach example in one of our actions, the loadClass call coming from a Tomcat lib was crashing on the action that contained the J8 bytecode. I did some googling, and found that the ONLY version of "JBoss" that even supports Java 8 is Wildfly 8, the version that was created after JBoss switched its name to Wildfly. Right now I'm trying to setup some JNDI's for the server that JBoss 4 used to use, and this is how it's currently setup in standalone.xml:
<datasource jta="true" jndi-name="java:/jdbc/oraclePool" pool-name="oraclePool" enabled="true" use-java-context="true" use-ccm="true"> <connection-url>jdbc:sqlserver://DatabaseDNS:1433;DatabaseName=testdb;SelectMethod=cursor</connection-url> <driver>sqlserver2008</driver> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <pool> <min-pool-size>0</min-pool-size> <max-pool-size>50</max-pool-size> <prefill>false</prefill> <use-strict-min>false</use-strict-min> <flush-strategy>FailingConnectionOnly</flush-strategy> </pool> <security> <user-name>test</user-name> <password>test</password> </security> <validation> <check-valid-connection-sql>select * from sysobjects</check-valid-connection-sql> </validation> <statement> <prepared-statement-cache-size>300</prepared-statement-cache-size> <share-prepared-statements></share-prepared-statements> </statement> </datasource> <drivers> <driver name="sqlserver2008" module="com.microsoft"> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> </driver> </drivers>
The driver is coming from here: https://developer.jboss.org/wiki/HowToSetADatasourceConnectionToMSSQLServer
Subsequently my module.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!-- JDBC Drivers module.xml file to configure your JDBC drivers--> <module xmlns="urn:jboss:module:1.3" name="com.microsoft"> <resources> <resource-root path="sqljdbc4.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> </dependencies> </module>
And the directory for the module is:
Directory: X:\WildflyTestBed\modules\com\microsoft\main Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 8/3/2017 11:05 AM 377 module.xml -a---- 8/3/2017 10:51 AM 584207 sqljdbc4.jar
But I'm STILL getting a module error in the Wildfly console:
11:10:57,485 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([ ("subsystem" => "datasources"), ("jdbc-driver" => "sqlserver2008") ]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.microsoft]"
Any help anyone could provide would be amazing, as I've been stuck on this problem for 2 days now...