Vaadin + AspectJ + Spring working only with SerialID generated right before

Hi I am using Spring 3 + Spring MVC (half of the site) + Vaadin + AspectJ + JPA2 + Spring Security

My problem is that Spring creates all my Repositories and I would like to share those with Vaadin using AspectJ injection with Spring Annotations, when vaadin is started (Admin part of the site)

I have managed to make it all working after a couple days, I can use the @Configurable Spring annotation in my Vaadin Controller so It can get auto injected with my Spring context repositories,

BTW I am using Compile-Time weaving with maven, codehaus plugins and AspectJ eclipse plugin so tomcat can get the necessary libs.


It sometimes works sometimes doesn’t…


[/u]I found that when I add serializable interface to my repos it works, but only If I ask to generate the serialID and then run the app (tomcat) right after it, if I make any changes and build it again, injection is gone.

My config and Classes…

part that I think matters of my applicationContext.xml

       Other stuff

    	<context:spring-configured />
    	<context:component-scan base-package="" />
    	<mvc:annotation-driven />
    	<tx:annotation-driven transaction-manager="transactionManager"/>

       Other stuff

here is the Vaadin Servlet

My Repo



import java.util.List;

import org.springframework.stereotype.Repository;


public class PersonRepository extends AbsRepository<Person> implements IPersonRepository,Serializable{

	private static final long serialVersionUID = -8520715359024018210L;

	public void addPerson(Person t) {
    Lot's of other stuff....



Web.xml with the servlet routings and other stuff.

Hi Cristiano.

AspectJ can modify your class static structure, depending the weaving model choosed…

If a method is added, so, the signature of your classes will be changed, and using a calculated serial version uid can cause Serialization exceptions, because the UID in the class no longer matches with the new signature.

Try to add a serialVersionUID as 1L for example

private static final long serialVersionUID = 1L;

This value is ignorated by the deserialization process.

Hope it helps.

Eduardo Frazão