troubles deploying jtds driver on as7...
m.ardito Dec 19, 2012 7:42 AMHi,
i'm revamping my teiid interest with the new 8.2. i run as7 standalone on win7, installed teiid with teiid console (running with "standalone.bat -c standalone.-teiid.xml")
now i'm learning how to deploy jdbc drivers i need.
at first i deployed mysql driver, too easy! put the file in standalone/deployments, a few moments after, a .deployed file appears, and i'm able to create a datasource from the web console, the driver appears in the list, connection test is ok.
i did pretty much the same with postgresql jdbc driver. i nboth cases i can find on the web admin console, under
profile > JNDI View > JNDI Bindings > selected URIs > Applications
along all the default teiid-connector-xxxx entries, also the mysql and postgresql entries, with appName (filled) and env (empty) fields
now the driver i really need is jtds, as i have to use MSSQL server as a datasource, and here i have troubles...
i downloaded it from http://jtds.sourceforge.net/ and it's named "jtds-1.3.0.jar"
where is stated:
- jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver
- Being a type 4 driver, jTDS does not need any special installation. Just drop the jar file into your application's classpath and you're done. All you need to know is the name of the Driver
and DataSource
implementations and the URL format and you're all set.
and the jar has a META-INF\services\java.sql.Driver inside, which content is, simply the string "net.sourceforge.jtds.jdbc.Driver"
for what i read here https://docs.jboss.org/author/display/AS71/DataSource+configuration, it should be OK.
if i put this .jar in standalone/deployments, a few moments after, a .deployed file appears, BUT
- the server log shows some exceptions (WARN) like
12:20:13,190 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "jtds-1.3.0.jar" 12:20:13,237 WARN [org.jboss.modules] (MSC service thread 1-1) Failed to define class net.sourceforge.jtds.jdbc.Driver in Module "deployment.jtds-1.3.0.jar:main" from Service Module Loader: java.lang.UnsupportedClassVersionError: net/sourceforge/jtds/jdbc/Driver : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_21] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632) [rt.jar:1.6.0_21] at java.lang.ClassLoader.defineClass(ClassLoader.java:616) [rt.jar:1.6.0_21] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [rt.jar:1.6.0_21] at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.Module.loadModuleClass(Module.java:517) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA] at org.jboss.as.connector.deployers.processors.DriverProcessor.deploy(DriverProcessor.java:63) at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21] at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21] 12:20:13,267 WARN [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) JBAS010402: Unable to instantiate driver class "net.sourceforge.jtds.jdbc.Driver": java.lang.ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver from [Module "deployment.jtds-1.3.0.jar:main" from Service Module Loader] 12:20:13,377 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "jtds-1.3.0.jar"
- though, i can find under
profile > JNDI View > JNDI Bindings > selected URIs > Applications
the "jtds-1.3.0.jar" application
- but i can't find it in the driver list while creating a datasurce fro mthe web admin console...
i looked on http://jtds.sourceforge.net/faq.html#classNotFound since i see a ClassNotFoundException in the last WARN
and it says "
Why do I get a ClassNotFoundError
when calling Class.forName("net.sourceforge.jtds.jdbc.Driver")
?
ClassNotFoundError
is thrown by the classloader when it can not find a certain class. In this case it's the net.sourceforge.jtds.jdbc.Driver
class, which means that jtds.jar
is not in the classpath. If you are getting this in an application, start your application with
java -cp <path_to_jtds>/jtds.jar <main_class>
If you experience this problem in a servlet/JSP you will have to add jtds.jar
to your web application's class path (e.g. by editing the application's web.xml file or by copying the jar into the application's/server's /lib
directory).
Note: The name of the jTDS jar file may be jtds-1.2.jar
or something similar. If that's the case, replace jtds.jar
in the above example with jtds-1.2.jar
or whatever your specific file name is.""
here, i'm stuck... i tried to add to the CLASSPATH system variable the full path to the jar, but it does not work...
i've just read this
http://stackoverflow.com/questions/10382929/unsupported-major-minor-version-51-0
and i suspect this could be the issue... on my win7 i have
C:\Users\ardito>java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) Client VM (build 23.5-b02, mixed mode, sharing)
what should i do?
I really need your help, community, i NEED teiid to be up, reliable and fast, soon... :-D
Thanks, Marco
Edited by marco ardito (suspect jre version issue)