Apache Geronimo > Discussion Forums  User List | Dev List | Wiki | Issue Tracker  

Geronimo and Grails

View: New views
5 Messages — Rating Filter:   Alert me  

Geronimo and Grails

by michaelg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am writing an article for IBM developerWorks on using Grails and Geronimo together. However, I am unable to deploy a Grails WAR to Geronimo.

I first tried it with Geronimo 2.1.1 with Jetty. The error I got was a NoClassDefFound for org.apache.commons.fileupload.FileItemFactory. This class is the Geronimo repository, and is also included with the Grails war. It's the same version for both.

Next I tried it with Geronimo 2.1.1 with Tomcat. This time I got a dom4j InvalidXPathException.

Next I tried the Little G distribution. It worked perfectly. I had also tried standalone Tomcat with success as well, so I guess this should not have been too surprising.

Obviously I have to point a finger at Grails or Geronimo, and since it works fine on Tomcat or Little G, I am pointing the finger at Geronimo. The Geronimo/Jetty error sure smelled like a class loader problem, but I have no clue on the Geronimo/Tomcat. Note, in all cases I included a Geronimo deployment plan inside the WAR (/WEB-INF/geronimo-web.xml)

Any ideas/advice is greatly appreciated.

Re: Geronimo and Grails

by djencks :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On May 13, 2008, at 9:55 PM, michaelg wrote:

>
> I am writing an article for IBM developerWorks on using Grails and  
> Geronimo
> together. However, I am unable to deploy a Grails WAR to Geronimo.
>
> I first tried it with Geronimo 2.1.1 with Jetty. The error I got was a
> NoClassDefFound for org.apache.commons.fileupload.FileItemFactory.  
> This
> class is the Geronimo repository, and is also included with the  
> Grails war.
> It's the same version for both.
>
> Next I tried it with Geronimo 2.1.1 with Tomcat. This time I got a  
> dom4j
> InvalidXPathException.
>
> Next I tried the Little G distribution. It worked perfectly. I had  
> also
> tried standalone Tomcat with success as well, so I guess this should  
> not
> have been too surprising.
>
> Obviously I have to point a finger at Grails or Geronimo, and since  
> it works
> fine on Tomcat or Little G, I am pointing the finger at Geronimo. The
> Geronimo/Jetty error sure smelled like a class loader problem, but I  
> have no
> clue on the Geronimo/Tomcat. Note, in all cases I included a Geronimo
> deployment plan inside the WAR (/WEB-INF/geronimo-web.xml)

It doesn't matter whether the plan is included in the app or supplied  
externally.
>
>
> Any ideas/advice is greatly appreciated.

I'm surprised you are seeing different results on "big" and "little"  
geronimo.  You should be getting the same classloader for your app in  
either server.  Would it be possible to share your app so we can take  
a look at what is going on?

If I was writing an article on geronimo I would structure the project  
so it consisted of one or more geronimo plugins and would show how to  
construct a specialized server including those plugins.  This is by  
far easier if you are using maven, which I realize might not fit with  
the requirements you are working under.  There are some instructions  
on how to do something similar here:

http://cwiki.apache.org/confluence/display/GMOxDOC21/Constructing+a+special-purpose+server+using+maven

thanks
david jencks

>
> --
> View this message in context: http://www.nabble.com/Geronimo-and-Grails-tp17223357s134p17223357.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Re: Geronimo and Grails

by Gianny Damour-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have been running Grails 0.5+ applications on Geronimo 2.x and this  
works w/o problem as long as you hide specific packages. Your  
geronimo-web.xml should look like the following one:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.2">

     <environment>
         <moduleId>
             <groupId>yourGroupId</groupId>
             <artifactId>yourArtifactId</artifactId>
             <version>yourVersion</version>
             <type>war</type>
         </moduleId>

         <hidden-classes>
           <filter>org.springframework</filter>
           <filter>org.apache.cxf</filter>
           <filter>org.apache.commons</filter>
         </hidden-classes>

     </environment>

     <context-root>/yourContextPath</context-root>

</web-app>


Thanks,
Gianny


On 14/05/2008, at 2:55 PM, michaelg wrote:

>
> I am writing an article for IBM developerWorks on using Grails and  
> Geronimo
> together. However, I am unable to deploy a Grails WAR to Geronimo.
>
> I first tried it with Geronimo 2.1.1 with Jetty. The error I got was a
> NoClassDefFound for org.apache.commons.fileupload.FileItemFactory.  
> This
> class is the Geronimo repository, and is also included with the  
> Grails war.
> It's the same version for both.
>
> Next I tried it with Geronimo 2.1.1 with Tomcat. This time I got a  
> dom4j
> InvalidXPathException.
>
> Next I tried the Little G distribution. It worked perfectly. I had  
> also
> tried standalone Tomcat with success as well, so I guess this  
> should not
> have been too surprising.
>
> Obviously I have to point a finger at Grails or Geronimo, and since  
> it works
> fine on Tomcat or Little G, I am pointing the finger at Geronimo. The
> Geronimo/Jetty error sure smelled like a class loader problem, but  
> I have no
> clue on the Geronimo/Tomcat. Note, in all cases I included a Geronimo
> deployment plan inside the WAR (/WEB-INF/geronimo-web.xml)
>
> Any ideas/advice is greatly appreciated.
> --
> View this message in context: http://www.nabble.com/Geronimo-and- 
> Grails-tp17223357s134p17223357.html
> Sent from the Apache Geronimo - Users mailing list archive at  
> Nabble.com.
>


Re: Geronimo and Grails

by Joe Bohn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

David Jencks wrote:

>
> On May 13, 2008, at 9:55 PM, michaelg wrote:
>
>>
>> I am writing an article for IBM developerWorks on using Grails and
>> Geronimo
>> together. However, I am unable to deploy a Grails WAR to Geronimo.
>>
>> I first tried it with Geronimo 2.1.1 with Jetty. The error I got was a
>> NoClassDefFound for org.apache.commons.fileupload.FileItemFactory. This
>> class is the Geronimo repository, and is also included with the Grails
>> war.
>> It's the same version for both.
>>
>> Next I tried it with Geronimo 2.1.1 with Tomcat. This time I got a dom4j
>> InvalidXPathException.
>>
>> Next I tried the Little G distribution. It worked perfectly. I had also
>> tried standalone Tomcat with success as well, so I guess this should not
>> have been too surprising.
>>
>> Obviously I have to point a finger at Grails or Geronimo, and since it
>> works
>> fine on Tomcat or Little G, I am pointing the finger at Geronimo. The
>> Geronimo/Jetty error sure smelled like a class loader problem, but I
>> have no
>> clue on the Geronimo/Tomcat. Note, in all cases I included a Geronimo
>> deployment plan inside the WAR (/WEB-INF/geronimo-web.xml)
>
> It doesn't matter whether the plan is included in the app or supplied
> externally.
>>
>>
>> Any ideas/advice is greatly appreciated.
>
> I'm surprised you are seeing different results on "big" and "little"
> geronimo.  You should be getting the same classloader for your app in
> either server.  


Would it have worked in little G because little G does not include
commons-fileupload and so there is no chance of loading a class from one
classloader and using it in another?


Would it be possible to share your app so we can take a

> look at what is going on?
>
> If I was writing an article on geronimo I would structure the project so
> it consisted of one or more geronimo plugins and would show how to
> construct a specialized server including those plugins.  This is by far
> easier if you are using maven, which I realize might not fit with the
> requirements you are working under.  There are some instructions on how
> to do something similar here:
>
> http://cwiki.apache.org/confluence/display/GMOxDOC21/Constructing+a+special-purpose+server+using+maven 
>
>
> thanks
> david jencks
>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Geronimo-and-Grails-tp17223357s134p17223357.html
>> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>>
>
>


Re: Geronimo and Grails

by michaelg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The hidden classes works great for Jetty. I will make sure this is included in the IBM article so that other folks don't have this problem. Thanks for the help!


On Wed, May 14, 2008 at 4:11 AM, Gianny Damour <gianny.damour@...> wrote:
Hello,

I have been running Grails 0.5+ applications on Geronimo 2.x and this works w/o problem as long as you hide specific packages. Your geronimo-web.xml should look like the following one:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.2">

   <environment>
       <moduleId>
           <groupId>yourGroupId</groupId>
           <artifactId>yourArtifactId</artifactId>
           <version>yourVersion</version>
           <type>war</type>
       </moduleId>

       <hidden-classes>
         <filter>org.springframework</filter>
         <filter>org.apache.cxf</filter>
         <filter>org.apache.commons</filter>
       </hidden-classes>

   </environment>

   <context-root>/yourContextPath</context-root>

</web-app>


Thanks,
Gianny



On 14/05/2008, at 2:55 PM, michaelg wrote:


I am writing an article for IBM developerWorks on using Grails and Geronimo
together. However, I am unable to deploy a Grails WAR to Geronimo.

I first tried it with Geronimo 2.1.1 with Jetty. The error I got was a
NoClassDefFound for org.apache.commons.fileupload.FileItemFactory. This
class is the Geronimo repository, and is also included with the Grails war.
It's the same version for both.

Next I tried it with Geronimo 2.1.1 with Tomcat. This time I got a dom4j
InvalidXPathException.

Next I tried the Little G distribution. It worked perfectly. I had also
tried standalone Tomcat with success as well, so I guess this should not
have been too surprising.

Obviously I have to point a finger at Grails or Geronimo, and since it works
fine on Tomcat or Little G, I am pointing the finger at Geronimo. The
Geronimo/Jetty error sure smelled like a class loader problem, but I have no
clue on the Geronimo/Tomcat. Note, in all cases I included a Geronimo
deployment plan inside the WAR (/WEB-INF/geronimo-web.xml)

Any ideas/advice is greatly appreciated.
--
View this message in context: http://www.nabble.com/Geronimo-and-Grails-tp17223357s134p17223357.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.