You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by AdamO <ad...@macrologic.pl> on 2008/02/16 09:48:36 UTC

Errors shutting down Tomcat with OpenEJB 3 Beta-2

I've noticed "INFO: Illegal access:" messages in my Tomcat log while testing
beta-2. I haven't had the messages with beta-1. Does anyone know what's
wrong?
I have also tried with clean Tomcat 6.0.14 install. Fragments of my log:

INFO: Pausing Coyote HTTP/1.1 on http-8080
2008-02-16 09:29:55 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
2008-02-16 09:29:55 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:1244)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
	at
org.apache.openejb.ClassLoaderUtil.cleanOpenJPACache(ClassLoaderUtil.java:83)
	at
org.apache.openejb.assembler.classic.Assembler$ClassLoaderRegistry.unregisterClassLoaders(Assembler.java:1208)
	at
org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:699)
	at
org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:597)
	at
org.apache.openejb.tomcat.TomcatWebAppBuilder.afterStop(TomcatWebAppBuilder.java:381)
	at
org.apache.openejb.tomcat.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:66)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4566)
	at
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
	at
org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1180)
	at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1151)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1086)
	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1098)
	at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:448)
	at org.apache.catalina.core.StandardService.stop(StandardService.java:584)
	at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
	at org.apache.catalina.startup.Catalina.stop(Catalina.java:616)
	at
org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:659)
---------------

Regards
Adam

-- 
View this message in context: http://www.nabble.com/Errors-shutting-down-Tomcat-with-OpenEJB-3-Beta-2-tp15516149p15516149.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Errors shutting down Tomcat with OpenEJB 3 Beta-2

Posted by David Blevins <da...@visi.com>.
This one is going to take a bit of digging.

-David

On Feb 16, 2008, at 12:48 AM, AdamO wrote:

>
> I've noticed "INFO: Illegal access:" messages in my Tomcat log while  
> testing
> beta-2. I haven't had the messages with beta-1. Does anyone know  
> what's
> wrong?
> I have also tried with clean Tomcat 6.0.14 install. Fragments of my  
> log:
>
> INFO: Pausing Coyote HTTP/1.1 on http-8080
> 2008-02-16 09:29:55 org.apache.catalina.core.StandardService stop
> INFO: Stopping service Catalina
> 2008-02-16 09:29:55 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: 
> 1244)
> 	at
> org 
> .apache 
> .catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 
> 1204)
> 	at
> org 
> .apache 
> .openejb.ClassLoaderUtil.cleanOpenJPACache(ClassLoaderUtil.java:83)
> 	at
> org.apache.openejb.assembler.classic.Assembler 
> $ClassLoaderRegistry.unregisterClassLoaders(Assembler.java:1208)
> 	at
> org 
> .apache 
> .openejb 
> .assembler.classic.Assembler.destroyApplication(Assembler.java:699)
> 	at
> org 
> .apache 
> .openejb 
> .assembler.classic.Assembler.destroyApplication(Assembler.java:597)
> 	at
> org 
> .apache 
> .openejb 
> .tomcat.TomcatWebAppBuilder.afterStop(TomcatWebAppBuilder.java:381)
> 	at
> org 
> .apache 
> .openejb 
> .tomcat 
> .GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:66)
> 	at
> org 
> .apache 
> .catalina 
> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> 	at  
> org.apache.catalina.core.StandardContext.stop(StandardContext.java: 
> 4566)
> 	at
> org 
> .apache.catalina.core.ContainerBase.removeChild(ContainerBase.java: 
> 924)
> 	at
> org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java: 
> 1180)
> 	at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1151)
> 	at
> org 
> .apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java: 
> 313)
> 	at
> org 
> .apache 
> .catalina 
> .util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> 	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java: 
> 1086)
> 	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java: 
> 1098)
> 	at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java: 
> 448)
> 	at  
> org.apache.catalina.core.StandardService.stop(StandardService.java: 
> 584)
> 	at org.apache.catalina.core.StandardServer.stop(StandardServer.java: 
> 744)
> 	at org.apache.catalina.startup.Catalina.stop(Catalina.java:616)
> 	at
> org.apache.catalina.startup.Catalina 
> $CatalinaShutdownHook.run(Catalina.java:659)
> ---------------
>
> Regards
> Adam
>
> -- 
> View this message in context: http://www.nabble.com/Errors-shutting-down-Tomcat-with-OpenEJB-3-Beta-2-tp15516149p15516149.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>
>


Re: Errors shutting down Tomcat with OpenEJB 3 Beta-2

Posted by Dain Sundstrom <da...@iq80.com>.
I believe I have fixed this issue in TRUNK.

-dain

On Feb 20, 2008, at 10:59 PM, Dain Sundstrom wrote:

> On Feb 16, 2008, at 12:48 AM, AdamO wrote:
>
>> I've noticed "INFO: Illegal access:" messages in my Tomcat log  
>> while testing
>> beta-2. I haven't had the messages with beta-1. Does anyone know  
>> what's
>> wrong?
>
> There is nothing wrong with your code.  This log message is caused  
> by a piece of code I added between beta-1 and beta-2 that clears a  
> leaky cache in OpenJPA.
>
> The problem we're running into is when we try to clear this cache in  
> for an application using a tomcat class loader with this code:
>
>    public static void cleanOpenJPACache(ClassLoader classLoader) {
>        try {
>            Class<?> pcRegistryClass =  
> classLoader.loadClass("org.apache.openjpa.enhance.PCRegistry");
>            Method deRegisterMethod =  
> pcRegistryClass.getMethod("deRegister", ClassLoader.class);
>            deRegisterMethod.invoke(null, classLoader);
>        } catch (Throwable ignored) {
>            // there is nothing a user could do about this anyway
>        }
>    }
>
> We run into the following code in the Tomcat class loader when we  
> load the PCRegistry class:
>
>        // Log access to stopped classloader
>        if (!started) {
>            try {
>                throw new IllegalStateException();
>            } catch (IllegalStateException e) {
>                log.info(sm.getString("webappClassLoader.stopped",  
> name), e);
>            }
>        }
>
> So, if the class loader is "stopped" it will log that huge message  
> with stack trace for every class that we attempt to load.  It will  
> take some experimenting to figure out how to avoid the exception  
> message.
>
> Anyway, your code is fine, and I think the clean up code is working  
> fine, but it would be nice to get rid of the annoying log message.
>
> -dain


Re: Errors shutting down Tomcat with OpenEJB 3 Beta-2

Posted by AdamO <ad...@macrologic.pl>.
Thank you for your concern. It's good to know there's nothing wrong with my
code and that everything shuts down correctly. 
I also have another problem since beta-2. I can't get @Resource
UserTransaction. I'll verify my code again before I send a post.

Best regards
Adam



Dain Sundstrom wrote:
> 
> On Feb 16, 2008, at 12:48 AM, AdamO wrote:
> 
>> I've noticed "INFO: Illegal access:" messages in my Tomcat log while  
>> testing
>> beta-2. I haven't had the messages with beta-1. Does anyone know  
>> what's
>> wrong?
> 
> There is nothing wrong with your code.  This log message is caused by  
> a piece of code I added between beta-1 and beta-2 that clears a leaky  
> cache in OpenJPA.
> 
> The problem we're running into is when we try to clear this cache in  
> for an application using a tomcat class loader with this code:
> 
>      public static void cleanOpenJPACache(ClassLoader classLoader) {
>          try {
>              Class<?> pcRegistryClass =  
> classLoader.loadClass("org.apache.openjpa.enhance.PCRegistry");
>              Method deRegisterMethod =  
> pcRegistryClass.getMethod("deRegister", ClassLoader.class);
>              deRegisterMethod.invoke(null, classLoader);
>          } catch (Throwable ignored) {
>              // there is nothing a user could do about this anyway
>          }
>      }
> 
> We run into the following code in the Tomcat class loader when we load  
> the PCRegistry class:
> 
>          // Log access to stopped classloader
>          if (!started) {
>              try {
>                  throw new IllegalStateException();
>              } catch (IllegalStateException e) {
>                  log.info(sm.getString("webappClassLoader.stopped",  
> name), e);
>              }
>          }
> 
> So, if the class loader is "stopped" it will log that huge message  
> with stack trace for every class that we attempt to load.  It will  
> take some experimenting to figure out how to avoid the exception  
> message.
> 
> Anyway, your code is fine, and I think the clean up code is working  
> fine, but it would be nice to get rid of the annoying log message.
> 
> -dain
> 
> 

-- 
View this message in context: http://www.nabble.com/Errors-shutting-down-Tomcat-with-OpenEJB-3-Beta-2-tp15516149p15632866.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: Errors shutting down Tomcat with OpenEJB 3 Beta-2

Posted by Dain Sundstrom <da...@iq80.com>.
On Feb 16, 2008, at 12:48 AM, AdamO wrote:

> I've noticed "INFO: Illegal access:" messages in my Tomcat log while  
> testing
> beta-2. I haven't had the messages with beta-1. Does anyone know  
> what's
> wrong?

There is nothing wrong with your code.  This log message is caused by  
a piece of code I added between beta-1 and beta-2 that clears a leaky  
cache in OpenJPA.

The problem we're running into is when we try to clear this cache in  
for an application using a tomcat class loader with this code:

     public static void cleanOpenJPACache(ClassLoader classLoader) {
         try {
             Class<?> pcRegistryClass =  
classLoader.loadClass("org.apache.openjpa.enhance.PCRegistry");
             Method deRegisterMethod =  
pcRegistryClass.getMethod("deRegister", ClassLoader.class);
             deRegisterMethod.invoke(null, classLoader);
         } catch (Throwable ignored) {
             // there is nothing a user could do about this anyway
         }
     }

We run into the following code in the Tomcat class loader when we load  
the PCRegistry class:

         // Log access to stopped classloader
         if (!started) {
             try {
                 throw new IllegalStateException();
             } catch (IllegalStateException e) {
                 log.info(sm.getString("webappClassLoader.stopped",  
name), e);
             }
         }

So, if the class loader is "stopped" it will log that huge message  
with stack trace for every class that we attempt to load.  It will  
take some experimenting to figure out how to avoid the exception  
message.

Anyway, your code is fine, and I think the clean up code is working  
fine, but it would be nice to get rid of the annoying log message.

-dain