Can you print out what the exception is?
-----Original Message-----
From: Rick Mangi [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 11, 2002 12:38 PM
To: Cabrera, Alan
Cc: David Blevins; openejb-user
Subject: Re: [OpenEJB-user] Re: OpenEJB W/ Tomcat
Some progress...
I abandoned the loader jar and copied all of the jars from openejb/lib
and dist to common/lib. I also had to put the ejb-1.0 and 2.0 jars in my
WEB-INF/lib (not sure why...)
Now I'm using this .jsp:
<%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="zcm" %>
<%@ page import="javax.naming.InitialContext" %>
<%@ page import="com.zcm.intranet.ejb.test.*" %>
<%@ page import="java.util.Properties" %>
<%@ page import="javax.naming.Context" %>
<%@ page import="javax.rmi.PortableRemoteObject" %>
<%
String message = "nah";
try{
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.openejb.core.ivm.naming.InitContextFactory");
p.put("openejb.home", "/usr/local/openejb");
p.put("openejb.configuration",
"/usr/local/openejb/conf/openejb.conf");
InitialContext ctx = new InitialContext(p);
out.print("<P>got ctx...");
Object obj = ctx.lookup("/ZCMHello");
out.print("did lookup..."+obj);
HelloHome ejbHome = (HelloHome)obj;
out.print("have home");
HelloObject ejbObject = ejbHome.create();
//The part we've all been wainting for...
message = ejbObject.sayHello();
} catch (Exception e){
e.printStackTrace();
}
%>
<P><%= message %>
and I get this in mozilla:
got ctx...did
lookup...proxy=com.zcm.intranet.ejb.test.HelloHome;deployment=ZCMHello;pk=nu
ll
nah
It's definitely finding something, but I get a classcast exception in
tomcat's log file:
java.lang.ClassCastException
at org.apache.jsp.test$jsp._jspService(test$jsp.java:102)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:683)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:431)
at
org.apache.catalina.core.ApplicationDispatcher.access$0(ApplicationDispatche
r.java:359)
at
org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(Applica
tionDispatcher.java:130)
Rick Mangi wrote:
> Sure.
>
> Both CATALINA and JAVA_OPTS are available in 4.0.3, not sure what the
> difference is. Here's the file. I'll try settting CATALINA_OPTS.
>
>
>
>
>
> Cabrera, Alan wrote:
>
>> For Tomcat 4.03, the environmental variable should be CATALINA_OPTS.
>> David's jar, openejb_loader-0.8.3.jar, will load all the jars that
>> Tomcat
>> needs. Since the class that the JNDI lookup is looking for and not
>> finding
>> is one of the OpenEJB classes, I'm assuming that the your setup for this
>> loader is incorrect. Can you send a copy of your catalina.sh file?
>>
>>
>> Thanks,
>> Alan
>>
>> -----Original Message-----
>> From: Rick Mangi [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, October 11, 2002 11:07 AM
>> To: Cabrera, Alan
>> Cc: David Blevins; openejb-user
>> Subject: Re: [OpenEJB-user] Re: OpenEJB W/ Tomcat
>>
>>
>> Cabrera, Alan wrote:
>>
>>
>>
>>> Can you list all the steps that you took?
>>>
>>
>>
>> Ok.
>>
>> In both tomcat 4.03 and 4.1.12 (redhat linux 7.4, jdk 1.4.1).
>>
>> openejb (latest) is installed in /usr/local/openejb-0.8.3
>>
>> Put David's openejb_loader in $CATALINA_HOME/common/lib
>> in catalina.sh JAVA_OPTS="-Dopenejb.home=/usr/local/openejb-0.8.3"
>>
>> My jar is deployed (and I can get it from the command line using a
>> standalone client app).
>>
>> my Hello. jar file is also in WEB-INF/lib in my tomcat app.
>>
>> Start tomcat and run this JSP:
>>
>> <%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="zcm" %>
>> <%@ page import="javax.naming.InitialContext" %>
>> <%@ page import="com.zcm.intranet.ejb.test.*" %>
>> <%@ page import="java.util.Properties" %>
>> <%@ page import="javax.naming.Context" %>
>> <%@ page import="javax.rmi.PortableRemoteObject" %>
>> <%
>> String message = "nah";
>> try{
>> Properties p = new Properties();
>> p.put(Context.INITIAL_CONTEXT_FACTORY,
>> "org.openejb.client.LocalInitialContextFactory");
>> p.put("openejb.home", "/usr/local/openejb");
>> p.put("openejb.configuration",
>> "/usr/local/openejb/conf/openejb.conf");
>> InitialContext ctx = new InitialContext(p);
>> out.print("<P>got ctx...");
>> Object obj = ctx.lookup("/ZCMHello");
>> out.print("did lookup...");
>> HelloHome ejbHome = (HelloHome)obj;
>> out.print("have home");
>> HelloObject ejbObject = ejbHome.create();
>> //The part we've all been waiting for...
>> message = ejbObject.sayHello();
>> } catch (Exception e){
>> e.printStackTrace();
>> }
>> %>
>> <P><%= message %>
>>
>>
>> That's all I've done...
>>
>>
>> So what exactly is the openejb_loader supposed to do? Could it be a
>> permission problem?
>>
>> Rick
>>
>>
>>
>>
>>
>
>
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
http://OpenEJB.sf.net
OpenEJB-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openejb-user