安装Vaadin后获得NoClassDefFoundError [英] Getting a NoClassDefFoundError after installing Vaadin

查看:168
本文介绍了安装Vaadin后获得NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Vaadin做一个项目,并且面临一些问题。这是我做的。



我下载了Eclipse并安装了Vaadin for Eclipse插件。然后,我创建了一个新的Vaadin 7项目。它下载了一些常春藤依赖关系,但是当我按下Run时,我得到这个错误:java.lang.NoClassDefFoundError:com / vaadin / server / VaadinServlet。



位于互联网上,但无济于事。有一点是,在网络应用程序的WEB-INF / lib文件夹中,没有jar。我附上了错误的屏幕截图以及web.xml和ivy.xml。





ivy.xml:

 <?xml version =1.0?> 
<!DOCTYPE ivy-module [
<!ENTITY vaadin.version7.1.7>
]>

< 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 organization =com.examplemodule =v7proj/>
<配置>
<! - 应该部署到服务器的默认配置 - >
< conf name =default/>
<! - 仅在编译窗口小部件集时才需要配置。如果
未被部署到服务器 - >
< conf name =widgetset-compile/>
<! - 仅用于编译服务器端类的配置。
应该部署到服务器 - >
< conf name =nodeploy/>
< / configurations>
< dependencies defaultconf =defaultdefaultconfmapping =default-> default>
<! - Vaadin的核心服务器部分 - >
< dependency org =com.vaadinname =vaadin-serverrev =& vaadin.version; />

<! - Vaadin主题 - >
< dependency org =com.vaadinname =vaadin-themesrev =& vaadin.version; />

<! - 推送支持 - >
< dependency org =com.vaadinname =vaadin-pushrev =& vaadin.version; />

<! - Servlet 3.0 API - >
< dependency org =javax.servletname =javax.servlet-apirev =3.0.1conf =nodeploy-> default/>

<! - 预编译的DefaultWidgetSet - >
< dependency org =com.vaadinname =vaadin-client-compiled
rev =& vaadin.version; />

<! - Vaadin客户端,小部件集编译所需 - >
< dependency org =com.vaadinname =vaadin-clientrev =& vaadin.version;
conf =widgetset-compile-> default/>

<! - 自定义窗口小部件集的编译器。不应该部署 - >
< dependency org =com.vaadinname =vaadin-client-compiler
rev =& vaadin.version; conf =widgetset-compile-> default/>
< / dependencies>
< / ivy-module>

ivysettings.xml:

 <?xml version =1.0encoding =UTF-8?> 
< ivysettings>
< settings defaultResolver =default/>
< resolvers>
< chain name =default>
<! - 公共Maven仓库 - >
< ibiblio name =publicm2compatible =true/>

<! - Vaadin附加存储库 - >
< ibiblio name =vaadin-addonsusepoms =truem2compatible =true
root =http://maven.vaadin.com/vaadin-addons/>

<! - Vaadin快照库 - >
< ibiblio name =vaadin-snapshotsusepoms =truem2compatible =true
root =https://oss.sonatype.org/content/repositories/vaadin-snapshots/ >
<! - 用于Vaadin修改的smartsprites库的存储库 - >
< 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>
<! - Vaadin打补丁SmartSprites - >
< module organization =com.carrotsearchname =smartsprites
revision =0.2.3-itmillresolver =custom-smartsprites/>
< / modules>


< / ivysettings>

web.xml:

 <?xml version =1.0encoding =UTF-8?> 
< web-app xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexmlns =http://java.sun.com/xml/ns/javaeexsi :schemaLocation =http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsdid =WebApp_IDversion =3.0 >
< display-name> ScanAir< / display-name>
< welcome-file-list>
< welcome-file> index.html< / welcome-file>
< welcome-file> index.htm< / welcome-file>
< welcome-file> index.jsp< / welcome-file>
< welcome-file> default.html< / welcome-file>
< welcome-file> default.htm< / welcome-file>
< welcome-file> default.jsp< / welcome-file>
< / welcome-file-list>
< / web-app>

请帮忙。我基本上没有开始代码就被卡住了。我在Windows 8.1 Pro x64与Java 7u45,Eclipse Kepler SR1和Vaadin 7.1.7

解决方案

在stackoverflow有很多问题以及关于这个错误例外的更多答案。



看看这个好网页: http://javareferencegv.blogspot.ch/2013/10/debugging-javalangnoclassdeffounderror.html


有一点是,在网络应用程序的WEB-INF / lib文件夹中,没有
jar。


这是一个很好的开始。



在eclipse中查看你的项目属性。有一个点叫部署程序集,它至少应包含这两个条目:

  / src  - > WEB-INF / classes 
/ WebContent - > /

此外,您必须将您的项目添加到tomcat服务器实例。


I want to do a project using Vaadin and am facing some issues. Here's what I did.

I downloaded Eclipse and installed the Vaadin for Eclipse plugin. Then, I created a new Vaadin 7 project. It downloaded some Ivy dependencies but then, when I pressed Run, I get this error: java.lang.NoClassDefFoundError:com/vaadin/server/VaadinServlet.

I searched a bit on the Internet but to no avail. One thing is that in the web-app's WEB-INF/lib folder, there are no jars. I have attached a screenshot of the error and also web.xml and ivy.xml.

ivy.xml:

<?xml version="1.0"?>
<!DOCTYPE ivy-module [
    <!ENTITY vaadin.version "7.1.7">
]>

<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>
        <!-- The default configuration, which should be deployed to the server -->
        <conf name="default" />
        <!-- A configuration only needed when compiling the widget set. Should 
            not be deployed to the server -->
        <conf name="widgetset-compile" />
        <!-- A configuration used in compilation of server side classes only.
            Should be deployed to the server -->
        <conf name="nodeploy" />
    </configurations>
    <dependencies defaultconf="default" defaultconfmapping="default->default">
        <!-- The core server part of Vaadin -->
        <dependency org="com.vaadin" name="vaadin-server" rev="&vaadin.version;" />

        <!-- Vaadin themes -->
        <dependency org="com.vaadin" name="vaadin-themes" rev="&vaadin.version;" />

        <!-- Push support -->
        <dependency org="com.vaadin" name="vaadin-push" rev="&vaadin.version;" />

        <!-- Servlet 3.0 API -->
        <dependency org="javax.servlet" name="javax.servlet-api" rev="3.0.1" conf="nodeploy->default" />

        <!-- Precompiled DefaultWidgetSet -->
        <dependency org="com.vaadin" name="vaadin-client-compiled"
            rev="&vaadin.version;" />

        <!-- Vaadin client side, needed for widget set compilation -->
        <dependency org="com.vaadin" name="vaadin-client" rev="&vaadin.version;"
             conf="widgetset-compile->default" />

        <!-- Compiler for custom widget sets. Should not be deployed -->
        <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">
            <!-- Public Maven repository -->
            <ibiblio name="public" m2compatible="true" />

            <!-- Vaadin Add-on repository -->
            <ibiblio name="vaadin-addons" usepoms="true" m2compatible="true"
                root="http://maven.vaadin.com/vaadin-addons" />

            <!-- Vaadin snapshots repository -->
            <ibiblio name="vaadin-snapshots" usepoms="true" m2compatible="true"
                root="https://oss.sonatype.org/content/repositories/vaadin-snapshots" />
            <!-- Repository used for Vaadin modified smartsprites library -->
            <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>
        <!-- Vaadin patched SmartSprites -->
        <module organisation="com.carrotsearch" name="smartsprites"
            revision="0.2.3-itmill" resolver="custom-smartsprites" />
    </modules>


</ivysettings>

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>ScanAir</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

Please help. I am basically stuck without even starting to code. I am on Windows 8.1 Pro x64 with Java 7u45, Eclipse Kepler SR1 and Vaadin 7.1.7

解决方案

On stackoverflow there are many questions and more answers about this error exception.

Have a look at this good webpage: http://javareferencegv.blogspot.ch/2013/10/debugging-javalangnoclassdeffounderror.html

One thing is that in the web-app's WEB-INF/lib folder, there are no jars.

This is a good point to start.

In eclipse have a look at your project properties. There is a point called "Deployment Assembly" which should contain at least these two entries:

/src          -> WEB-INF/classes
/WebContent   -> /

Moreover you must add your project to the tomcat server instance.

这篇关于安装Vaadin后获得NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆