• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in calling ejb from jsp in weblogic6.1  RSS feed

 
Anima Agrawal
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i have tried to call ejb from jsp page in weblogic6.1. I habe placed my jsp page in defaultwebapp dir of examples. I have also set the class path to the jar as
set classpath=%classpath%;d:\bea\wlserver6.1\config\examples\applications\testconverter.jar
when i see the jndi listing i ma able to see my EJB deployed. When i try to create the object and access the bean i get the following error
:\bea\wlserver6.1\config\examples\applications\DefaultWebApp\WEB-INF\_tmp_war_DefaultWebApp\jsp_servlet\__converter.java:99: cannot resolve symbol
probably occurred due to an error in /Converter.jsp line 16:
ConverterHome home=(ConverterHome)PortableRemoteObject.narrow(ref,ConverterHome.class);
D:\bea\wlserver6.1\config\examples\applications\DefaultWebApp\WEB-INF\_tmp_war_DefaultWebApp\jsp_servlet\__converter.java:99: cannot resolve symbol
probably occurred due to an error in /Converter.jsp line 16:
ConverterHome home=(ConverterHome)PortableRemoteObject.narrow(ref,ConverterHome.class);
D:\bea\wlserver6.1\config\examples\applications\DefaultWebApp\WEB-INF\_tmp_war_DefaultWebApp\jsp_servlet\__converter.java:99: cannot resolve symbol
probably occurred due to an error in /Converter.jsp line 16:
ConverterHome home=(ConverterHome)PortableRemoteObject.narrow(ref,ConverterHome.class);
D:\bea\wlserver6.\config\examples\applications\DefaultWebApp\WEB-INF\_tmp_war_DefaultWebApp\jsp_servlet\__converter.java:102: cannot resolve symbol
probably occurred due to an error in /Converter.jsp line 19:
Converter cc=home.create();
my jsp code is
<%@ page import="javax.naming.*,javax.rmi.PortableRemoteObject,java.rmi.RemoteException" %>
<html>
<head>
Converter
</head>
<body>
<%
try
{
String url="http://localhost:7001/";
Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, url);
Context jndicontext= new InitialContext(h);
Object ref=jndicontext.lookup("Converter");
ConverterHome home=(ConverterHome)PortableRemoteObject.narrow(ref,ConverterHome.class);
out.println("creating converter");

Converter cc=home.create();
double amount=cc.dollartoYen(10);
out.println("Yen::"+amount);

amount=cc.yentoEuro(10);
out.println("Euro::"+amount);
}
catch(Exception ex)
{
out.println("error in accessing");
}
%>
</body>
</html>
i cannot understand why it cannot resolve the converter class symbol
anybody plz help

regards
Anima
[ September 20, 2002: Message edited by: Anima Agrawal ]
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What package is your EJB in? If it is not in the default package then you are not importing it in your JSP.
If it is in the default package then you should know that JSP has problems with accessing classes in the default package. Put your EJB in a named package, redeploy it, add the package to your JSP's imports, and try again.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!