Hello,
I use the JBoss 3.0.2 and i have a servlet with this source code:
public void sendMail(String address) throws java.rmi.RemoteException {
Session session = null;
InitialContext init;
System.out.println(" Je suis la");
try {
init=new InitialContext();
System.out.println("essai object1");
init.lookup("java:/Mail");
System.out.println("essai object2");
session = (Session)PortableRemoteObject.narrow(init, Session.class);
} catch (javax.naming.NamingException e) {
System.out.println("probleme 1er try");
e.printStackTrace();
}
System.out.println("1er try passed");
When it is call i have an error:
16:43:19,576 INFO [STDOUT] Je suis la
16:43:19,591 INFO [STDOUT] essai object1
16:43:19,591 INFO [STDOUT] probleme 1er try
16:43:19,591 ERROR [STDERR] javax.naming.NameNotFoundException: Mail not bound
16:43:19,591 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
Server.java:495)
16:43:19,591 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(Naming
Server.java:503)
16:43:19,591 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingS
erver.java:509)
16:43:19,591 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServ
er.java:282)
16:43:19,591 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
gContext.java:456)
16:43:19,591 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(Namin
gContext.java:440)
16:43:19,591 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialCon
text.java:347)
16:43:19,591 ERROR [STDERR] at MailUserBean.sendMail(MailUserBean.java:211)
Please, tell me where could be the problem........