History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-1771
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Graeme Rocher
Reporter: Jeroen Gordijn
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Grails

Making changes in a service gives ClassCastException and requires restart

Created: 01/Nov/07 07:50 AM   Updated: 21/Aug/08 04:29 AM
Component/s: Services
Affects Version/s: 1.0-RC1
Fix Version/s: 1.0-RC2

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive testService-bug-report-01112007.zip (16 kb)

Environment: Windows, OSX (Leopard)


 Description  « Hide
The problem is that making a change in the service (even adding a white space) gives a ClassCastException:

======
Message: NaamService cannot be cast to NaamService
Caused by: java.lang.ClassCastException: NaamService cannot be cast to NaamService
Class: PersonController
At Line: [12]
Code Snippet:
======

Project attached.

This is an application with a simple service and a scaffolded controller which uses the service.

1) run-app
2) make change in service (add a white space and save)
3) refresh page.
4) See ClassCastException

restart app and all works fine.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
René de Bloois - 06/Nov/07 06:17 AM
I get the same problem with my own code. I also tried it with

"boolean transactional = false"

in the service class, because I suspected it had something to do with the AOP proxy classes that Spring generates, but then I got a different message after modifying the service class:

======
Message: Failed to convert property value of type [TestService] to required type [TestService] for property 'testService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [TestService] to required type [TestService] for property 'testService': no matching editors or conversion strategy found
Caused by: Error creating bean with name 'Test1Controller': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [TestService] to required type [TestService] for property 'testService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [TestService] to required type [TestService] for property 'testService': no matching editors or conversion strategy found
Class: Unknown
At Line: [-1]
Code Snippet:
======


Jonas Grote - 20/Aug/08 10:23 AM
I still get this error in Version 1.0.3 using Ubuntu Hardy.

======
Message: Failed to convert property value of type [ParserService] to required type [ParserService] for property 'parserService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [ParserService] to required type [ParserService] for property 'parserService': no matching editors or conversion strategy found
Caused by: Error creating bean with name 'ParserController': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [ParserService] to required type [ParserService] for property 'parserService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [ParserService] to required type [ParserService] for property 'parserService': no matching editors or conversion strategy found
Class: Unknown
At Line: [-1]
Code Snippet:
======


Markus Mueller - 21/Aug/08 04:29 AM
Got the same problem. Shouldn't this issue be reopened?