java.lang.NoClassDefFoundError: org/omg/CORBA/InterfaceDef

sakthisundar picture sakthisundar · Nov 22, 2012 · Viewed 9.3k times · Source

I am seeing java.lang.NoClassDefFoundError: org/omg/CORBA/InterfaceDef when I am calling the method getMethod of the java.lang.Class. I am trying to get the getEmsSession method in EmsSeeionFactory_I of TMF specific jars using reflection. But when I checked for the class in the jacorb.jar, org/omg/CORBA/InterfaceDef.class is available on the class path. I have seen in other forums and I am seeing no answer for the same question in those forums as well. It looks like this exception being thrown from native VM code. I am left with no clue now. Any Ideas ? Complete stack trace is as below

java.lang.NoClassDefFoundError: org/omg/CORBA/InterfaceDef
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getMethod0(Class.java:2670)
        at java.lang.Class.getMethod0(Class.java:2688)
        at java.lang.Class.getMethod(Class.java:1603)

Answer

mki picture mki · Apr 19, 2013

NoClassDefFoundError means that the class was found during compile time but NOT found during runtime. Most of the time you have a difference between the classpath your runtime environnement and the classpath of your compile environnement. And it will work after you find the difference and fix it.

If you have checked and you are 100% sure that the classpath are the same, then the error is more tricky and you can read this tutorial to solve the problem : http://javarevisited.blogspot.be/2011/06/noclassdeffounderror-exception-in.html