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.

BUT…

It sometimes works sometimes doesn’t…

[b]
[u]

[/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.

[/b]
My config and Classes…

part that I think matters of my applicationContext.xml

       .
       .
       Other stuff

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

       .
       .
       Other stuff

here is the Vaadin Servlet

My Repo

[quote]

package br.com.gsc.repository.objRepos;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import br.com.gsc.model.tableMapping.Person;
import br.com.gsc.repository.AbsRepository;
import br.com.gsc.repository.objInterfaces.IPersonRepository;

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

	/**
	 * 
	 */
	private static final long serialVersionUID = -8520715359024018210L;

	@Override
	public void addPerson(Person t) {
		add(t);
	}
    
    Lot's of other stuff....



}

[/quote]

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.

Att,
Eduardo Frazão