Jamie Echlin | 24 Jul 2012 21:49
Picon
Gravatar

[groovy-user] can't shutdown java web app containing groovy jar

Hi,


I have a web app (jira), to which I have added the groovy-all.jar, in an OSGi bundle.

On shutting down the app I get the following error:

24-Jul-2012 20:44:50 org.apache.catalina.startup.Catalina$CatalinaShutdownHook run
SEVERE: The shutdown hook experienced an error while trying to stop the server
java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/GroovyCategorySupport$1
        at java.lang.Class.getDeclaringClass(Native Method)
        at java.lang.Class.getEnclosingClass(Class.java:1085)
....

Full list of exceptions here: https://gist.github.com/3172203

I do not really care about this, but it seems that when it's running as a windows service (not sure which java service wrapper is being employed), this error prevents the service from stopping. 

If you google "Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.GroovyCategorySupport" you get hits from bunch of tomcat log files, most of which should probably not be exposed to everyone but whatever.

Has anyone got any ideas?

cheers, jame
Jochen Theodorou | 24 Jul 2012 23:14
Picon
Gravatar

Re: [groovy-user] can't shutdown java web app containing groovy jar

Am 24.07.2012 21:49, schrieb Jamie Echlin:
> Hi,
>
> I have a web app (jira), to which I have added the groovy-all.jar, in an
> OSGi bundle.

what version of Groovy?

> On shutting down the app I get the following error:
>
> 24-Jul-2012 20:44:50
> org.apache.catalina.startup.Catalina$CatalinaShutdownHook run
> SEVERE: The shutdown hook experienced an error while trying to stop the
> server
> java.lang.NoClassDefFoundError:
> org/codehaus/groovy/runtime/GroovyCategorySupport$1
>          at java.lang.Class.getDeclaringClass(Native Method)
>          at java.lang.Class.getEnclosingClass(Class.java:1085)
> ....
>
> Full list of exceptions here: https://gist.github.com/3172203

the class should be there unless it is either a damaged jar or osgi is 
making its hands bloody here... and I get the feeling that is osgi related

bye blackdrag

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jamie Echlin | 25 Jul 2012 09:11
Picon
Gravatar

Re: [groovy-user] can't shutdown java web app containing groovy jar



I have a web app (jira), to which I have added the groovy-all.jar, in an
OSGi bundle.

what version of Groovy?

1.8.5.

> the class should be there unless it is either a damaged jar or osgi is making its hands bloody here... and I get the feeling that is osgi related

I think it must be, as the previous exception is:

2012-07-24 21:28:11,762 Thread-44 ERROR      [osgi.container.felix.FelixOsgiContainerManager] JarContent: Unable to read bytes.
java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:416)

(you can see the full trace in the gist).

It's like the OSGi container is closing the jar files, then deciding that it needs GroovyCategorySupport, but I don't know why. Somehow groovy registers some code to be run on shutdown with the OSGi container?? No idea.

cheers, jamie


Jochen Theodorou | 25 Jul 2012 10:06
Picon
Gravatar

Re: [groovy-user] can't shutdown java web app containing groovy jar

Am 25.07.2012 09:11, schrieb Jamie Echlin:
[...]
> It's like the OSGi container is closing the jar files, then deciding
> that it needs GroovyCategorySupport, but I don't know why. Somehow
> groovy registers some code to be run on shutdown with the OSGi
> container?? No idea.

Groovy has in that class some thread local data. Normally that should be 
removed before you hide the classes using osgi.

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jamie Echlin | 25 Jul 2012 17:19
Picon
Gravatar

Re: [groovy-user] can't shutdown java web app containing groovy jar

>  Groovy has in that class some thread local data. Normally that should be removed before you hide the classes using osgi.

Yeah, I saw that. So you do think this is a bug in tomcat, in groovy, in felix, or in java, or something else? Or is there something I can do to clear it... there doesn't seem to be any public method for getting the THREAD_INFO field.


cheers, jamie

Gmane