On May 7, 2008, at 8:35 PM, veggen wrote:


Something very strange happened. I updated my OpenEJB to 3.0 (actually I installed a fresh copy of both Tomcat and OpenEJB), and now the Listener gets installed (unlike the case with 3.0beta2), after deploying my .war it no longer immediately dissappears from Tomcat's list of apps but I never get
a Jndi name for it (and I was getting one with beta2)...

Here are the logs:

[openejb.log]
------------
Configuring app: C:\Java\tomcat\webapps\SimpleSessionApp
INFO  - Loaded Module: C:\Java\tomcat\webapps\SimpleSessionApp
INFO  - Assembling app: C:\Java\tomcat\webapps\SimpleSessionApp
INFO - Deployed Application(path=C:\Java\tomcat\webapps \SimpleSessionApp)
------------

You see, I no longer get "Jndi(name=SimpleSessionBeanRemote)" etc.

[catalina.2008-05-09.log]
------------
May 9, 2008 5:11:02 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive SimpleSessionApp.war
------------

I left the whole previous conversation quoted so you can see both my code
and previous errors.
Also, here's what I've done to package my EJB, the problem might as well lay
there:

jar cf SimpleSessionApp.war beans\*.java

Only the two classes listed below are within beans package (they were
successfully tested on JBoss and no code was changed when deployed to
OpenEJB/Tomcat instead).

I'm sorry for bothering you with an unconstructed question like this but I'm
very new to all this...

No need to apologize, that's what where here for :)

The layout we support for combined ejbs and servlets in a war file is to put your ejb classes in the WEB-INF/classes/ directory or in a jar in the WEB-INF/lib/ directory. This is likely to be the spec defined way for EJB 3.1 as well.

So with your to EJB classes:

  package beans;
  import javax.ejb.Stateless;
  @Stateless
  public class SimpleSessionBean implements SimpleSession {
  ...
  }

  package beans;
  import javax.ejb.Remote;
  @Remote
  public interface SimpleSession {
  ...
  }

The war file layout should look something like this:

 WEB-INF/web.xml
 WEB-INF/classes/beans/SimpleSessionBean.class
 WEB-INF/classes/beans/SimpleSession.class

Or like this:

 WEB-INF/web.xml
 WEB-INF/lib/myBeans.jar

where the myBeans.jar is a regular ejb-jar file.

-David






David Blevins wrote:

I think this may be one of the redeploy/classloader issues we fixed
between 3.0-beta-2 and 3.0 final.   I'd upgrade to the 3.0 final
openejb.war and try again.  Definitely make sure you upgrade the
openejb.war while Tomcat is shutdown.

-David

On May 4, 2008, at 4:32 AM, veggen wrote:


I'm using Tomcat 6.0.16 with OpenEJB 3.0-bet2 on WinXP and jdk 1.6_03.
I dropped openejb.war into tomcat/webapps, ran the installer,
restarted
Tomcat. It tells me the listener is not installed, but I do see it's
entry
in server.xml.
I made a very simple session bean (code below), packed it into
a .war and
uploaded it through the tomcat management page. It appeared in the
list of
applicatiopn, but a moment later it disappeared.
I checked the logs:

[openejb.log]

last few lines:

008-05-03 13:05:15,265 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\SimpleSessionApp
2008-05-03 13:05:15,281 - INFO  - Configuring app:
C:\Java\tomcat\webapps\SimpleSessionApp
2008-05-03 13:05:15,312 - INFO  - Loaded Module:
C:\Java\tomcat\webapps\SimpleSessionApp
2008-05-03 13:05:15,312 - INFO  - Assembling app:
C:\Java\tomcat\webapps\SimpleSessionApp
2008-05-03 13:05:15,375 - INFO  - Jndi(name=SimpleSessionBeanRemote)
-->
Ejb(deployment-id=SimpleSessionBean)
2008-05-03 13:05:15,375 - INFO  - Created
Ejb(deployment-id=SimpleSessionBean, ejb-name=SimpleSessionBean,
container=My Stateless Container)
2008-05-03 13:05:15,375 - INFO  - Deployed
Application(path=C:\Java\tomcat\webapps\SimpleSessionApp)
2008-05-03 13:09:26,296 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\ROOT
2008-05-03 13:09:26,312 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\manager
2008-05-03 13:09:26,312 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\docs
2008-05-03 13:09:26,312 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\examples
2008-05-03 13:09:26,328 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\openejb
2008-05-03 13:09:26,328 - INFO  - Undeploying app:
C:\Java\tomcat\webapps\host-manager

[catalina.2008-05-03.log]

...
May 3, 2008 1:05:15 PM org.apache.catalina.loader.WebappClassLoader
loadClass
INFO: Illegal access: this web application instance has been stopped
already.  Could not load org.apache.openjpa.enhance.PCRegistry.  The
eventual following stack trace is caused by an error thrown for
debugging
purposes as well as to attempt to terminate the thread which caused
the
illegal access, and has no functional impact.
java.lang.IllegalStateException
        at
org
.apache
.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1246)
        at
org
.apache
.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:
1206)
        at
org
.apache
.openejb.ClassLoaderUtil.cleanOpenJPACache(ClassLoaderUtil.java:83)
...

Any ideas what I might be doing wrong?
I'm very sorry if my question is dumb but don't really know what
else to do
but post here...

[SimpleSessionBean code]

package beans;
import javax.ejb.Stateless;
@Stateless
public class SimpleSessionBean implements SimpleSession {
        public String getEchoString(String clientString) {
                return clientString + " - from session bean";
        }
}

[SimpleSession code]

package beans;
import javax.ejb.Remote;
@Remote
public interface SimpleSession
{
        public String getEchoString(String clientString);
}

--
View this message in context:
http://www.nabble.com/Bean-deployment-on-Tomcat-error-tp17045391p17045391.html
Sent from the OpenEJB User mailing list archive at Nabble.com.






--
View this message in context: 
http://www.nabble.com/Bean-deployment-on-Tomcat-error-tp17045391p17117872.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Reply via email to