Try David's nifty Jar file; he discusses it in an email that was sent
yesterday.  It will automagically load all the classes for you.  

This way, you don't need to litter your Tomcat directories with OpenEJB
jars.


Regards,
Alan

-----Original Message-----
From: Rick Mangi [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 11, 2002 10:18 AM
To: Alan Cabrera
Cc: David Blevins; openejb-user
Subject: Re: [OpenEJB-user] Re: OpenEJB W/ Tomcat


I tried it out with a 4.0 version of tomcat (4.0.3 LE) which tends to 
give different error messages. Here's what I'm getting now:

javax.naming.NamingException: Cannot instantiate an IntraVM 
InitialContext. Exception: java.lang.ClassNotFoundException 
org/openejb/core/ivm/naming/InitContextFactory
        at 
org.openejb.client.LocalInitialContextFactory.getIntraVmContext(LocalInitial
ContextFactory.java:116)
        at 
org.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitial
ContextFactory.java:67)
        at 
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
        at 
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
        at javax.naming.InitialContext.init(InitialContext.java:219)
        at javax.naming.InitialContext.<init>(InitialContext.java:195)
        at org.apache.jsp.test$jsp._jspService(test$jsp.java:96)




Alan Cabrera wrote:

>Rick,
>
>I'm one step behind you.  I also had to copy the ejb and hello jar files to
>my WEB-INF/lib directory to get the JSP to compile.  Did you do anything
>else?
>
>Now, here's the output that I get:
>
>got ctx...did lookup...found: '$Proxy3' Ouch! java.lang.ClassCastException:
>$Proxy3 
>
>nah 
>
>for this code:
>
><%@ page import="javax.naming.InitialContext" %>
><%@ page import="java.util.Properties" %>
><%@ page import="javax.naming.Context" %>
><%@ page import="javax.rmi.PortableRemoteObject" %>
><%@ page import="org.acme.*" %>
><%
>       String message = "nah";
>
>    try{
>               Properties p = new Properties();
>               p.put(Context.INITIAL_CONTEXT_FACTORY,
>"org.openejb.client.LocalInitialContextFactory" );
>
>               InitialContext ctx = new InitialContext( p );
>
>               out.print( "<P>got ctx..." );
>
>               Object obj = ctx.lookup( "/Hello" );
>               out.print("did lookup...");
>               out.println("found: '"+obj.getClass().getName()+"'");
>
>       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){
>               out.print( "Ouch! "+e.toString() );
>               e.printStackTrace();
>    }
>%>
><P><%= message %>
>
>
>Regards,
>Alan
>
>
>
>
>
>
>
>
>
>  
>
>>-----Original Message-----
>>From: Rick Mangi [mailto:[EMAIL PROTECTED]]
>>Sent: Thursday, October 10, 2002 4:02 PM
>>To: David Blevins
>>Cc: openejb-user
>>Subject: [OpenEJB-user] Re: OpenEJB W/ Tomcat
>>
>>
>><moving a private discussion to the list for the benefit of all>
>>
>>David,
>>
>>Here's my JSP and relevant code.
>>
>>It makes sense to me that the ejb jar has to be in the common/lib 
>>directory for JSPs since the jsp compiler is going to need 
>>that stuff to 
>>compile the servlet, but that doesn't seem to have much to do 
>>with the 
>>exception I'm getting.
>>
>>Here's my JSP code: I put the HelloWorld stuff in 
>>com.zcm.intranet.ejb.test. Those classes are exactly as per 
>>the examples 
>>on the website, and they DeploymentID is /ZCMHello. I've been 
>>using this 
>>JSP for testing in and out of process, hence the extra imports.
>>
>>Thanks.
>>
>>Rick
>>
>>
>><%@ 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");
>>      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 wainting for...
>>      message = ejbObject.sayHello();
>>    } catch (Exception e){
>>    e.printStackTrace();
>>    }
>>%>
>><P><%= message %>
>>
>>David Blevins wrote:
>>
>>    
>>
>>>Hi Rick,
>>>
>>>Thanks for the positive feedback, I'm pretty excited about 
>>>      
>>>
>>the project
>>    
>>
>>>too.
>>>
>>>I didn't test any JSPs, so I think the best thing for both 
>>>      
>>>
>>of us is for
>>    
>>
>>>you send me a simplified version of your code that I can use to track
>>>down the problem and test future releases with.  I'll get it 
>>>      
>>>
>>working and
>>    
>>
>>>send any instructions or patches to the list.
>>>
>>>I do prefer the list, as there are usually several people 
>>>      
>>>
>>thinking the
>>    
>>
>>>same thing, but too afraid to ask.  Thank you for asking -- it's the
>>>first time in three years anyone has.
>>>
>>>-David
>>>
>>> 
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Rick Mangi [mailto:[EMAIL PROTECTED]] 
>>>>Sent: Thursday, October 10, 2002 2:36 PM
>>>>To: David Blevins
>>>>Subject: Re: OpenEJB W/ Tomcat
>>>>
>>>>
>>>>David,
>>>>
>>>>I had to put the ejb jars in there as well to get it to 
>>>>compile my JSP 
>>>>(throwing another piece into the puzzle...JSP!). Now I'm 
>>>>        
>>>>
>>getting this 
>>    
>>
>>>>error (btw: this is on Redhat Linux 7.4, tomcat latest version, 
>>>>installed today):
>>>>
>>>>Servlet Controller: Start processing request with url /test 
>>>>Servlet Controller: target screen is: TEST
>>>>OpenEJB 0.8.3    build: 20021001-1721
>>>>http://openejb.sf.net
>>>>javax.naming.NamingException: Cannot instantiate an IntraVM 
>>>>InitialContext. Exception: 
>>>>org.openejb.core.ivm.naming.NamingException 
>>>>OpenEJB has encountered a fatal error and cannot be started: The 
>>>>Assembler encountered an unexpected error while attempting to 
>>>>initialize.: Cannot inherit from final class
>>>>       at 
>>>>org.openejb.client.LocalInitialContextFactory.getIntraVmContex
>>>>t(LocalInitialContextFactory.java:116)
>>>>       at 
>>>>org.openejb.client.LocalInitialContextFactory.getInitialContex
>>>>t(LocalInitialContextFactory.java:67)
>>>>       at 
>>>>javax.naming.spi.NamingManager.getInitialContext(NamingManager
>>>>.java:662)
>>>>       at 
>>>>javax.naming.InitialContext.getDefaultInitCtx(InitialContext
>>>>        
>>>>
>>.java:243)
>>    
>>
>>>>       at javax.naming.InitialContext.init(InitialContext.java:219)
>>>>       at 
>>>>        
>>>>
>>javax.naming.InitialContext.<init>(InitialContext.java:195)
>>    
>>
>>>>       at org.apache.jsp.test_jsp._jspService(test_jsp.java:65)
>>>>       at 
>>>>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
>>>>    
>>>>
>>>>Thanks for your help. I'm really excited about this project. 
>>>>Would you 
>>>>prefer I emailed this to the list, or to you directly?
>>>>
>>>>Rick
>>>>
>>>>
>>>>David Blevins wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>
>>
>>
>>-------------------------------------------------------
>>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
>>
>>    
>>





-------------------------------------------------------
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


-------------------------------------------------------
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

Reply via email to