-
2. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
asfhy Nov 15, 2011 11:19 AM (in response to wdfink)Well, I could try, but JdbcOdbcDriver it's a class that comes included on the JDK for windows (It's inside the "rt.jar", along with every other common java class). I can't put all the rt.jar as module, as it would be a module loading almost every java class. You must be aware that in rt.jar came all the "java.lang" (Including String, Long, Exception, etc) and a lot of other packages that comes with the default java instalation. I don't tryed it because I thought it woul be problematic to load all the java resources twice.
I searched on the net, but the pure java JDBC drivers existing for MS Acces are all commecial, and my boss is not going to pay for nothing, so I can't use any of it as module. I need to use the original "sun.jdbc.odbc.JdbcOdbcDriver" included freely on the Sun Java Virtual Machine (Now Oracle Java Virtual Machine).
-
3. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
gtexcalibur Apr 10, 2012 2:56 PM (in response to asfhy)I was able to work around this by altering the standalone.conf.bat with the following line:
rem # Make Byteman classes visible in all module loaders
rem # This is necessary to inject Byteman rules into AS7 deployments
rem # This allows for the JdbcOdbcDriver to be seen by the classloader
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,sun.jdbc"
Not sure if this is the official solution, but I hope that it gets the ball rolling towards one.
-
4. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
guinotphil Apr 12, 2012 9:47 AM (in response to gtexcalibur)I haven't checked if this is actually working, but have you considered adding a module defined like this ?
<module xmlns="urn:jboss:module:1.1" name="com.sun.jdbc.odbc">
<dependencies>
<system export="true">
<paths>
<path name="sun/jdbc/odbc"/>
<path name="sun/jdbc/odbc/ee"/>
</paths>
</system>
</dependencies>
</module>
-
5. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
gtexcalibur Apr 12, 2012 12:14 PM (in response to guinotphil)I just tried that and it didn't work.
-
6. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
jaikiran Apr 13, 2012 2:14 AM (in response to gtexcalibur)George, welcome to the forums!
If you could post more details including your application packaging and the complete exception stacktrace then maybe we could help you with a proper way to fix this.
-
7. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
gtexcalibur Apr 13, 2012 10:30 AM (in response to jaikiran)Sure, my situation is nearly identical to the original post. I am trying to port an ear deployment from JBoss 5.1.0.GA to 7.1.1.Final, running on Windows 7 x64 on JDK 1.7.0_03x86. In my ear, I have a MBean setup to connect to an access database that is on the local disk. Here is the exception that I recieve:
java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver from [Module "deployment.***.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at ***.beginInitialization(***.java:297)
That line of code is:
Class.forName(mConnInfo.getDriver()).newInstance();
This code is located in a fairly common piece of our multiple deployments, so I would like to avoid any changes to code. I believe that this should be able to be accomplished via configuration.
As stated before, I am currently able to work around the issue by adding "sun.jdbc" to the "jboss.modules.system.pkgs" property in the standalone.conf.bat, which allows for the JBoss "system" classloader to find the appropriate classfile in the JDK. Unfortunately, the more desirable solution of create a new module (as also posted above) didn't work.
-
8. Re: sun.jdbc.odbc.JdbcOdbcDriver - ClassNotFoundException
guinotphil Apr 13, 2012 1:16 PM (in response to gtexcalibur)After creating the module, have you considered adding it to the jboss-deployment-structure.xml ? I forgot to mention this detail.