JettyプラグインでMaven3.0.3を使用しています。以下のエラーが発生します:
java.io.FileNotFoundException:ServletContextリソースを開くことができませんでした[/WEB-INF/applicationContext.xml
ファイルがに存在するため、私にはわかりませんtarget/mywar/WEB-INF/applicationContext.xml
。私はこのファイルを自分のweb.xml
:で呼び出します
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4">
<display-name>/jx-production-1.0-SNAPSHOT</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>Any ideas what I'm missing? Here is my Jetty plugin definition in my pom.xml …
<profile>
<id>jetty</id>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.2.2.v20101205</version>
<configuration>
<webAppConfig>
<contextPath>/all-new-jx</contextPath>
<descriptor>target/jx-1.0-SNAPSHOT/WEB-INF/web.xml</descriptor>
</webAppConfig>
<jettyConfig>config/jetty7/jetty.xml</jettyConfig>
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.server.handler.ContextHandler">
<contextPath>/all-new-jx-web</contextPath>
<resourceBase>${project.basedir}/target/web</resourceBase>
<handler implementation="org.eclipse.jetty.server.handler.ResourceHandler" />
</contextHandler>
</contextHandlers>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-rewrite</artifactId>
<version>7.2.2.v20101205</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
これが私が得ている長くて厄介なエラーです:
2011-08-04 14:08:56.677:WARN::コンテキストの起動に失敗しましたomjpJettyWebAppContext{/ all-new-jx、file:/ Users / davea / Documents / worksheet / NissanUSA2 / Technology / nna / mycousa / jx / src / main / webapp /}、file:/ Users / davea / Documents /ワークスペース/NissanUSA2/ Technology / nna / mycousa / jx / src / main / webapp / org.springframework.beans.factory.BeanDefinitionStoreException:ServletContextリソースからのXMLドキュメントのIOException解析[/WEB-INF/applicationContext.xml]; ネストされた例外はjava.io.FileNotFoundExceptionです:org.eclipseのorg.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:641)でServletContextリソース[/WEB-INF/applicationContext.xml]を開くことができませんでした。 jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:228)at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:
アドバイスありがとうございます。