jQuery Plugin

Deployment error on tcServer

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: Grails-jQuery 1.4.0.1
  • Fix Version/s: Grails-jQuery 1.4.0.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windws/Linux JDK 1.6, tcServer 6

Description

After changing from jquery plugin 1.3 to 1.4 application is no longer deploying correctly. During deployment exception is thrown:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'JQueryTagLib': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.springsource.tcserver.ltw.TomcatAspectJWeavingClassLoader' to required type 'groovy.lang.GroovyClassLoader' for property 'classLoader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.springsource.tcserver.ltw.TomcatAspectJWeavingClassLoader] to required type [groovy.lang.GroovyClassLoader] for property 'classLoader': no matching editors or conversion strategy found

Activity

Hide
Blazej Bucko added a comment -

By deployment I mean deploying war in tcServer v6. Running application by 'grails run-app' is working just fine.

Show
Blazej Bucko added a comment - By deployment I mean deploying war in tcServer v6. Running application by 'grails run-app' is working just fine.
Hide
Finn Herpich added a comment -

Does the same application deploy fine on the tc6 without the jQueryplugin?

Show
Finn Herpich added a comment - Does the same application deploy fine on the tc6 without the jQueryplugin?
Hide
Blazej Bucko added a comment -

I've been deploying same application with jquery plugin 1.3 and it worked ok. Problem first occured on CloudFoundry but I've replicated it on my local dev machine.

Show
Blazej Bucko added a comment - I've been deploying same application with jquery plugin 1.3 and it worked ok. Problem first occured on CloudFoundry but I've replicated it on my local dev machine.
Hide
Finn Herpich added a comment -

Ok, I will get an tc6 and do some tests.

Show
Finn Herpich added a comment - Ok, I will get an tc6 and do some tests.
Hide
Jonathan Harlap added a comment -

This issue isn't specific to Blazej's application. It can be reproduced easily by doing:

grails create-app crashTest
cd crashTest
grails install-plugin jquery
grails dev war
cp target/crashTest*.war /path/to/tomcat/webapps

Show
Jonathan Harlap added a comment - This issue isn't specific to Blazej's application. It can be reproduced easily by doing: grails create-app crashTest cd crashTest grails install-plugin jquery grails dev war cp target/crashTest*.war /path/to/tomcat/webapps
Hide
Blazej Bucko added a comment - - edited

I think that Glassfish v3 is affected as well. I've tried to deploy application and same error occured.

Show
Blazej Bucko added a comment - - edited I think that Glassfish v3 is affected as well. I've tried to deploy application and same error occured.
Hide
Jonathan Harlap added a comment -

If memory serves, Glassfish V3 is using tomcat/catalina as the app container, so it's not a huge surprise. The surprise, to me, is that grails 1.2 isn't crashing even though grails is using tomcat as its embedded container when you do grails run-app.

Show
Jonathan Harlap added a comment - If memory serves, Glassfish V3 is using tomcat/catalina as the app container, so it's not a huge surprise. The surprise, to me, is that grails 1.2 isn't crashing even though grails is using tomcat as its embedded container when you do grails run-app.
Hide
Finn Herpich added a comment -

tc 5.5 works fine here. i'll try glassfish 3 und tc6 next

Show
Finn Herpich added a comment - tc 5.5 works fine here. i'll try glassfish 3 und tc6 next
Hide
Finn Herpich added a comment -

does grails use a tc6 container?

Show
Finn Herpich added a comment - does grails use a tc6 container?
Hide
Blazej Bucko added a comment -

I believe that grails run-app is running on Tomcat 6-Snapshot. At least that's what it shows on error pages.

Show
Blazej Bucko added a comment - I believe that grails run-app is running on Tomcat 6-Snapshot. At least that's what it shows on error pages.
Hide
Blazej Bucko added a comment -

Well.. I cannot agree that it works for tomcat 5.5. I've created app from scratch and it fails same as before. Test case provided by Jonathan is reproducing this bug on both tomcat v5.5 and tomcat v6.

Show
Blazej Bucko added a comment - Well.. I cannot agree that it works for tomcat 5.5. I've created app from scratch and it fails same as before. Test case provided by Jonathan is reproducing this bug on both tomcat v5.5 and tomcat v6.
Hide
Finn Herpich added a comment -

Occours with Websphere also (http://jira.codehaus.org/browse/GRAILSPLUGINS-1888)

I will try to get some time free within the next days and check everything in detail.

Show
Finn Herpich added a comment - Occours with Websphere also (http://jira.codehaus.org/browse/GRAILSPLUGINS-1888) I will try to get some time free within the next days and check everything in detail.
Hide
Nick Zhu added a comment -

It appears caused by having the typed "GroovyClassLoader classLoader" field exposed to auto-injection in JQueryTagLib class which causes the class conversion erorr in spring since the classloader in war environment will not be a GroovyClassLoader. A quick fix will be changing the classLoader field to private hence removing the getter and setter generated by groovy, or simply inline the classLoader field since its only used to load jqueryConfig.

I have tested the private scope change on jetty and tomcat with run-war and war target, it seems to be a valid solution.

Show
Nick Zhu added a comment - It appears caused by having the typed "GroovyClassLoader classLoader" field exposed to auto-injection in JQueryTagLib class which causes the class conversion erorr in spring since the classloader in war environment will not be a GroovyClassLoader. A quick fix will be changing the classLoader field to private hence removing the getter and setter generated by groovy, or simply inline the classLoader field since its only used to load jqueryConfig. I have tested the private scope change on jetty and tomcat with run-war and war target, it seems to be a valid solution.
Hide
Finn Herpich added a comment -

Tried it and seems to work fine, thanks.

I'll provide a new release today bundled with jQuery 1.4.1

Cheers

Show
Finn Herpich added a comment - Tried it and seems to work fine, thanks. I'll provide a new release today bundled with jQuery 1.4.1 Cheers
Hide
Demian Krige added a comment -

I can confirm that the jquery plugin version 1.4.1.1 now works with Websphere 6.1

Show
Demian Krige added a comment - I can confirm that the jquery plugin version 1.4.1.1 now works with Websphere 6.1
Hide
Dmitriy Tikhvinskiy added a comment -

The problem is in constructor, so I propose another fix:
GroovyClassLoader classLoader = new GroovyClassLoader((ClassLoader) getClass().getClassLoader());

Here we specify the constructor parameter's type and everything goes ok.
Tested at jetty via war (before fix got the same error as author).

Show
Dmitriy Tikhvinskiy added a comment - The problem is in constructor, so I propose another fix: GroovyClassLoader classLoader = new GroovyClassLoader((ClassLoader) getClass().getClassLoader()); Here we specify the constructor parameter's type and everything goes ok. Tested at jetty via war (before fix got the same error as author).

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: