Tomcat 7与Vaadin,Hibernate,Eclipse和Maven 3 [英] Tomcat 7 with Vaadin, Hibernate, Eclipse and Maven 3

查看:149
本文介绍了Tomcat 7与Vaadin,Hibernate,Eclipse和Maven 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将Maven集成到我现有的Vaadin项目中。有几个错误和奇怪的事情。首先我不明白我应该怎么做才能让maven使用的tomcat实例在eclipse中可见。我的意思是说,当我运行tomcat7时:run,在eclipse中预配置的Tomcat实例停止工作。另外我无法理解哪些Tomcat实例maven使用以及为什么它会在项目文件夹中创建Tomcat配置文件,因为当我尝试在tomcat7之后在浏览器中打开应用程序时:运行我收到错误404。关于编辑Vaadin小部件的几个问题。我配置了vaadin maven插件和gwt maven插件。当我运行mvn gwt时:编译好像一切正​​常,但是当我尝试使用eclipse插件编译Vaadin小部件时,我遇到以下错误:

<$ p $使用参数执行编译器[C:\程序文件\Java\jdk1.7.0_03\bin\java.exe,-Djava.awt.headless = true,-Xss8M, - > Xmx512M,-XX:MaxPermSize = 512M,-classpath,C:\程序文件\Java\jre7\lib\resources.jar; C:\程序文件\Java\jre7\lib\ rt.jar; C:\程序文件\Java\jre7\lib\jsse.jar; C:\程序文件\Java\jre7\lib\jce.jar; C:\ Program Files \Java\jre7\lib\charsets.jar; C:\程序文件\Java\jre7\lib\ext\dnsns.jar; C:\程序文件\Java \jre7\lib\ext\localedata.jar; C:\程序文件\Java\jre7\lib\ext\sunec.jar; C:\程序文件\Java\ jre7\lib\ext\\ \\sunjce_provider.jar; C:\程序文件\Java\jre7\lib\ext\sunmscapi.jar; C:\程序文件\Java\jre7\lib\ext\zipfs的.jar; C:/波波夫/大田/ SRC /主/ JAVA; C:/波波夫/大田/ SRC /测试/ JAVA; C:/波波夫/大田/目标/类; C:/波波夫/大田/目标/测试 - 班; C:/Popov/newEclipse/eclipse/configuration/com.vaadin.integration.eclipse/download/gwt-dev/2.3.0/gwt-dev.jar; C:/Users/popov/.m2/repository/ COM /谷歌/ GWT / GWT用户/ 2.1.1 / GWT-用户2.1.1.jar; C:/Users/popov/.m2/repository/com/vaadin/vaadin/6.8.2/vaadin-6.8。 2.jar; C:/Users/popov/.m2/repository/org/vaadin/addons/refresher/1.1.1/refresher-1.1.1.jar; C:/Users/popov/.m2/repository/org/ vaadin /插件/ vaadin-颜色拾取/ 1.1.0 / vaadin-颜色拾取-1.1.0.jar; C:/Users/popov/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt- user-2.3.0.jar; C:/Users/popov/.m2/repository/com/vaadin/vaadin/6.8.8/vaadin-6.8.8.jar,-Dgwt.persistentunitcachedir = C:\Users\ popov\AppData\Local\Temp\widgetset_com.ri tmsoft.ohta.widgetset.OhtaWidgetset943bcbe5-0ae3-4759-b1c0-d878be4261f9,com.vaadin.tools.WidgetsetCompiler,-war,SRC /主/ web应用/ VAADIN /视觉元件,-deploy,C:\Users\popov\ AppData\Local\Temp\widgetset_com.ritmsoft.ohta.widgetset.OhtaWidgetset943bcbe5-0ae3-4759-b1c0-d878be4261f9,-extra,C:\Users\popov\AppData\Local\Temp\widgetset_com .ritmsoft.ohta.widgetset.OhtaWidgetset943bcbe5-0ae3-4759-b1c0-d878be4261f9,-localWorkers,2,-loglevel,INFO,com.ritmsoft.ohta.widgetset.OhtaWidgetset]
更新GWT模块描述文件...
фев12,2013下午7时36分08秒com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
产品介绍:在
com.github.wolfie.refresher.RefresherApplicationWidgetset:从类路径中发现的视觉元件jar:file:C:/Users/popov/.m2/repository/org/vaadin/addons/refresher/1.1.1/refresher-1.1.1.jar!/
com.vaadin.terminal.gwt.DefaultWidgetSet在jar中:file:C:/Users/popov/.m2/re pository / com / vaadin / vaadin / 6.8.8 / vaadin-6.8.8.jar!/
com.vaadin.addon.colorpicker.gwt.ColorPickerWidgetSet in jar:file:C:/Users/popov/.m2 /repository/org/vaadin/addons/vaadin-colorpicker/1.1.0/vaadin-colorpicker-1.1.0.jar!/
com.ritmsoft.ohta.widgetset.OhtaWidgetset in file:// C / Popov / Ohta / src / main / java

фев12,2013 7:36:08 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO:Search花费24ms
完成。
启动GWT编译器
未知参数:-war
Google Web Toolkit 2.3.0
GWTCompiler [-logLevel级别] [-workDir dir] [-gen dir] [-style style ] [-ea] [-XdisableClassMetadata] [-XdisableCastChecking] [-validateOnly] [-draftCompile] [-optimize level] [-compileReport] [-strict] [-out dir] [-localWorkers count]模块[s]

其中
-logLevel记录详细信息的级别:ERROR,WARN,INFO,TRACE,DEBUG,SPAM或ALL
-workDir编译器的内部使用工作目录(必须是可写的;缺省为系统临时目录)
-gen调试:导致正常瞬态生成的类型保存在指定的目录中
-style脚本输出样式:OBF [USCATED],PRETTY或DETAILED(默认值到OBF)
-ea调试:导致编译后的输出检查断言语句
-XdisableClassMetadata实验:禁用一些java.lang.Class方法(例如getName())
-XdisableCastChecking试验:禁止对转换操作进行运行时检查
-validateOnly验证所有源代码,但不编译
-draftCompile启用更快,但优化程度较低的编译
-optimize设置编译器使用的优化级别。 0 =无9 =最大值。
-compileReport创建一个编译报告,告诉编译的故事
-strict只有当没有输入文件有错误时才会成功
-out将输出文件写入的目录(默认为当前)
-localWorkers编译置换时使用的本地工人数

module [s]指定编译
的模块的名称Widgetset编译失败

否则,如果我使用mvn gwt:compile编译小部件,然后使用maven构建战争并部署它,在浏览器中收到空页面。


当我试图在服务器上运行应用程序时,我有以下例外:

 警告:[SetContextPropertiesRule] {Context}将属性'source'设置为'org.eclipse.jst.j2ee.server:Ohta'没有找到匹配的属性。 
фев12,2013 7:55:08 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE:ContainerBase.addChild:start:
org.apache.catalina.LifecycleException:失败开始组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ Ohta]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache .catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core .StandardHost.addChild(StandardHost.java:633)
位于org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
位于org.apache.catalina.startup.HostConfig $ DeployDescriptor .run(HostConfig.java:1637)
at java.util.concurrent.Executors $ RunnableAdapter.call(Unknown Source)$ b $ at java.util.concurrent.FutureTask $ Sync.innerRun(Unknown Source)
在java.util.concurrent.FutureTask.ru n(未知源)
在java.util.concurrent.ThreadPoolExecutor.runWorker(未知源)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知源)
在java。 lang.Thread.run(Unknown Source)
导致:java.lang.NoClassDefFoundError:org / hibernate / HibernateException $ b在java.lang.Class.getDeclaredFields0(本地方法)$ b $在java。 lang.Class.privateGetDeclaredFields(Unknown Source)
位于java.lang.Class.getDeclaredFields(Unknown Source)
位于org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
。在org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)在org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations
(WebAnnotationSet.java:140)
。在组织.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
at org.apache.catalina.startup.ContextConfig.applicationAnnotations配置(ContextConfig.java:405)
在org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
在org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig。 Java的:369),美元,org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119 b $ b)
在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
导致:java.lang.ClassNotFoundException:org.hibernate.HibernateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 25 more

呃12,2013 7:55:08 PM org.apache。 catalina.startup.HostConfig deployDescriptor
严重:部署配置描述符C:\Popov\Soft\conf\Catalina\localhost\Ohta.xml时出错
java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina。 LifecycleException:未能启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ Ohta]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache .catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
位于org.apache.catalina.startup.HostConfig $ DeployDescriptor.run(HostConfig.java:1637)
位于java.util.concurrent .Executors $ RunnableAdapter.call(未知源)
在java.util.concurrent.FutureTask $ Sync.innerRun(未知源)
在java.util.concurrent.FutureTask.run(未知源)
在java.util.concurrent.ThreadPoolExecutor.runWorker(未知源)
在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知源)
在java.lang.Thread.run(未知源)

有我的pom.xml

 < project xmlns =http://maven.apache.org/POM/4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-实例
xsi:schemaLocation =http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">
< modelVersion> 4.0.0< / modelVersion>

< groupId> com.ritmsoft< / groupId>
< artifactId> Ohta< / artifactId>
< version> 1.0< / version>
<包装>战争< / packaging>

< name> Ohta< / name>
< url> http://maven.apache.org< / url>

<属性>
< project.build.sourceEncoding> UTF-8< /project.build.sourceEncoding>
< / properties>

< build>
< sourceDirectory> src / main / java< / sourceDirectory>
<资源>
< resource>
<目录> src / main / java< / directory>
<排除>
< exclude> ** / *。java< / exclude>
< /不包括>
< / resource>
< /资源>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.5.1< / version>
<配置>
< source> 1.7< / source>
< target> 1.7< / target>
<编码> UTF-8< /编码>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-deploy-plugin< / artifactId>
< version> 2.7< / version>

< / plugin>
< plugin>
< groupId> org.apache.tomcat.maven< / groupId>
< artifactId> tomcat7-maven-plugin< / artifactId>
< version> 2.0< / version>
<执行次数>
<执行>< /执行>
< /执行次数>
<配置>
< url> http://127.0.0.1:8080 / manager / text< / url>
< server> local_tomcat< / server>
<路径> /太空< /路径>
< username> tomcat< / username>
< port> 8080< / port>
< username> tomcat< / username>
< password> s3cret< / password>
< warFile> $ {} project.build.directory /Ohta.war</warFile>
< / configuration>
< / plugin>
< plugin>
< groupId> com.vaadin< / groupId>
< artifactId> vaadin-maven-plugin< / artifactId>
< version> 1.0.2< / version>
<执行次数>
<执行>
<阶段>生成资源< /阶段>
<目标>
< goal> update-widgetset< / goal>
< /目标>
< /执行>
< /执行次数>
< / plugin>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> gwt-maven-plugin< / artifactId>
< version> 2.3.0< / version>
<配置>
< webappDirectory> $ {basedir} / src / main / webapp / VAADIN / widgetsets /< / webappDirectory>
< extraJvmArgs> -Xmx512M -Xss1024k< / extraJvmArgs>
< deploy> $ {project.build.directory} / gwt-tmp /< / deploy>
< soyc> false< / soyc>
< force> true< / force>
< strict> true< / strict>
< style> OBFUSCATED< / style>
< optimizationLevel> 9< /优化等级>
< / configuration>
<执行次数>
<执行>
<阶段>生成资源< /阶段>
<目标>
<目标>资源< /目标>
< goal>编译< / goal>
< /目标>
< /执行>
< /执行次数>
< / plugin>

< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-war-plugin< / artifactId>
< version> 2.2< / version>
<配置>
< webXml> webContent \WEB-INF\web.xml< / webXml>
< warName> Ohta< / warName>

< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-resources-plugin< / artifactId>
< version> 2.5< / version>
<配置>
<编码> UTF-8< /编码>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-eclipse-plugin< / artifactId>
< version> 2.9< / version>
<继承> true< /继承>
<配置>
< classpathContainers>
< classpathContainer> org.eclipse.jdt.launching.JRE_CONTAINER< / classpathContainer>
< classpathContainer> rg.eclipse.jst.server.core.container / org.eclipse.jst.server.tomcat.runtimeTarget / Apache
Tomcat v7.0< / classpathContainer>
< / classpathContainers>
< / configuration>
< / plugin>

< / plugins>

< pluginManagement>
< plugins>
< plugin>
< groupId> org.eclipse.m2e< / groupId>
< artifactId>生命周期映射< / artifactId>
< version> 1.0.0< / version>
<配置>
< lifecycleMappingMetadata>
< pluginExecutions>
< pluginExecution>
< pluginExecutionFilter>
< groupId> com.vaadin< / groupId>
< artifactId>
vaadin-maven-plugin
< / artifactId>
< versionRange>
[1.0.2,)
< / versionRange>
<目标>
< goal> update-widgetset< / goal>
< /目标>
< / pluginExecutionFilter>
< action>
< ignore>< / ignore>
< / action>
< / pluginExecution>
< / pluginExecutions>
< / lifecycleMappingMetadata>
< / configuration>
< / plugin>
< / plugins>
< / pluginManagement>
< / build>
< pluginRepositories>
< pluginRepository>
< id> codehaus-snapshots< / id>
< url> http://nexus.codehaus.org/snapshots< / url>
<快照>
< enabled> true< / enabled>
< / snapshots>
<发布>
<启用> false< / enabled>
< / releases>
< / pluginRepository>
< / pluginRepositories>
< repositories>
< repository>
< id> vaadin-addons< / id>
< url> http://maven.vaadin.com/vaadin-addons< / url>
< / repository>
< repository>
< id> jboss-public-repository-group< / id>
< name> JBoss公共存储库组< /名称>
< url> http://repository.jboss.org/nexus/content/groups/public/< / url>
< layout>预设< / layout>
<发布>
< enabled> true< / enabled>
< updatePolicy>始终< / updatePolicy>
< / releases>
<快照>
< enabled> true< / enabled>
< updatePolicy>始终< / updatePolicy>
< / snapshots>
< / repository>
< / repositories>
<依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 4.1.9.Final< / version>
< /依赖关系>
< dependency>
< groupId> com.vaadin< / groupId>
< artifactId> vaadin< / artifactId>
< version> 6.8.8< / version>
< /依赖关系>
< dependency>
< groupId> org.vaadin.addons< / groupId>
< artifactId> vaadin-colorpicker< / artifactId>
< version> 1.1.0< / version>
< /依赖关系>
< dependency>
< groupId> org.vaadin.addons< / groupId>
< artifactId>刷新< / artifactId>
< version> 1.1.1< / version>
< /依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> javax.servlet-api< / artifactId>
< version> 3.0.1< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> org.apache.commons< / groupId>
< artifactId> commons-lang3< / artifactId>
< version> 3.1< / version>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> 1.6.4< / version>
< /依赖关系>
< dependency>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.10< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> com.mchange< / groupId>
< artifactId> c3p0< / artifactId>
< version> 0.9.2-pre7< / version>
< /依赖关系>
< dependency>
< groupId> org.glassfish.metro< / groupId>
< artifactId> webservices-rt< / artifactId>
< version> 2.2< / version>
< /依赖关系>
< dependency>
< groupId> com.google.gwt< / groupId>
< artifactId> gwt-user< / artifactId>
< version> 2.3.0< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.22< / version>
< /依赖关系>
< /依赖关系>
< / project>

请帮助我。

解决方案

另请参阅我在 https://stackoverflow.com/a/25386703/1465758



可能你必须在maven中添加jar。


I'm trying to integrate maven in my existing Vaadin project. There is several errors and weird things. First of all I can't understand what I should do to make tomcat instance used by maven is visible in eclipse. I mean that when I run tomcat7:run, Tomcat instance, preconfigured in eclipse, stays stoped. Also I can't understand which Tomcat instance maven uses and why it creates Tomcat configuration files in project folder, because when I'm trying to open application in browser after tomcat7:run I recieve error 404.
By the way there are several questions about compilation of Vaadin widgets. I configured vaadin maven plugin and gwt maven plugin. When I'm running mvn gwt:compile it seems that everything is ok, but when I'm trying to compile Vaadin widgets using eclipse plugin I have the following error

Executing compiler with parameters [C:\Program Files\Java\jdk1.7.0_03\bin\java.exe, -Djava.awt.headless=true, -Xss8M, -Xmx512M, -XX:MaxPermSize=512M, -classpath, C:\Program Files\Java\jre7\lib\resources.jar;C:\Program Files\Java\jre7\lib\rt.jar;C:\Program Files\Java\jre7\lib\jsse.jar;C:\Program Files\Java\jre7\lib\jce.jar;C:\Program Files\Java\jre7\lib\charsets.jar;C:\Program Files\Java\jre7\lib\ext\dnsns.jar;C:\Program Files\Java\jre7\lib\ext\localedata.jar;C:\Program Files\Java\jre7\lib\ext\sunec.jar;C:\Program Files\Java\jre7\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jre7\lib\ext\sunmscapi.jar;C:\Program Files\Java\jre7\lib\ext\zipfs.jar;C:/Popov/Ohta/src/main/java;C:/Popov/Ohta/src/test/java;C:/Popov/Ohta/target/classes;C:/Popov/Ohta/target/test-classes;C:/Popov/newEclipse/eclipse/configuration/com.vaadin.integration.eclipse/download/gwt-dev/2.3.0/gwt-dev.jar;C:/Users/popov/.m2/repository/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar;C:/Users/popov/.m2/repository/com/vaadin/vaadin/6.8.2/vaadin-6.8.2.jar;C:/Users/popov/.m2/repository/org/vaadin/addons/refresher/1.1.1/refresher-1.1.1.jar;C:/Users/popov/.m2/repository/org/vaadin/addons/vaadin-colorpicker/1.1.0/vaadin-colorpicker-1.1.0.jar;C:/Users/popov/.m2/repository/com/google/gwt/gwt-user/2.3.0/gwt-user-2.3.0.jar;C:/Users/popov/.m2/repository/com/vaadin/vaadin/6.8.8/vaadin-6.8.8.jar, -Dgwt.persistentunitcachedir=C:\Users\popov\AppData\Local\Temp\widgetset_com.ritmsoft.ohta.widgetset.OhtaWidgetset943bcbe5-0ae3-4759-b1c0-d878be4261f9, com.vaadin.tools.WidgetsetCompiler, -war, src/main/webapp/VAADIN/widgetsets, -deploy, C:\Users\popov\AppData\Local\Temp\widgetset_com.ritmsoft.ohta.widgetset.OhtaWidgetset943bcbe5-0ae3-4759-b1c0-d878be4261f9, -extra, C:\Users\popov\AppData\Local\Temp\widgetset_com.ritmsoft.ohta.widgetset.OhtaWidgetset943bcbe5-0ae3-4759-b1c0-d878be4261f9, -localWorkers, 2, -logLevel, INFO, com.ritmsoft.ohta.widgetset.OhtaWidgetset]
Updating GWT module description file...
фев 12, 2013 7:36:08 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Widgetsets found from classpath:
    com.github.wolfie.refresher.RefresherApplicationWidgetset in jar:file:C:/Users/popov/.m2/repository/org/vaadin/addons/refresher/1.1.1/refresher-1.1.1.jar!/
    com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:C:/Users/popov/.m2/repository/com/vaadin/vaadin/6.8.8/vaadin-6.8.8.jar!/
    com.vaadin.addon.colorpicker.gwt.ColorPickerWidgetSet in jar:file:C:/Users/popov/.m2/repository/org/vaadin/addons/vaadin-colorpicker/1.1.0/vaadin-colorpicker-1.1.0.jar!/
    com.ritmsoft.ohta.widgetset.OhtaWidgetset in file://C/Popov/Ohta/src/main/java

фев 12, 2013 7:36:08 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Search took 24ms
Done.
Starting GWT compiler
Unknown argument: -war
Google Web Toolkit 2.3.0
GWTCompiler [-logLevel level] [-workDir dir] [-gen dir] [-style style] [-ea] [-XdisableClassMetadata] [-XdisableCastChecking] [-validateOnly] [-draftCompile] [-optimize level] [-compileReport] [-strict] [-out dir] [-localWorkers count] module[s] 

where 
  -logLevel               The level of logging detail: ERROR, WARN, INFO, TRACE, DEBUG, SPAM, or ALL
  -workDir                The compiler's working directory for internal use (must be writeable; defaults to a system temp dir)
  -gen                    Debugging: causes normally-transient generated types to be saved in the specified directory
  -style                  Script output style: OBF[USCATED], PRETTY, or DETAILED (defaults to OBF)
  -ea                     Debugging: causes the compiled output to check assert statements
  -XdisableClassMetadata  EXPERIMENTAL: Disables some java.lang.Class methods (e.g. getName())
  -XdisableCastChecking   EXPERIMENTAL: Disables run-time checking of cast operations
  -validateOnly           Validate all source code, but do not compile
  -draftCompile           Enable faster, but less-optimized, compilations
  -optimize               Sets the optimization level used by the compiler.  0=none 9=maximum.
  -compileReport          Create a compile report that tells the Story of Your Compile
  -strict                 Only succeed if no input files have errors
  -out                    The directory to write output files into (defaults to current)
  -localWorkers           The number of local workers to use when compiling permutations
and 
  module[s]               Specifies the name(s) of the module(s) to compile
Widgetset compilation failed

Otherwise, if I compile widgets using mvn gwt:compile and after that build war using maven and deploy it I recieve en empty page in browser.

Also when I'm trying to run application as run on server I have the following exception

WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:Ohta' did not find a matching property.
фев 12, 2013 7:55:08 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Ohta]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/HibernateException
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Unknown Source)
    at java.lang.Class.getDeclaredFields(Unknown Source)
    at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
    at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
    at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
    at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
    at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 11 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.HibernateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    ... 25 more

фев 12, 2013 7:55:08 PM org.apache.catalina.startup.HostConfig deployDescriptor
SEVERE: Error deploying configuration descriptor C:\Popov\Soft\conf\Catalina\localhost\Ohta.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Ohta]]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

There is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.ritmsoft</groupId>
    <artifactId>Ohta</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>

    <name>Ohta</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.7</version>

            </plugin>
            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.0</version>
                <executions>
                    <execution></execution>
                </executions>
                <configuration>
                    <url>http://127.0.0.1:8080/manager/text</url>
                    <server>local_tomcat</server>
                    <path>/Ohta</path>
                    <username>tomcat</username>
                    <port>8080</port>
                    <username>tomcat</username>
                    <password>s3cret</password>
                    <warFile> ${project.build.directory}/Ohta.war</warFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>1.0.2</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>update-widgetset</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>2.3.0</version>
                <configuration>
                    <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets/</webappDirectory>
                    <extraJvmArgs>-Xmx512M -Xss1024k </extraJvmArgs>
                    <deploy>${project.build.directory}/gwt-tmp/</deploy>
                    <soyc>false</soyc>
                    <force>true</force>
                    <strict>true</strict>
                    <style>OBFUSCATED</style>
                    <optimizationLevel>9</optimizationLevel>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>resources</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <webXml>webContent\WEB-INF\web.xml</webXml>
                    <warName>Ohta</warName>

                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <inherited>true</inherited>
                <configuration>
                    <classpathContainers>
                        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
                        <classpathContainer>rg.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache
                            Tomcat v7.0</classpathContainer>
                    </classpathContainers>
                </configuration>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.vaadin</groupId>
                                        <artifactId>
                                            vaadin-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>update-widgetset</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <pluginRepositories>
        <pluginRepository>
            <id>codehaus-snapshots</id>
            <url>http://nexus.codehaus.org/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <repositories>
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>http://repository.jboss.org/nexus/content/groups/public/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.1.9.Final</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
            <version>6.8.8</version>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>vaadin-colorpicker</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>refresher</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.4</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.2-pre7</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.metro</groupId>
            <artifactId>webservices-rt</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt-user</artifactId>
            <version>2.3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.22</version>
        </dependency>
    </dependencies>
</project>

Help me, please.

解决方案

See also my answer at https://stackoverflow.com/a/25386703/1465758

May be you must add the jar's in maven.

这篇关于Tomcat 7与Vaadin,Hibernate,Eclipse和Maven 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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