Problems with Spring bean instantiation

I’m trying to mirgate from Vaadin 6.8 zu Vaadin 7.0.0 rc1.
But I have a problem with the instantiation of Springbeans and get following error:

29.01.2013 12:43:50 ERROR WrapperStartStopAppMain - (ContextLoaderListener.java:68)
   ContextLoaderListener.contextInitialized:  web.xml config: instantContextBuildingEnabled=true, noWebConfigLocations=classpath*:com/ecg/beanconfigs/*_config.xml, state: noWebContextnull, webContext=null
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'toDoMonitorApplication' defined in file [C:\Programme\Tomcat\apache-tomcat-5.5.29\webapps\invoice\WEB-INF\classes\com\ecg\beanconfigs\mts.invoice.ui_config.xml]
: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ecg.mts.invoice.ui.dialog.todomonitor.view.ToDoMonitorApplication]
: Constructor threw exception; nested exception is java.lang.VerifyError: (class: com/vaadin/server/Page, method: getJavaScript signature: ()Lcom/vaadin/ui/JavaScript;) Incompatible argument to function
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
...
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ecg.mts.invoice.ui.dialog.todomonitor.view.ToDoMonitorApplication]
: Constructor threw exception; nested exception is java.lang.VerifyError: (class: com/vaadin/server/Page, method: getJavaScript signature: ()Lcom/vaadin/ui/JavaScript;) Incompatible argument to function
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
	... 46 more
Caused by: java.lang.VerifyError: (class: com/vaadin/server/Page, method: getJavaScript signature: ()Lcom/vaadin/ui/JavaScript;) Incompatible argument to function
	at com.vaadin.ui.UI.<init>(UI.java:116)
	at com.vaadin.ui.UI.<init>(UI.java:162)
	at com.ecg.mts.invoice.ui.AbstractInvoiceApplication.<init>(AbstractInvoiceApplication.java:25)
	at com.ecg.mts.invoice.ui.dialog.todomonitor.view.ToDoMonitorApplication.<init>(ToDoMonitorApplication.java:17)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
	... 48 more

I have following conditions in these project: there are other Dialogs with GWT Version 2.04 in the Application and every Vaadin Dialog has its own Applicaion-Class (Vaadin 6.8) and all Vaadin Dialogs are in an own Modul

With Vaadin 6.8, I extends the Class AbstractApplicationServlet and override the methodes init, getAppliacationClass and getNewApplication and define each dialog application class as Servlet in the web.xml like that
[code]



ToDoMonitorApplication
com.ecg.mts.invoice.ui.InvoiceApplicationServlet

applicationBeanName
toDoMonitorApplication



Application widgetset
widgetset
com.ecg.mts.invoice.ui.client.mts_invoice_widgetset

<servlet-mapping>
	<servlet-name>ToDoMonitorApplication</servlet-name>
	<url-pattern>/toDoMonitor/*</url-pattern>
</servlet-mapping>
...

[/code]

Then I define Beans for all Dialogs in the core module

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	default-lazy-init="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

	<bean id="toDoMonitorApplication" class="com.ecg.mts.invoice.ui.dialog.todomonitor.view.ToDoMonitorApplication"
		scope="session">
		<property name="toDoMonitorDataAccess" ref="toDoMonitorDataAccess" />
	</bean>
	...
</beans>

and define Beans for all Dialogs in the Vaadin dialog module

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
        ">
        
	<bean id="toDoMonitorApplication"
		class="com.ecg.mts.invoice.ui.dialog.todomonitor.view.ToDoMonitorApplication"
		scope="singleton">
		<property name="toDoMonitorDataAccess" ref="toDoMonitorDataAccess" />
	</bean>
	...
</beans>

With Vaadin 6.8 everything works fine, but with Vaadin 7 i have not longer the possibility to override the methods getAppliacationClass and getNewApplication, because the class VaadinServlet does not contain these methods (the use of the LecaysXXX classes is no alternative for these project).

Thanks for Help

Getting the same error deploying a modified version of the Liferay Vaadin Plugin on a Liferay instance with Vaadin 7. I figured I must have an old version of vaadin.jar floating around somewhere, but I can’t see where.

Did you find a solution yet?

One idea: note that Liferay copies the JARs referenced in liferay-plugin-package.properties to the deployment directory and never cleans them up. Thus, JARs from an old project can come either from the portal, from your WAR or from an old version of the same plug-in (if having the same ID).