[jboss-user] [JNDI/Naming/Network] - HELP: Looking up to java:comp namespace problem!!

fla83tn do-not-reply at jboss.com
Wed Jul 26 19:18:57 EDT 2006

Hi to all!
I hope someone can help me!
I've read a lot of threads similar to mine, but none solved my question..

In my project, as specified by socumentation, only Global JNDI Namespaces are visible from remote client., whereas java: are not.
But now, I would try to access from my Message-driven bean to the Java Mail Service of JBoss, located ad java:/Mail. 

>From what I read I must istantiate a new void Initial context and lookup to java:comp/env/mail/Mail, but if I do so it seems that no-lookup can be done!!
In fact this is the error output, that is given when i lookup also to "":

  | javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
  | 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
  | 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) .....
  | .....


So, I turn around the problem binding the javaMail service to Mail (I moved its name to the global JNDI namespace). 
If I do so now I can lookup the resource, but now I get an error when I try to bound it because i do 

  | session = (javax.mail.Session)PortableRemoteObject.narrow(
  |               c.lookup("Mail"), javax.mail.Session.class);

and the system give me the sequent error:

  | Exception in thread "main" java.lang.ClassCastException...........
  | .......
  | Caused by: java.lang.ClassCastException: Class javax.mail.Session is not a valid remote interface
  | 	at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:225)
  | 	... 3 more

I think that even if I solve the first problem remains out the second...Does anybody know hot to get it out?

Please someone help me!!

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

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

More information about the jboss-user mailing list