-
Mar 27th, 2010, 06:49 PM
#1
Serialization problems with Spring injected dependencies using @Configurable
I am using Wicket 1.4.2, Spring 2.5.6 and Tomcat 6.0.
I am trying to get Spring @Configurable annotation to work with load-time-weaving (LTW) in Tomcat.
Consider the following class:
@Configurable("entityModel")
public class EntityModel extends IModel {
private MyService nonSerializableDependency;
}
This class is instantiated in the view layer and gets serialized to disk as a part of the web session.
When I perform a clean deploy of the application in Tomcat, the log files show me that EntityModel class is weaved and the application works. When I stop Tomcat I get a writeObject serialization exception because nonSerializableDependency cannot be written to disk. When I start Tomcat again I get readObject serialization exception for the same reason, but I do see that EntityModel class getting weaved.
Now, if I make nonSerializableDependency transient, then I do not see any errors when I shut down Tomcat. However, when I start Tomcat I get InvalidClassException and EntityModel does not get weaved.
This issue seems to be related to https://jira.springsource.org/browse/SPR-4302 and https://jira.springsource.org/browse/SPR-4306. The bugs have been resolved, and the later bug has "A blog explaining the new options is being written." statement, but I don't know where to find it.
Was anybody able to get serialization to work with @Configurable Spring annotation and Tomcat?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules