Installation: ClassNotFoundException: org.apache.openejb.loader.OpenEJBListener

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Installation: ClassNotFoundException: org.apache.openejb.loader.OpenEJBListener

White-Gandalf
Hi folks,

i'm new on Tomcat and OpenEJB. I had installed Tomcat 6.0.14 with some problems, but nevertheless functioning at last. Now, i wanted to add OpenEJB. After starting the installation procedure by copying the "war" to webapps, when i tried to restart the server, it wasn't starting anymore. In "stderr_...log" are "ClassNotFoundException: org.apache.openejb.loader.OpenEJBListener" to be found.

Has anybody an idea, what's going wrong?

So far i had only followed the really simple copy operation, and i have one speciality that possibly has something to do with that behavior.

After the installation of the "war" by tomcat, the batch file for starting the server as a user application from the command line was changed. That contradicts the fact, that tomcat has to be running as a service on my system. To react on that, i executed the two lines in question by hand, namely:

I executed by copying by hand:

copy /Y "%CATALINA_BASE%\webapps\openejb\tomcat\annotations-api.jar" "%CATALINA_HOME%\lib\annotations-api.jar"

I executed by adding the environment variable to the tomcat user profile:

set JAVA_OPTS="-javaagent:%CATALINA_BASE%\webapps\openejb\lib\openejb-javaagent-3.0-beta-1.jar" %JAVA_OPTS%

(In both cases the environment variables expanded...)

Is that in any matter incompatible with the way of deployment for servers in user-application-mode?
Or will there be some other thing wrong with that EJB?

Is there any way to keep the server running, when only a subordered module doesn't start correctly? Or do i have to keep the OpenEJB-Package deleted until this matter is solved?
Reply | Threaded
Open this post in threaded view
|

Re: Installation: ClassNotFoundException: org.apache.openejb.loader.OpenEJBListener

dblevins
Administrator
On Jan 31, 2008, at 10:34 PM, White-Gandalf wrote:

>
> Hi folks,
>
> i'm new on Tomcat and OpenEJB. I had installed Tomcat 6.0.14 with some
> problems, but nevertheless functioning at last. Now, i wanted to add
> OpenEJB. After starting the installation procedure by copying the  
> "war" to
> webapps, when i tried to restart the server, it wasn't starting  
> anymore. In
> "stderr_...log" are "ClassNotFoundException:
> org.apache.openejb.loader.OpenEJBListener" to be found.
>
> Has anybody an idea, what's going wrong?
>
> So far i had only followed the really simple copy operation, and i  
> have one
> speciality that possibly has something to do with that behavior.
>
> After the installation of the "war" by tomcat, the batch file for  
> starting
> the server as a user application from the command line was changed.  
> That
> contradicts the fact, that tomcat has to be running as a service on my
> system. To react on that, i executed the two lines in question by  
> hand,
> namely:

Right, I'm not sure that the bat files are used at all when installing  
tomcat as a windows service, so editing them in any way may have no  
affect.

The 6.0 docs have this page, which is basically a copy of the second  
link:
  http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html
  http://commons.apache.org/daemon/procrun.html

Regarding the -javaagent param, it might be possible to set that up  
using the --JvmOptions flag as mentioned in those docs.  Seems the  
most likely of the unlikely looking options.  But I suspect it can  
only handle -X and -D vm options and the new -javaagent option might  
be unsupported.  The javaagent isn't strictly required, more strongly  
encouraged if you use JPA (aka EJB3 EntityBeans).

Regarding the annotations jar and the ClassNotFoundException, I  
suspect they might be the same problem.  I've seen it before with  
Tomcat as a windows service seemingly refusing to actually stop when  
you click their little stop/start or restart buttons and changes  
you've made to the classpath never take effect.

One thing to try is pop open the services panel in windows, find the  
tomcat service right click on it and select the stop option, then go  
ahead and start it again.  Or restart your machine for good measure.

If running tomcat as a service is not that important to you,  
definitely just grab a plain zip, unpack and boot from the bat files  
as it will be far less difficult to deal with and the ejb plugin will  
work -- all these issues are service related.

Tomcat can handle plain webapps not starting and continue to work, but  
it can't handle anything such as a tomcat specific listener not  
working.  Uninstalling the openejb webapp is as simple as deleting the  
webapp, removing OpenEJBListener declaration from your server.xml if  
you added it either manually or via the openejb webapp install page,  
then restarting tomcat.  The trick is if I am right in that Tomcat is  
in fact not restarting and is keeping the same old vm with the same  
classloaders, it won't work either.

Let us know if the more direct attempts at restarting work or not.  I  
suspect anyone who attempts to use Tomcat as a windows service may  
have difficulties with the integration and it'd be really good to get  
some up to date info on this and document accordingly.

As an FYI, a build of the beta 2 release is currently up for vote and  
does have improvements in the Tomcat integration -- specifically  
around the need for the OpenEjbListener, annotations-api.jar and the  
need for a restart (none are required anymore).  If you can get a  
clean Tomcat install again, it might be worth it to try them out.  
Binaries are here:  http://people.apache.org/~dblevins/stage2/3.0-beta-2/

Let us know how things go and we can try and find another solution.  
If all else fails I can get my hands on a windows machine next week  
and hammer on it some.

-David

Reply | Threaded
Open this post in threaded view
|

Re: Installation: ClassNotFoundException: org.apache.openejb.loader.OpenEJBListener

dblevins
Administrator
In reply to this post by White-Gandalf
On Jan 31, 2008, at 10:34 PM, White-Gandalf wrote:

>
> Hi folks,
>
> i'm new on Tomcat and OpenEJB. I had installed Tomcat 6.0.14 with some
> problems, but nevertheless functioning at last. Now, i wanted to add
> OpenEJB. After starting the installation procedure by copying the  
> "war" to
> webapps, when i tried to restart the server, it wasn't starting  
> anymore. In
> "stderr_...log" are "ClassNotFoundException:
> org.apache.openejb.loader.OpenEJBListener" to be found.
>
> Has anybody an idea, what's going wrong?
>
> So far i had only followed the really simple copy operation, and i  
> have one
> speciality that possibly has something to do with that behavior.
>
> After the installation of the "war" by tomcat, the batch file for  
> starting
> the server as a user application from the command line was changed.  
> That
> contradicts the fact, that tomcat has to be running as a service on my
> system. To react on that, i executed the two lines in question by  
> hand,
> namely:

Right, I'm not sure that the bat files are used at all when installing  
tomcat as a windows service, so editing them in any way may have no  
affect.

The 6.0 docs have this page, which is basically a copy of the second  
link:
http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html
http://commons.apache.org/daemon/procrun.html

Regarding the -javaagent param, it might be possible to set that up  
using the --JvmOptions flag as mentioned in those docs.  Seems the  
most likely of the unlikely looking options.  But I suspect it can  
only handle -X and -D vm options and the new -javaagent option might  
be unsupported.  The javaagent isn't strictly required, more strongly  
encouraged if you use JPA (aka EJB3 EntityBeans).

Regarding the annotations jar and the ClassNotFoundException, I  
suspect they might be the same problem.  I've seen it before with  
Tomcat as a windows service seemingly refusing to actually stop when  
you click their little stop/start or restart buttons and changes  
you've made to the classpath never take effect.

One thing to try is pop open the services panel in windows, find the  
tomcat service right click on it and select the stop option, then go  
ahead and start it again.  Or restart your machine for good measure.

If running tomcat as a service is not that important to you,  
definitely just grab a plain zip, unpack and boot from the bat files  
as it will be far less difficult to deal with and the ejb plugin will  
work -- all these issues are service related.

Tomcat can handle plain webapps not starting and continue to work, but  
it can't handle anything such as a tomcat specific listener not  
working.  Uninstalling the openejb webapp is as simple as deleting the  
webapp, removing OpenEJBListener declaration from your server.xml if  
you added it either manually or via the openejb webapp install page,  
then restarting tomcat.  The trick is if I am right in that Tomcat is  
in fact not restarting and is keeping the same old vm with the same  
classloaders, it won't work either.

Let us know if the more direct attempts at restarting work or not.  I  
suspect anyone who attempts to use Tomcat as a windows service may  
have difficulties with the integration and it'd be really good to get  
some up to date info on this and document accordingly.

As an FYI, a build of the beta 2 release is currently up for vote and  
does have improvements in the Tomcat integration -- specifically  
around the need for the OpenEjbListener, annotations-api.jar and the  
need for a restart (none are required anymore).  If you can get a  
clean Tomcat install again, it might be worth it to try them out.  
Binaries are here:  http://people.apache.org/~dblevins/stage2/3.0-beta-2/

Let us know how things go and we can try and find another solution.  
If all else fails I can get my hands on a windows machine next week  
and hammer on it some.

-David