David Blevins wrote:
> Seems there's something about the
WebappClassLoader.clearReferences() that is attempting to do some
cleanup which is actually causing a class (SimpleWorkManager) to get
loaded.  Why the class isn't loading successfully is less strange
to me as why is Tomcat attempting to clean it?  My gut says
that's the first place to investigate.
>
> Maybe not related, but are all the openejb libraries in the
WEB-INF/lib or somewhere in Tomcat itself?  I suspect that the
only way this might work is if everything is in the WEB-INF/lib.
>
> One key point is to make sure you're not using the
org.apache.openejb.tomcat.loader.LoaderServlet as that is designed
specifically for the standard OpenEJB in Tomcat integration and will
result in the opposite effect than what you want.
>
> -David
>
Thanks for your reply!
First of all, the application runs in a clean installation of Tomcat,
so the OpenEJB loader servlet is not used.
I have rolled up my sleeves, at least a little, and come to the
following results related to trying to run OpenEJB embedded, with
Spring and without using the Tomcat integration:
- The javaee-api-5.0-1.jar library MUST be in the Tomcat lib
directory. Placing it in the WEB-INF/lib directory is not enough.
  If the library is not in place, the following error will
occur:
  Error loading class
[org.apache.geronimo.transaction.manager.GeronimoTransactionManager]
  for bean with name 'TransactionManager' defined in
ServletContext resource
  [/WEB-INF/openEjbSpringBeans.xml]: problem with class file or
dependent class;
  nested exception is java.lang.NoClassDefFoundError:
javax/resource/spi/XATerminator
- If I add the following line to catalina.properties in the Tomcat
installation, the problem with the exceptions that repeat forever goes
away:
 
org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
  The error seem to occur in a block of code in the
WebappClassLoader class in Tomcat which has the following comment:
  // Null out any static or final fields from loaded classes,
  // as a workaround for apparent garbage collection bugs
 I do not yet know which field in which class cause the
problem.
- If I use the following code to shut down OpenEJB, there will always
be an error when OpenEJB.destroy() is called, even when the Tomcat
property ENABLE_CLEAR_REFERENCES is set to false. This error does not
prevent shutdown of the application or Tomcat.
         Assembler theAssembler =
SystemInstance.get().getComponent(Assembler.class);
         for (AppInfo theAppInfo :
theAssembler.getDeployedApplications())
         {
            
try
            
{

               
theAssembler.destroyApplication(theAppInfo.jarPath);
             }
catch (Exception theException)
            
{
            
}
         }
         OpenEJB.destroy();
   If I remove the call to theAssembler.destroyApplication(),
then the error goes away. I assume that this call is redundant, since
OpenEJB.destroy() also seems to destroy the application.
That is all for today, I will get back if I make any further
progress.
Best regards,
 Ivan A Krizsan

Reply via email to