Tuesday, September 16, 2014

ADF - ClassNotFoundException: oracle.jbo.jbotester.jdevx.ConnectionDialog

Recently, I got a brand new MacBook Pro with OS X 10.9.4 (Mavericks). I installed Java Platform (JDK) 8u20 and JDeveloper 12c (12.1.3.0.0). Both are the latest versions from Oracle.

Unfortunately, when I tried to test my application modules with ADF Model Tester, I got the exception with the following stack trace:

oracle.jbo.jbotester.app.ErrorHandler$ExceptionWrapper: JBO-29000: Unexpected exception caught: java.lang.ClassNotFoundException, msg=oracle.jbo.jbotester.jdevx.ConnectionDialog
at oracle.jbo.jbotester.app.ErrorHandler.displayError(ErrorHandler.java:104)
at oracle.jbo.jbotester.app.ErrorHandler.displayError(ErrorHandler.java:90)
at oracle.jbo.jbotester.app.IErrorHandlerImpl.displayError(IErrorHandlerImpl.java:43)
at oracle.jbo.jbotester.MainFrame.launchConnectDialog(MainFrame.java:409)
at oracle.jbo.jbotester.MainFrame.init(MainFrame.java:577)
at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:538)
Caused by: java.lang.ClassNotFoundException: oracle.jbo.jbotester.jdevx.ConnectionDialog
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at oracle.jbo.jbotester.MainFrame.launchConnectDialog(MainFrame.java:407)
... 2 more

After a lot of googling that did no help, I decided to switch JDK from version 1.8 back to version 1.7 to try my luck. It worked! Here's how to do that.

I installed another JDK, which is Java SE 7u67, the latest 1.7 version at the time of this post. After the installation, I have two JDK versions as the following:

$ /usr/libexec/java_home -V
Matching Java Virtual Machines (2):
    1.8.0_20, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home
    1.7.0_67, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home

In Mavericks, it's not easy to switch between multiple versions of JDK. I didn't want to touch the existing JDK 1.8 default to the OS. So, I changed the JDK location for JDeveloper 12c as described at "3.1.1.3 Changing the JDK Location in Linux, UNIX, and Mac OS X" (http://docs.oracle.com/middleware/1213/jdev/install/post_install.htm#CHDFHDCD):

In product.conf, add the following line:

SetJavaHome /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home

Restart JDeveloper, run the ADF Model Tester against the application module,  the problem is simply gone.

1 comment: