comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem with Java-IDL bridge with custom Java object
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Problem with Java-IDL bridge with custom Java object [message #75857] Mon, 25 April 2011 11:32
Matt[4] is currently offline  Matt[4]
Messages: 3
Registered: April 2011
Junior Member
Being neither an IDL nor a Java expert, I'm having trouble getting the
the Java-IDL bridge working. For a simple test case of getting a Java
object from IDL, I've tried creating a simple Java object:
public class MyCl {
String stringMember;

public MyCl() {
stringMember = new String("String member");
}

public String toString() {
return stringMember;
}
}


This has been tested with another Java class and found to be working.
I've created an IDL program to test this Java class via the Java-IDL
bridge:

pro bridge_test
print, "In bridge_test"
java_str_obj = obj_new("IDLJavaObject$java.lang.String",
"java.lang.String", "a string")
if (obj_class(java_str_obj) ne "IDLJAVAOBJECT
$JAVA.LANG.STRING") then begin
print, "Error creating Java String object"
endif else begin
print, "Java String object created (I think)"
the_string = java_str_obj -> toString()
print, "the_string = '", the_string, "'"
endelse

print, ""
print, "Trying custom object ..."
print, ""

java_test_obj = obj_new("IDLJavaObject$MyCl", "MyCl")
print, "After getting new object"
end

When run, the first part (creating a String) works as expected (it
prints the progress messages, ending with "the_string = 'a string'").
However, when it gets to the second part, I'm getting a lengthy
exception after the "Trying custom object" message is printed:

% ERR -ReflObject::doesClassExist LinkageError:Bad version number
in .class file
% java.lang.UnsupportedClassVersionError: Bad version number in .class
file
% at java.lang.ClassLoader.defineClass1(Native Method)
% at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
% at
java.security.SecureClassLoader.defineClass(SecureClassLoade r.java:
124)
% at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
% at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
% at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
% at java.security.AccessController.doPrivileged(Native Method)
% at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
% at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
% at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268 )
% at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
% at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319 )
% at java.lang.Class.forName0(Native Method)
% at java.lang.Class.forName(Class.java:164)
% at com.rsi.javab.ReflObject.doesClassExist(ReflObject.java:601)
% Class MyCl not found
% Execution halted at: BRIDGE_TEST 18 /home/melliott/Src/
JavaIDL/nopackage/bridge_test.pro
% $MAIN$

I've tried several things, including pointing the CLASSPATH
environment variable straight at the directory which contains the
MyCl.class file, many manipulations of the .idljavabrc file, and
putting putting MyCl into a jar which is then put into the .idljavabrc
file. Unfortunately, nothing has worked.

This is on an Ubuntu 10.10 Linux system with Java 1.6 and IDL 7.1.

Any help would be greatly appreciated!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: pasting text in widgets under Mac OS X
Next Topic: IDL 8 legend manipulating the symbols HELP!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:49:41 PDT 2025

Total time taken to generate the page: 0.00445 seconds