David,
        I have deployed the myHelloEjb.jar and it's in the
/usr/local/openejb/openejb-0.9.1/bean directory.  I haven't copied it or
moved it.  In my Windows install, I had to do some weird things for my
EJB to work with OpenEJB.  I had to move the META-INF, org and
myHelloEjb.jar files from the classes directory into some other
directory.  If I didn't do that, it wouldn't work.  Now, when I deploy
the app:

./openejb.sh deploy -a -m
/usr/local/share/development/openejb/WEB-INF/classes/myHelloEjb.jar

everything goes as planned and the myHelloEjb.jar gets copied to the
/usr/local/openejb/openejb-0.9.1/beans directory

What do I do next?  The META-INF and org directories are still there,
should they be?  Here are my steps:

1) Create all .java files for the bean example
2) javac all .java files
3) jar META-INF and org
4) deploy myHelloEjb.jar
5) Start Tomcat

Did I leave any steps out?  I don't know what to do next.  Please help.
Thanks, Jeremy

P.S. - I tried the
http://localhost:8080/openejb/servlet/org/acme/HelloOpenEJB but it
didn't work.  Anymore ideas?

-----Original Message-----
From: David Blevins [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2003 1:58 PM
To: 'Tomcat Users List'
Cc: 'OpenEJB Users List'
Subject: RE: java.lang.NoClassDefFoundError -- solved

Filip is correct, follow that advice.

Also, once you deploy the EJB's into OpenEJB, just leave them in the
OpenEJB beans directory.  Don't copy the contents of you EJB jar into
the webapps dir, ejbs are not simple libraries, they must stay in the
EJB container.  Putting them in the webapps classes dir or lib dir will
just cause classloader issues.  OpenEJB will make sure all your EJBs are
visible all your Servlets and JSPs at run time.

You can easily tell OpenEJB where to look for ejbs on your file system,
but again, this shouldn't be the classes or lib directories of your
webapp.

You could create a directory under your WEB-INF dir called ejbs, then
add that dir to your openejb.conf as such:

<Deployments dir="/usr/local/share/development/openejb/WEB-INF/ejbs" />

When you deploy, just leave of the -m or -c options as those will move
or copy the ejb jar into the OpenEJB/beans directory.  You want them to
stay where they are, which is your new WEB-INF/ejbs directory.

-David

> -----Original Message-----
> From: Filip Hanik [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 05, 2003 2:33 PM
> To: Tomcat Users List
> Cc: OpenEJB
> Subject: RE: java.lang.NoClassDefFoundError -- solved
> 
> 
> you can do it two ways,
> 
> 1. If you have the invoker servlet, you can access it that 
> way, but you need the full classname 2. Did you register your 
> servlet in web.xml?
> 
> Filip
> 
> -----Original Message-----
> From: Jeremy Whitlock [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 05, 2003 12:21 PM
> To: 'Tomcat Users List'
> Cc: OpenEJB
> Subject: RE: java.lang.NoClassDefFoundError -- solved
> 
> 
> David,
>       I got OpenEJB working but I'm not able to run the 
> example.  I have created and compiled the 
> HelloBean.java,HelloHome.java,HelloObject.java and 
> HelloWorld.java. Here is the directory structure:
> 
> /usr/local/share/development/openejb
>       |
>       |
>       |_WEB-INF
>               |
>               |_lib
>               |
>               |_classes
>                       |
>                       |_META-INF
>                       |       |
>                       |       |_ejb-jar.xml
>                       |
>                       |_org
>                               |
>                               |_acme
>                                       |
>                                       |_HelloBean.java
>                                       |_HelloBean.class
>                                       |_HelloHome.java
>                                       |_HelloHome.class
>                                       |_HelloObject.java
>                                       |_HelloObject.class
>                                       |_HelloWorld.java
>                                       |_HelloWorld.class
> 
> I have setup Tomcat's server.xml to do this:
> 
> <!-- OpenEJB ExampleText Bean Context -->
>       <Contect path="/openejb" 
> docBase="/usr/local/share/development/openejb" debug="0"/>
> 
> Now, when I do 
> http://localhost:8080/openejb/servlet/HelloOpenEJB I get:
> 
> HTTP Status 404-/openejb/servlet/HelloOpenEJB
> 
> type Status report
> message /openejb/servlet/HelloOpenEJB
> description The requested resource 
> (/openejb/servlet/HelloOpenEJB) is not available
> 
> Any ideas why?  I remember in the previous version of 
> OpenEJB, I had to place the HelloWorld.java and 
> HelloWorld.class in the classes directory instead of the acme 
> directory.  Any ideas?  Thanks, Jeremy
> 
> -----Original Message-----
> From: David Blevins [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 05, 2003 1:09 PM
> To: 'Tomcat Users List'
> Subject: RE: java.lang.NoClassDefFoundError -- solved
> 
> This reply is for the archives.  Jeremy did finally get it 
> running -- he simply forgot to uncomment the openejb.home 
> init-param after setting it.
> 
> The full install process
> ----------------------------
> 
> In Linux, it is literally just three steps:
>  1. Copy the openejb_loader-0.9.1.war into the webapps dir
>  2. Uncomment and set the openejb.home init-param in the 
> web.xml  3. Restart Tomcat
> 
> If anything goes wrong, it *has* to be step 2, in which case 
> see above.
> 
> In Windows, it's the same process, but people constantly have 
> problems with the NT Service version of Tomcat not actually 
> restarting.  Usually you have to re-run the Tomcat NT Service 
> install program to get it to truly restart.  Don't know why, 
> wish I knew an easier way.
> 
> 
> How does this work?
> ----------------------------
> 
> The openejb_loader will do all the busy work for you.  It 
> will add all the required libraries from the OpenEJB 
> directories into the appropriate classloaders in Tomcat, all 
> automatically and dynamically.  The only thing you have to do 
> is tell the loader where OpenEJB lives by setting the 
> openejb.home init-param in the web.xml.
> 
> 
> It didn't work!?
> ----------------------------
> 
> Sounds simple, but we see a number of common mistakes:
> 
>  - Most people simply forget to uncomment it.  Check and 
> double check that.
>  - Some set it to "OPENEJB_HOME", which won't work. An actual 
> path is required.
>  - Some set it to point to the OpenEJB /bin directory.
>  - The rest are usually typos in the path.
> 
> 
> Hope this helps everyone out.  As an archive-searcher, I 
> always appreciate finding emails like this.
> 
> If anyone has any ideas on making the integration process 
> even easier, I am all ears.
> 
> -David
> 
> > -----Original Message-----
> > From: Jon Wingfield [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 05, 2003 12:44 PM
> > To: Tomcat Users List
> > Subject: Re: java.lang.NoClassDefFoundError
> > 
> > 
> > Looks like you've using OpenEJB ;)
> > The OpenEJB distro comes with a war file,  which looks like 
> it's been
> > expanded to a context by your tomcat install. However, the war file 
> > doesn't contain the required OpenEJB jar files (which 
> > probably need to 
> > be put in common/lib or server/lib).
> > The class file for org/openejb/OpenEJB is in the 
> > openejb-0.9.1.jar. Deploy that and you should be set (well, 
> > this error will go away, at 
> > least) .
> > 
> > HTH,
> > 
> > Jon
> > 
> > 
> > Jeremy Whitlock wrote:
> > 
> > >Tomcat List,
> > >                This might not be a Tomcat problem but I
> > imagine that
> > >you might be able to help anyways.  Every time I start 
> Tomcat, I get
> > >this error:
> > > 
> > >StandardContext[/openejb_loader-0.9.1]: Servlet
> > >  
> > >
> > >>/openejb_loader-0.9.1 threw load() exception
> > >>javax.servlet.ServletException: Servlet.init() for servlet loader
> > >>    
> > >>
> > >threw exception
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardWrapper.loadServlet(Standard
> > Wrapper.ja
> > >v
> > >a:962)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardWrapper.load(StandardWrapper
> > .java:821)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardContext.loadOnStartup(Standa
> > rdContext.
> > >j
> > >ava:3420)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardContext.start(StandardContex
> > t.java:360
> > >8
> > >)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.ContainerBase.addChildInternal(Conta
> > inerBase.j
> > >a
> > >va:821)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.ContainerBase.addChild(ContainerBase
> > .java:807)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardHostDeployer.install(Standar
> > dHostDeplo
> > >y
> > >er.java:257)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.
> > java:502)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.deployApps(HostConfig.
> > java:410)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.lifecycleEvent(HostCon
> > fig.java:3
> > >6
> > >8)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
> > LifecycleS
> > >u
> > >pport.java:166)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardEngine.start(StandardEngine.
> > java:347)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardService.start(StandardServic
> > e.java:497
> > >)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardServer.start(StandardServer.
> > java:2189)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Catalina.start(Catalina.java:512)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Catalina.process(Catalina.java:180)
> > >  
> > >
> > >>             at java.lang.reflect.Method.invoke(Native Method)
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> > >  
> > >
> > >>----- Root Cause -----
> > >>java.lang.NoClassDefFoundError: org/openejb/OpenEJB
> > >>             at
> > >>    
> > >>
> > >org.openejb.loader.EmbeddedLoader.load(EmbeddedLoader.java:58)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.openejb.loader.EmbeddingLoader.load(EmbeddingLoader.java:84)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.openejb.client.LocalInitialContextFactory.getInitialConte
> > xt(LocalIn
> > >i
> > >tialContextFactory.java:65)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >javax.naming.spi.NamingManager.getInitialContext(NamingManage
> > r.java:660
> > >)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >javax.naming.InitialContext.getDefaultInitCtx(InitialContext.
> > java:241)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >javax.naming.InitialContext.init(InitialContext.java:217)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >javax.naming.InitialContext.<init>(InitialContext.java:193)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.openejb.loader.LoaderServlet.init(LoaderServlet.java:82)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardWrapper.loadServlet(Standard
> > Wrapper.ja
> > >v
> > >a:934)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardWrapper.load(StandardWrapper
> > .java:821)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardContext.loadOnStartup(Standa
> > rdContext.
> > >j
> > >ava:3420)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardContext.start(StandardContex
> > t.java:360
> > >8
> > >)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.ContainerBase.addChildInternal(Conta
> > inerBase.j
> > >a
> > >va:821)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.ContainerBase.addChild(ContainerBase
> > .java:807)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardHostDeployer.install(Standar
> > dHostDeplo
> > >y
> > >er.java:257)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.
> > java:502)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.deployApps(HostConfig.
> > java:410)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.HostConfig.lifecycleEvent(HostCon
> > fig.java:3
> > >6
> > >8)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
> > LifecycleS
> > >u
> > >pport.java:166)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > 
> >org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardEngine.start(StandardEngine.
> > java:347)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardService.start(StandardServic
> > e.java:497
> > >)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.core.StandardServer.start(StandardServer.
> > java:2189)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Catalina.start(Catalina.java:512)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
> > >  
> > >
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Catalina.process(Catalina.java:180)
> > >  
> > >
> > >>             at java.lang.reflect.Method.invoke(Native Method)
> > >>             at
> > >>    
> > >>
> > >org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> > > 
> > >I know that Tomcat doesn't use the CLASSPATH but it 
> appears that the
> > >error is because a class can't be found.  Can someone help 
> > me resolve
> > >this?  Thanks,
> > > 
> > > 
> > >Jeremy Whitlock --- MCP/MCSA
> > >IT Manager for Star Precision, Inc.
> > >Phone:  (970) 535-4795
> > >Metro:  (303) 926-0559
> > >Fax:  (970) 535-0780
> > >Metro Fax:  (303) 926-0559
> > >http://www.starprecision.com
> > > 
> > >
> > >  
> > >
> > 
> > 
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to