strange situation
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Csaba_Pari
Posted On:   Monday, November 21, 2005 12:07 PM

Hello I have the following source code: ... public static final String ORB_CLASS = "org.jacorb.orb.ORB"; public static final String ORB_SINGLETON_CLASS = "org.jacorb.orb.ORBSingleton"; ... //Orb init Properties mProps = new Properties(); mProps.put("org.omg.CORBA.ORBClass", ORB_CLASS); mProps.put("org.omg.CORBA.ORBSingletonClass", ORB_SINGLETON_CLASS); // just testing start System.out.println("test start"): System.out.println("Classpath: " + System.getProperty("java.class.path")); Class a = Class.forName("   More>>

Hello



I have the following source code:

...



public static final String ORB_CLASS = "org.jacorb.orb.ORB";

public static final String ORB_SINGLETON_CLASS = "org.jacorb.orb.ORBSingleton";

...

//Orb init

Properties mProps = new Properties();

mProps.put("org.omg.CORBA.ORBClass", ORB_CLASS);

mProps.put("org.omg.CORBA.ORBSingletonClass", ORB_SINGLETON_CLASS);

// just testing start

System.out.println("test start"):

System.out.println("Classpath: " + System.getProperty("java.class.path"));

Class a = Class.forName("org.apache.avalon.framework.configuration.Configurable");

System.out.println("Class loaded");

ClassLoader cl = Thread.currentThread().getContextClassLoader();

if (cl != null)

System.out.println("Classloader : " + cl.getClass().getName());

else

System.out.println("class was null");

System.out.println("System classloader : " + ClassLoader.getSystemClassLoader().getClass().getName());


if ( cl == ClassLoader.getSystemClassLoader() ) {

System.out.println("Equals");

} else {

System.out.println("Not equals");

}

System.out.println("test start"):

// just testing end

ORB orb = ORB.init((String[]) null, mProps);

System.out.println( "Orb initialized.");

...


And I get the following exception from the ORB.init method:

test start

Class loaded

Classloader : sun.misc.Launcher$AppClassLoader

System classloader : sun.misc.Launcher$AppClassLoader

Equals

test end

Cannot register CORBA service. >> EXCEPTION >>
test.jacorb.MyException

- Reason = Error by Corba initialization

- Place = CorbaUtils.initialize()

- Type of original exception: org.omg.CORBA.INITIALIZE

- Reason of original exception: can't instantiate default ORB implementation org.jacorb.orb.ORB

- Cause of the original exception: java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/Configurable



As you can see I can load the org/apache/avalon/framework/configuration/Configurable interface before I get exception. This interface is found in the following jar: avalon-framework-4.1.5.jar
My question is why I get that java.lang.NoClassDefFoundError, because the jars are on the right place: avalon-framework-4.1.5.jar, jacorb.jar...



Thanks for your help in advance!

   <<Less

Re: strange situation

Posted By:   Anonymous  
Posted On:   Monday, November 21, 2005 09:50 PM

It seems that it can't load the ORBSingleton class, so it seems that the jacorb jar isn't in your classpath somehow.

But definitely sign up for Jacorb's e-mail list, it's very good.
About | Sitemap | Contact