6 messages in org.codehaus.grails.userRe: [grails-user] [grails-users] depl...
FromSent OnAttachments
Johan Chaves SaboríoSep 11, 2007 7:16 pm 
woutersSep 11, 2007 10:54 pm 
Graeme RocherSep 12, 2007 12:05 am 
woutersSep 12, 2007 12:52 am 
Johan Chaves SaboríoSep 22, 2007 5:49 pm 
woutersSep 23, 2007 10:59 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [grails-user] [grails-users] deploying grails application in Websphere 5.XActions...
From:wouters (wsch@gmail.com)
Date:Sep 23, 2007 10:59:38 pm
List:org.codehaus.grails.user

hi,

Could you post the complete command line that produced this error?

Another catch with websphere which I did not mention is that the JDK that comes with the linux bundle has a lot of problems doing memory management for grails. We have had a lot of OutOfMemory problems that seem to be caused by heap fragmentation (websphere/ibm linux jdk for was 5.1 does not support the permsize etc... settings). The solaris version does support this, and seems to run more stable. It might take some serious tweaking of the jvm settings if you plan to run on linux.

greetings, wouter

Johan Chaves Saborío wrote:

Hi,

If I use -Dservlet.version=2.3 I get the following exception:

java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.codehaus.groovy.tools.GroovyStarter.rootLoader( GroovyStarter.java:131) at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java :160) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 1 at java.lang.String.substring(String.java(Compiled Code)) at org.codehaus.groovy.grails.commons.GrailsClassUtils.getNameFromScript( GrailsClassUtils.java:336) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:41) at java.lang.reflect.Method.invoke(Method.java:386) at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:71) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke( MetaClassHelper.java:694) at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java :721) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java :101) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod( InvokerHelper.java:115) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN( ScriptBytecodeAdapter.java:187) at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main( GrailsScriptRunner.groovy:100)

so we change the file %GRAILS_HOME%/scripts/Init.groovy in order to change de servletVersion variable to 2.3.

It seems to work, but we want to know what are we doing wrong?

On 9/12/07, wouters <wsch@gmail.com> wrote:

This workaround introduces a little overhead when upgrading grails. We added two files to scripts/ War23.groovy and Package23.groovy. We also needed to exclude a few jars from the war, so we basically duplicated the entire war task with the added EXCLUDES functionality. The Package23.groovy contains the workaround for the web.xml, and is used by War23 instead of the original Package.groovy effectively overriding the generateWebXml task with one that fixes the generated web.xml. This means that when upgrading grails these tasks should be aligned with the latest and greatest originals.

now calling: $ grails -Dservlet.version=2.3 prod war23

creates a war file that deploys in websphere (given that the other websphereisms noted on the grails website are taken into account, we use PARENT_LAST classloading).

The attached versions of the scripts are based on grails 0.5.6 and may need some tweaking for 0.6. It is not an ideal solution, but it works.

IIRC there is some code in grails that generates the web.xml which could be easily adapted to take the servlet.version into account, so that this workaround is no longer necessary. i never got around to patching it and creating an issue (we have an acceptable workaround).

HTH, wouter

graemer wrote:

Can you post your code, for the benefit of other users?

Cheers

On 9/12/07, wouters < wsch@gmail.com> wrote:

hi,

i think you can run with: -Dservlet.version=2.3 but, in 0.5.5, this still did not generate a deployable war for websphere 5.1. we had to create an alternative generateWebXml task (from Package.groovy) to 'fix' the web.xml. (Remove namespace declaration, and add 2.3 DOCTYPE). I think the namespace declaration, at least for 0.5.5, is hardcoded in the code that generates the web.xml, and ignores the servlet.versionsetting. websphere 5.1 chokes on this.

HTH, wouter

Johan Chaves Saborío wrote:

How can I deploy a grails war into a websphere 5.x server. The

problem

I'm

having is that grails generates the web.xml based on the servlet 2.4 api, but websphere is trying to use the servlet 2.3 api.

Is there any way to create the grails application with the servlet 2.3 api?

-- View this message in context:

http://www.nabble.com/-grails-users--deploying-grails-application-in-Websphere-5.X-tf4426582.html#a12629142

Sent from the grails - user mailing list archive at Nabble.com.

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

http://xircles.codehaus.org/manage_email

-- Graeme Rocher Grails Project Lead http://grails.org

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

http://xircles.codehaus.org/manage_email

http://www.nabble.com/file/p12630450/Package23.groovy Package23.groovy http://www.nabble.com/file/p12630450/War23.groovy War23.groovy -- View this message in context: http://www.nabble.com/-grails-users--deploying-grails-application-in-Websphere-5.X-tf4426582.html#a12630450

Sent from the grails - user mailing list archive at Nabble.com.

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

http://xircles.codehaus.org/manage_email