Vaadin 图表 -ClassNotFoundException:com.vaadin.ui.AbstractComponent

Vaadin Charts -ClassNotFoundException: com.vaadin.ui.AbstractComponent

我写了一个小型演示 Web 应用程序,我可以 运行 在 tomcat 服务器上显示 vaadin 图表。

当我重新启动服务器并首次加载应用程序时,它可以正常工作。一旦我更改了代码并且应用程序应该会自动重新部署,我就会在下面收到 ClassNotFoundException: com.vaadin.ui.AbstractComponent 异常。我重新编译了 widgetset,因为图表需要这个。

在添加图表之前这没有问题,所以我假设图表组件缺少某些东西,但是当我重新启动服务器时它可以正常工作,这让我感到困惑。

难道我需要在不更改图表特定代码时也不断地重新编译图表,我需要如何调整 ivy 文件才能实现这一点?

译注:

@VaadinServletConfiguration(productionMode = false, ui = DerstandarduseranalyzerUI.class, widgetset = "com.example.derstandarduseranalyzer.widgetset.DerstandarduseranalyzerWidgetset")

Widgetset gwt

<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="com.vaadin.addon.charts.Widgetset" />
<inherits name="com.vaadin.addon.timeline.gwt.TimelineWidgetSet" />

ivy.xml

<?xml version="1.0"?>
<!DOCTYPE ivy-module [
<!ENTITY vaadin.version "7.4.4">
 ]>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="com.example" module="v7proj" />
<configurations>

<conf name="default" />

<conf name="widgetset-compile" />

<conf name="nodeploy" />
</configurations>
<dependencies defaultconf="default" defaultconfmapping="default->default">
<dependency org="com.vaadin" name="vaadin-server" rev="&vaadin.version;" />
<dependency org="com.vaadin" name="vaadin-themes" rev="&vaadin.version;" />
<dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;"     conf="default->default"/>
<dependency org="javax.servlet" name="javax.servlet-api" rev="3.0.1" conf="nodeploy->default" />
<dependency org="com.vaadin" name="vaadin-testbench-api" rev="latest.release" conf="nodeploy -> default" />
<dependency org="com.vaadin" name="vaadin-client-compiled"
rev="&vaadin.version;" />
<dependency org="com.vaadin" name="vaadin-client" rev="&vaadin.version;" conf="widgetset-compile->default" />
<dependency org="com.vaadin" name="vaadin-client-compiler"   rev="&vaadin.version;" conf="widgetset-compile->default" />
</dependencies>
</ivy-module>

ivysettings.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <ivysettings>
 <settings defaultResolver="default" />
 <resolvers>
 <chain name="default">

 <ibiblio name="public" m2compatible="true" />
 <ibiblio 
 name="vaadin-addons" 
 usepoms="true" 
 m2compatible="true" 
 root="http://maven.vaadin.com/vaadin-addons" />

 <ibiblio name="vaadin-addons" usepoms="true" m2compatible="true"
 root="http://maven.vaadin.com/vaadin-addons" />


 <ibiblio name="vaadin-snapshots" usepoms="true" m2compatible="true"
 root="https://oss.sonatype.org/content/repositories/vaadin-snapshots" />

 <dual name="custom-smartsprites">
 <filesystem name="smartsprites-ivy">
 <ivy pattern="${basedir}/ivymodule/[module]-ivy-[revision].xml" />
 </filesystem>
 <url name="smartsprites-artifact">
 <artifact
 pattern="http://dev.vaadin.com/svn/versions/6.8/build/smartsprites/lib/[artifact](-[revision]).[ext]" />
 </url>
 </dual>
 </chain>
 </resolvers>
 <modules>

 <module organisation="com.carrotsearch" name="smartsprites"
 revision="0.2.3-itmill" resolver="custom-smartsprites" />
 </modules>


 </ivysettings>

错误

Apr 22, 2015 11:31:54 PM org.apache.catalina.core.StandardContext reload INFO: Reloading Context with name [/derStandardUserAnalyzer] has started Apr 22, 2015 11:31:54 PM org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks SEVERE: The web application [/derStandardUserAnalyzer] created a ThreadLocal with key of type [com.google.gson.Gson] (value [com.google.gson.Gson@e7f068c]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. Apr 22, 2015 11:31:54 PM org.apache.jasper.servlet.TldScanner scanJars INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Apr 22, 2015 11:31:54 PM org.apache.catalina.session.StandardManager startInternal SEVERE: Exception loading sessions from persistent storage java.lang.NoClassDefFoundError: com/vaadin/ui/AbstractComponent at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2450) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:852) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1262) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1145) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:74) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readClass(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.skipCustomData(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.apache.catalina.session.StandardSession.doReadObject(StandardSession.java:1634) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1099) at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:261) at org.apache.catalina.session.StandardManager.load(StandardManager.java:180) at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:460) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5238) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3821) at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292) at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5576) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1377) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1381) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1349) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.vaadin.ui.AbstractComponent at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1293) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1145)

我也时不时遇到这种情况。不是与 Vaadin 相关的问题,而是容器的问题。基本不更新了。通常重启机器(它可能挂在某处)会有所帮助;一个快速的替代方法是执行 "Project > Clear" 并在您用于 运行 / 调试(服务器选项卡)"right click > Clear" 的服务器上。 每次都做有点烦人,但对我有用。