X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 Feb 2016 12:28 PM by  anon
Exception thrown when accessing MySQL database via Java-IDL bridge on 64-bit
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



Basic Member


Posts:143
Basic Member


--
26 Feb 2016 12:28 PM
    A customer has sent the following question: IDL> oIdlJava = OBJ_NEW("IDLjavaObject$DBUtilsPkg.ConnectToMysql","DBUtilsPkg.ConnectToMysql") The error messages are: % Exception thrown % Execution halted at: $MAIN$ The log file printed: IDL-Java Bridge : Nov 15 2013 11:58:08 Log Location : L:/SysTemp/IDL_Java_Bridge_LOG/ Bridge Logging : CONFIGFINE Config file : C:\Program Files\Exelis\IDL83\resource\bridges\import\java\idljavabrc Exit Strategy : Restart Bridge : FALSE EXCEPTION cJBExceptJavaException : NewObjectA ERR But the same IDL command worked correctly on the 32-bit IDL (v8.3). The necessary jar files have been put in the system environment variable CLASSPATH ....\UVBJava7Pkg.jar The class ConnectToMysql in package DBUtilsPkg resides in the UVBJava7Pkg.jar file. The jar file "Jmysql-connector-java-5.1.38-bin.jar" is the MySQL Java connector. We also found that on 64-bit IDL, at least some Java classes without database functions worked correctly. We configured the file "C:\Program Files\Exelis\IDL83\resource\bridges\import\java\idljavabrc" according to the IDL version: For 32-bit, we set "JVM LibLocation = C:\Program Files\Exelis\IDL83\bin\bin.x86\jre\bin\client\" For 64-bit, we set "JVM LibLocation = C:\Program Files\Exelis\IDL83\bin\bin.x86_64\jre\bin\server\" We have tried to include and exclude the ending '\', same results. My questions are: Why does IDL-Java bridge work fine on 32-bit but not on 64-bit when connecting to MySQL? How to fix it on 64-bit IDL?

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    26 Feb 2016 02:58 PM
    Are you able to use the ConnectToMysql package work from the 64-bit JVM(outside of IDL) to be successfully connect to MySQL database? If you are not able to do this, there might be some incompatibilitybetween the package, 64-bit Java and the database that may need to beresolved before it will work with 64-bit IDL. Another possibility is that the 64-bit version of IDL might be using a differentversion of Java than the 32-bit version of IDL. You can see if this is the caseby entering the following commands: IDL> .compile -v 'C:\Program Files\Exelis\IDL85\resource\bridges\import\java\examples\javaprops.pro' IDL> javaprops

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 Feb 2016 10:42 AM
    Are you able to use the ConnectToMysql package work from the 64-bit JVM(outside of IDL) to be successfully connect to MySQL database? Yes. We compile the the package with JDK 7 and JDK 8. As long as we point to the right JVM, the package works correctly. Under the 64-bit IDL, we ran the following codes as you suggested: IDL> .compile -v 'C:\Program Files\Exelis\IDL83\resource\bridges\import\java\examples\javaprops.pro' IDL> javaprops The results for 64-bit were: (JVM LibLocation = C:\Program Files\Exelis\IDL83\bin\bin.x86_64\jre\bin\server) java.version: 1.7.0_25 java.vendor: Oracle Corporation java.class.path: C:\Program Files\Exelis\IDL83\bin\bin.x86_64\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar java home: C:\Program Files\Exelis\IDL83\bin\bin.x86_64\jre java.vm.name: Java HotSpot(TM) 64-Bit Server VM java.vm.version: 23.25-b01 java.vm.vendor: Oracle Corporation The result for 32-bit were: (JVM LibLocation = C:\Program Files\Exelis\IDL83\bin\bin.x86\jre\bin\client) java.version: 1.7.0_25 java.vendor: Oracle Corporation java.class.path: C:\Program Files\Exelis\IDL83\resource\bridges\import\java\idljavab.jar;C:\Program Files\Exelis\IDL83\resource\bridges\import\java;G:\xxxxxxxx\mysql-connector-java-5.1.38-bin.jar;G:\xxxxxxxx \UVBJava7Pkg.jar;C:\Program Files\Exelis\IDL83\resource\bridges\import\java\jbexamples.jar java home: C:\Program Files\Exelis\IDL83\bin\bin.x86\jre java.vm.name: Java HotSpot(TM) Client VM java.vm.version: 23.25-b01 java.vm.vendor: Oracle Corporation Why did IDL 64-bit IDL-Java bridge report the java.class.path different from the 32-bit? Those jar files have been put in the system environment variable "CLASSPATH". Thanks.

    Deleted User



    Basic Member


    Posts:143
    Basic Member


    --
    01 Mar 2016 11:14 AM
    I think that the difference you are encountering is occuring because with the 32-bit version of the IDL workbench, IDL and the workbench are seperate processes. However, with the 64-bit version of IDL, the workbench and IDL are the same process. Thus, the 64-bit IDL uses same Java used for the workbench. Could you try launching IDL with the "-outofprocess" switch and seeing if that helps with the problem? To do this, you can open a command prompt and enter the following command: "C:\Program Files\Exelis\IDL83\bin\bin.x86_64\idlde.exe" -outofprocess

    Deleted User



    New Member


    Posts:
    New Member


    --
    01 Mar 2016 11:34 AM
    The -outofprocess works. Thanks. I suggest that IDL manual mentions this flag when introducing the IDL-Java bridge in the future versions.
    You are not authorized to post a reply.