This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classformat error while trying to access ORB.init

 
Shriram Gopalakrishnan
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this.serverVO = serverVO;
String arg[] = { "-ORBInitialHost", serverVO.getServerIP(),
"-ORBInitialPort", String.valueOf(serverVO.getServerPort()),
"-ORBGIOPVersion", "1.1" };
orb = ORB.init(arg, null);
System.out.println("Initialization Device handle using IOR:"+serverVO.getDcmIOR());
obj = orb.string_to_object(serverVO.getDcmIOR().trim());
deviceControlImpl = DeviceControlHelper.narrow(obj);
System.out.println(className+":CORBAService:"+"DeviceControl handle initialized successfully......");



Getting below exception while trying to access ORB.init as bolded above. LINUX platform

Exception in thread "main" java.lang.ClassFormatError: java.lang.AbstractStringBuilder (erroneous method access flags)
at _Jv_ClassReader.throw_class_format_error(byte) (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.handleMethod(int, int, int, int) (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.read_methods() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.parse() (/usr/lib/libgcj.so.5.0.0)
at _Jv_DefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0)
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.handleClassBegin(int, int, int) (/usr/lib/libgcj.so.5.0.0)
at _Jv_ClassReader.parse() (/usr/lib/libgcj.so.5.0.0)
at _Jv_DefineClass(java.lang.Class, byte[], int, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.defineClass(java.lang.ClassLoader, java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.ProtectionDomain) (/usr/lib/libgcj.so.5.0.0)
at java.security.SecureClassLoader.defineClass(java.lang.String, byte[], int, int, java.security.CodeSource) (/usr/lib/libgcj.so.5.0.0)
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at _Jv_WaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
at com.cisco.test.CorbaClient.CorbaClient(com.cisco.test.ServerVO) (Unknown Source)
at com.cisco.test.CorbaClient.main(java.lang.String[]) (Unknown Source)



 
Shriram Gopalakrishnan
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the solution for this. The problem was I was compiling it in JDK 1.6 but running it in JRE1.4. This happenned because in linux by default "java" command was pointing to jdk1.4 path.

I figured out that by typing in "java -version" which gave 1.4 version and then executed java by prefixing path which in my case happens to be /usr/jdk1.6_014/bin/java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic