2014-10-31 120 views
0

你好我是有日食朱諾和Tomcat一個maven EE項目7.一切工作正常,然後我對Tomcat服務器上層次移動到tomcat現在8遷移從Tomcat 7到Tomcat 8

我必須下載月食月神,所以我做到了,並配置了我的項目在月食月神tomcat 8。但我收到四條消息。

Cannot change version of project facet Dynamic Web Module to 3.0. 
JavaServer Faces 2.2 can not be installed : One or more constraints have not been satisfied. 
JavaServer Faces 2.2 requires Dynamic Web Module 2.5 or newer. 
One or more constraints have not been satisfied. 

我的web.xml文件:

<web-app xmlns="http://java.sun.com/xml/ns/javaee" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
      version="3.0"> 
... 
</web-app> 

我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/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>xyz</groupId> 
    <artifactId>xyz</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>svc Maven Webapp</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 
     <dependency> 
      <groupId>com.github.ptgoetz</groupId> 
      <artifactId>storm-signals</artifactId> 
      <version>0.2.0</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.storm</groupId> 
      <artifactId>storm-core</artifactId> 
      <version>0.9.1-incubating</version> 
     </dependency> 

     <dependency> 
      <groupId>junit</groupId> 
      <artifactId>junit</artifactId> 
      <version>4.8.2</version> 
      <scope>test</scope> 
     </dependency> 

     <dependency> 
      <groupId>commons-configuration</groupId> 
      <artifactId>commons-configuration</artifactId> 
      <version>1.6</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.hadoop</groupId> 
      <artifactId>hadoop-client</artifactId> 
      <version>2.2.0</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.hbase</groupId> 
      <artifactId>hbase-client</artifactId> 
      <version>0.98.4-hadoop2</version> 
     </dependency> 

     <dependency> 
      <groupId>org.apache.zookeeper</groupId> 
      <artifactId>zookeeper</artifactId> 
      <version>3.4.6</version> 
     </dependency> 

     <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>3.0.1</version> 
    </dependency> 

     <dependency> 
      <groupId>mysql</groupId> 
      <artifactId>mysql-connector-java</artifactId> 
      <version>5.1.32</version> 
     </dependency> 

     <dependency> 
      <groupId>com.googlecode.json-simple</groupId> 
      <artifactId>json-simple</artifactId> 
      <version>1.1.1</version> 
     </dependency> 

     <dependency> 
      <groupId>log4j</groupId> 
      <artifactId>log4j</artifactId> 
      <version>1.2.16</version> 
     </dependency> 

     <dependency> 
      <groupId>org.json</groupId> 
      <artifactId>json</artifactId> 
      <version>20090211</version> 
     </dependency> 

     <dependency> 
      <groupId>com.sun.jersey</groupId> 
      <artifactId>jersey-server</artifactId> 
      <version>1.8</version> 
     </dependency> 

     <dependency> 
      <groupId>com.sun.jersey</groupId> 
      <artifactId>jersey-client</artifactId> 
      <version>1.8</version> 
     </dependency> 

     <dependency> 
      <groupId>com.sun.jersey.contribs</groupId> 
      <artifactId>jersey-multipart</artifactId> 
      <version>1.8</version> 
     </dependency> 

     <dependency> 
      <groupId>com.google.code.gson</groupId> 
      <artifactId>gson</artifactId> 
      <version>2.2.4</version> 
     </dependency> 

     <dependency> 
      <groupId>redis.clients</groupId> 
      <artifactId>jedis</artifactId> 
      <version>2.0.0</version> 
     </dependency> 

     <dependency> 
      <groupId>javax</groupId> 
      <artifactId>javaee-api</artifactId> 
      <version>7.0</version> 
      <scope>provided</scope> 
     </dependency> 

     <dependency> 
      <groupId>javax.json</groupId> 
      <artifactId>javax.json-api</artifactId> 
      <version>1.0</version> 
     </dependency> 

     <dependency> 
      <groupId>org.glassfish</groupId> 
      <artifactId>javax.json</artifactId> 
      <version>1.0</version> 
      <scope>runtime</scope> 
     </dependency> 
    </dependencies> 

    <build> 
     <finalName>xyz/finalName> 
    </build> 

</project> 

加:

I S吸引了很多人,並搞砸了我的web.xml和pom.xml以及./settings文件,現在我甚至不記得我做了哪些更改,但我記得的一件事是我在juno中使用了servlet 2.5。

任何正確的方向幫助將非常感激。

UPDATE 1:

更改servlet來3.0.1。但仍然出現相同的錯誤

./settings文件夾的facet.core.xml文件。

<?xml version="1.0" encoding="UTF-8"?> 
<faceted-project> 
    <fixed facet="wst.jsdt.web"/> 
    <installed facet="java" version="1.5"/> 
    <installed facet="jst.web" version="2.3"/> 
    <installed facet="wst.jsdt.web" version="1.0"/> 
    <installed facet="jst.jaxrs" version="1.1"/> 
    <installed facet="jboss.m2" version="1.0"/> 
</faceted-project> 

當我改變jst.web到3.0,然後我又得到錯誤的動態版本不能改變項目方面的Web 3.0

+1

只是一個快速的觀察你的web.xml定義了3.0版本,但你的servlet的依賴仍然是2.5,並提升你的servlet依賴版本3.0的幫助?也可以嘗試在Eclipse中使用Project properties/Facets,並在更新依賴關係後手動將Facet Web版本設置爲3.0。 – 2014-10-31 19:26:23

+0

從Eclipse中刪除項目並再次導入。 – 2014-10-31 19:26:24

+0

@BohuslavBurghardt你的意思是將Dynamic Web Module改爲3.0?因爲在去項目屬性 - > Facet之後,我看不到Facet Web版本。 – Mr37037 2014-10-31 19:34:06

回答

2

這裏:

<dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>servlet-api</artifactId> 
    <version>2.5</version> 
</dependency> 

它應該是3.0至少從您的web.xml指定version="3.0"。但保持這種依賴可能會給你的衝突與Java EE 7.0的依賴性在這裏:

<dependency> 
    <groupId>javax</groupId> 
    <artifactId>javaee-api</artifactId> 
    <version>7.0</version> 
    <scope>provided</scope> 
</dependency> 

看起來你只是複製/粘貼/穿越你的手指,並希望一切正常。這不是你應該怎麼做的。只需導入您將使用的相關依賴關係即可。

+0

我已將servlet依賴項更改爲3.0,但仍無法正常工作。 – Mr37037 2014-10-31 19:35:33

+0

現在它的說法不能將Dynamic Web Module的版本更改爲3.0 – Mr37037 2014-10-31 19:36:26

+0

@ Mr37037您確定您的項目是Maven項目而不是動態Web項目嗎? – 2014-10-31 19:46:05

0

加入這只是解決了錯誤的pom.xml

<build> 
    <plugins> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.0.2</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
      </configuration> 
     </plugin> 
    </plugins> 
</build>