Hi. What might be a problem when I get the following error? I’m using gridlayout.
Exception in thread “Thread-48” java.lang.NoClassDefFoundError: com/vaadin/ui/Form
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1394)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
Caused by: java.lang.ClassNotFoundException: com.vaadin.ui.Form
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
… 4 more
Exception in thread “Thread-47” java.lang.NoClassDefFoundError: com/vaadin/ui/Form
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1394)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
If I check the libraries that are in Java Build path, there is only one Vaadin jar.
Before the error:
Exception in thread “Thread-48” java.lang.NoClassDefFoundError: com/vaadin/ui/Form
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at etc.
I get this one:
INFO: Illegal access: this web application instance has been stopped already. Could not load com.vaadin.ui.Form. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1402)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1394)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
I’m using Liferay and these errors do not come always. That’s what makes it even more weird.
The run-time classpath on Liferay is different from your build path, and also includes the contents of all JARs mentioned in liferay-plugin-package.properties and more. If there is a shared Vaadin JAR on the portal, also your development environment should point to it, and your portlet should not contain a Vaadin JAR - at least not in WEB-INF/lib.
Note that if you have once deployed the portlet with a Vaadin JAR, the portal does not clean it up, so you might have a long history of Vaadin JARs from the project in addition to one from the portal in the deployment and temporary directories of Liferay.
Why the errors do not come always is because of varying class loading order (which classes come from which JAR), which might be caused by the operations you perform before this happens.
If I remove Vaadin jar from WEB-INF/lib, I get the following error: The method getPortletConfig() is undefined for the type PortletApplicationContext2.
I added vaadin jar from Liferay Tomcat to Java build path.
And in liferay-plugin-package.properties there is like that:
The method was added in Vaadin 6.4.0, while your Liferay installation is using an older version - perhaps 6.3.4 which was included by default in Liferay 6.0.x (you did not mention the Liferay and Vaadin versions used on the portal).
The version bundled with Liferay will be upgraded in the future. In the meanwhile, you could upgrade your own installation by hand, replacing the Vaadin JAR and the themes and widgetsets on the portal the same way you would install Vaadin in Liferay 5.2 - but noting that the configuration parameters are already set elsewhere in Liferay 6.
INFO: Illegal access: this web application instance has been stopped already. Could not load com.vaadin.ui.Form. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1402)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1412)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
09:40:26,703 INFO CalendarComponent:1407 - Oldactivity in refresh 2 null
Exception in thread “Thread-44” java.lang.NoClassDefFoundError: com/vaadin/ui/Form
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1412)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
Caused by: java.lang.ClassNotFoundException: com.vaadin.ui.Form
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
I have read somewhere that I should clean the Tomcat working directory, but how can this be done?
Stop the server. Remove the *-[my-portlet]
directories in [liferay-dir]
/[tomcat-dir]
/temp (they can contain old copies of JARs which get recopied to projects), and maybe also serialized sessions under [liferay-dir]
/[tomcat-dir]
/work/Catalina/localhost/[my-portlet]
, and restart the server.
Thank you for your good answers so far. Now I have done all the steps mentioned above and I get the following error. Liferay Portlets do not show the widgets correctly (Combobox and ProgressIndicator). I’m using Vaadin + Spring + Liferay. Somebody asked somewhere that if there is some difficulties with Vaadin + Spring + Liferay. Do you know if there is?
I get for example the following errors:
07:54:44,109 ERROR [ServletVelocityResourceListener:74] SERVLET_CONTEXT/html/themes/classic/templates/navigation.vm is not valid because does not map to a servlet context
07:54:44,125 ERROR [velocity:151]
ResourceManager : unable to find resource ‘SERVLET_CONTEXT/html/themes/classic/templates/navigation.vm’ in any resource loader.
07:54:44,125 ERROR [velocity:151] #parse(): cannot find template ‘SERVLET_CONTEXT/html/themes/classic/templates/navigation.vm’, called at SERVLET_CONTEXT/html/themes/classic/templates/portal_normal.vm[line 52, column 25]
07:54:44,125 ERROR [IncludeTag:231]
Current URL / generates exception: Unable to find resource ‘SERVLET_CONTEXT/html/themes/classic/templates/navigation.vm’
07:54:44,125 ERROR [IncludeTag:154]
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource ‘SERVLET_CONTEXT/html/themes/classic/templates/navigation.vm’
INFO: Illegal access: this web application instance has been stopped already. Could not load org.hibernate.exception.JDBCExceptionHelper. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
I got this to work by reinstalling everything. Now the only vaadin jar is in Liferay portal. But I still get the error
6.10.2010 5:59:30 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.vaadin.ui.Form. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1402)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1410)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
Exception in thread “Thread-45” java.lang.NoClassDefFoundError: com/vaadin/ui/Form
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1410)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
Caused by: java.lang.ClassNotFoundException: com.vaadin.ui.Form
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
… 4 more
Exception in thread “Thread-46” java.lang.NoClassDefFoundError: com/vaadin/ui/Form
at com.vaadin.ui.AbstractComponentContainer.requestRepaintAll(AbstractComponentContainer.java:373)
at com.vaadin.ui.AbstractComponentContainer.setEnabled(AbstractComponentContainer.java:236)
at netx.sys.view.component.calendar.CalendarComponent.refreshFromDatabase(CalendarComponent.java:1410)
at netx.sys.main.util.DatabaseThread.run(DatabaseThread.java:35)
This happens when I try to modify gridlayout from Daemon thread.