2016-11-24 13 views
0

にエラーを使用することは簡単です:ブラウザを介してページにアクセスしようとすると、最初のiは、古典的なエラーが発生します。念頭に置いています"jstl"依存関係を置くとTomcatエラーが発生します。 Mavenの

An Error Occurred: 
javax/servlet/jsp/jstl/core/Config 
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config 
atcom.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:344) 

フリストの事はJSTLの瓶だった、彼らPOM内のコードを入れて.xmlのその後

<dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>jstl</artifactId> 
    <version>1.2</version> 
</dependency> 

私はそのエラーを取得し、そして、私はTomcatの

GRAVE: A child container failed during start 
java.util.concurrent.ExecutionException:  org.apache.catalina.LifecycleException: 
Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/financeiro 

]]

これ以上起動することはできません。

のpom.xmlから削除デdepedency iが再びTomcatを起動することができますが、場合試みは、ページ

をacesseする際に取得するのjavax /サーブレット/ JSP/JSTL /コア/コンフィギュレーション・エラーthatt行う場合には、私のPOMとWEBファイル:

<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>javaparaweb</groupId> 
    <artifactId>financeiro</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>war</packaging> 
    <name>Financeiro</name> 
    <description>Gerenciamento Financeiro Pessoal</description> 

    <repositories> 
    <repository> 
     <id>jvnet-nexus-releases</id> 
     <name>jvnet-nexus-releases</name> 
     <url>https://maven.java.net/content/repositories/releases/</url> 
    </repository> 
    </repositories> 

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

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

    <dependency> 
    <groupId>javax.servlet</groupId> 
    <artifactId>jstl</artifactId> 
    <version>1.2</version> 
</dependency> 

    <dependency> 
     <groupId>org.glassfish</groupId> 
     <artifactId>javax.faces</artifactId> 
     <version>2.2.10</version> 
    </dependency> 

    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>5.1.0.Final</version> 
    </dependency> 

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

    <dependency> 
     <groupId>c3p0</groupId> 
     <artifactId>c3p0</artifactId> 
     <version>0.9.1.2</version> 
    </dependency> 

</dependencies> 


    <build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 
    </plugins> 
    </build> 

</project> 

ウェブファイル

<?xml version="1.0" encoding="UTF-8"?> 
<web-app 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_2_5.xsd" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     version="2.5"> 
    <display-name>financeiro</display-name> 


<welcome-file-list> 
    <welcome-file>index.jsf</welcome-file> 
    <welcome-file>index.html</welcome-file> 
    <welcome-file>index.htm</welcome-file> 
</welcome-file-list> 

    <servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.jsf</url-pattern> 
</servlet-mapping> 

<context-param> 
    <param-name>javax.faces.PROJECT_STAGE</param-name> 
    <param-value>Development</param-value> 
</context-param> 

<context-param> 
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> 
    <param-value>true</param-value> 
</context-param> 

<context-param> 
    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name> 
    <param-value>true</param-value> 
</context-param> 




</web-app> 
+0

エラーログにはそれ以上のものはありませんか?そしてなぜあなたはそれがmavenに関係していると思いますか? WEB-INF/libに直接組み込むときにこのエラーは発生しませんか? – Kukeltje

+0

あなたは奇妙な依存関係の混在しています... java-ee 7 and servlet api 2.5?それは余分なjava-ee7(サーブレット3.1 btw)を使用する必要がありますし、再度Webアプリ2.5を使用する必要がありますか?とtomcatのすべてを使用して?奇妙な...たぶんあなたはそれを最初にクリーンアップする必要がありますし、おそらくエラーが離れて行く – Kukeltje

+0

こんにちは、助けのためのthx、そして魔女1はクリーンアップする必要がありますか? – Janson

答えて

0

は、あなたのリモートリポジトリ内の間違った場所を持っているようです。 pom.xmlでロケータを変更できない場合は、次のlinkを使用して、ローカルリポジトリにjarをインストールする方法を理解できます。また、pom.xmlから<repositoryタグを削除してください。

必要なjarファイルをダウンロードできるcentral maven repositoty url http://repo1.maven.org/

関連する問題