Thanks Julie for the input. But my problem is still not solved. I am giving
the code that I have written. My EJB is deployed as test/InvntoryRemote and
has InvntoryHome.java as home interface, InvntoryRemote.java as Remote
interface and Invntory.java as the bean implementation. The package
containing this bean is "App"
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html">
<title>Category Description </title>
</head>
<%@ page language="java" %>
<%@ page import="java.sql.*, javax.servlet.*, java.util.*, App.*,
App.InvntoryHome,App.Invntory,
oracle.aurora.jndi.sess_iiop.*, oracle.aurora.jndi.sess_iiop.ServiceCtx,
javax.naming.*, javax.naming.spi.InitialContextFactory" %>
<%
String l_connectionInfo = "sess_iiop://oracleserver:2481";
String l_userName = "dealer";
String l_password = "dealer";
String l_ejbUrl = l_connectionInfo +"/test/InvntoryRemote";
Hashtable environment = new Hashtable();
environment.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
environment.put(Context.SECURITY_PRINCIPAL, l_userName);
environment.put(Context.SECURITY_CREDENTIALS, l_password);
environment.put(Context.SECURITY_AUTHENTICATION,
ServiceCtx.NON_SSL_LOGIN);
try {
System.out.println("Creating an initial context");
Context ic = new InitialContext(environment);
System.out.println("Looking for the EJB published as
'test/InvntoryRemote'");
InvntoryHome homeInterface = (InvntoryHome)ic.lookup(l_ejbUrl);
System.out.println("Creating a new EJB instance");
BudInventoryRemote m_remoteEJBInterface = homeInterface.create();
System.out.println("Done");
}
catch (ActivationException e) {
System.out.println("Unable to activate : " + e.getMessage());
e.printStackTrace();
System.exit(1);
}
catch (CommunicationException e) {
System.out.println("Unable to connect: " + l_ejbUrl);
e.printStackTrace();
System.exit(1);
}
catch (NamingException e) {
System.out.println("Exception occurred!");
System.out.println("Cause: This may be an unknown URL, or some" +
" classes required by the EJB are missing from your classpath.");
System.out.println("Suggestion: Check the components of the URL," +
" and make sure your project includes a library containing the" +
" EJB .jar files generated by the deployment utility.");
e.printStackTrace();
System.exit(1);
}
catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
%>
</body>
</html>
The error that I am getting is while it executes lookup method and the error
is:
javax.naming.NotContextException: oracleserver:2481/test/InvntoryRemote
Please suggest!!!
Regards
Nidhi
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets