tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Errors shutting down Tomcat with OpenEJB 3 Beta-2
Date Thu, 21 Feb 2008 06:59:04 GMT
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

Mime
View raw message