[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re:

alskor do-not-reply at jboss.com
Wed Jun 3 19:34:26 EDT 2009


interesting:
I added this code right in front the InitialContext creation:

      // new code
  |         String className = "org.jnp.interfaces.NamingContextFactory";
  |     	System.out.println("trying to load class: " + className);
  |     	Class c = Class.forName(className);
  |     	
  |     	System.out.println("loaded class: " + c + " methods: " + c.getMethods().length);
  |        
  |       // old code
  |       InitialContext ctx = new InitialContext();
  | 

the output is: 
[STDOUT] trying to load class: org.jnp.interfaces.NamingContextFactory
  | [STDOUT] loaded class: class org.jnp.interfaces.NamingContextFactory methods: 11

so, apparently NamingContextFactory class IS loaded and visible to the current class loader. then why in the world isn't it visible one line below, when I try "new InitialContext()" ??

javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Roo
  | t exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
  |         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
  |         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
  |         at javax.naming.InitialContext.init(InitialContext.java:223)
  |         at javax.naming.InitialContext.<init>(InitialContext.java:175)
  |         at com.starview.dm.collectionmgt.StarcoreRootNode.<init>(StarcoreRootNode.java:54)

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4235130#4235130

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4235130



More information about the jboss-user mailing list