3 Replies Latest reply on Dec 19, 2012 9:40 AM by m.ardito

    troubles deploying jtds driver on as7...

    m.ardito

      Hi,

      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)

        • 1. Re: troubles deploying jtds driver on as7...
          rareddy

          Marco,

           

          Here is another related issue http://stackoverflow.com/questions/13403471/unsupported-version-error-using-jtds-with-scala

           

          It all points to the Java version you have it running AS7. Note that java version that you have above may not be java version that AS7 is started with. To validate which version of the java that your AS7 started with, look at the boot up log messages. Another alternative is going back to jtds 1.2 version as the above link suggests.

           

          Ramesh..

          • 2. Re: troubles deploying jtds driver on as7...
            shawkins

            The ClassNotFoundException is a secondary issue to the UnsupportedClassVersionError. The jar manifest confirms that it was compiled under 1.7, so that error is saying that your AS vm is likely 1.6 and not 1.7.  You should not look to modify the classpath in a differnent way.

             

            So you need to look into what vm is running AS, which should be clear in the boot.log or you can just use the 1.2.7 jtds jar which should be valid on JRE 1.5+.

             

            Steve

            1 of 1 people found this helpful
            • 3. Re: troubles deploying jtds driver on as7...
              m.ardito

              yep! Thank you!! both answers (and fast!) are right and pointed me in the right direction...

               

              what a newbie

               

              the java_home used by the standalone.xml was pointing to a jdk1.6.0_21...

              now it's jre7

               

              i just created a jtds datasource and connected succesfully to MS SQL server 2005

               

              Now, i'll dig into dynamic VDB and user permission on it...

               

              Thanks again,

              Marco