• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

 
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 ]
 
Ranch Hand
Posts: 2713
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!