Bonjour,
J’ai essayé de dérouler le tutoriel « Tutoriel Hibernate/JPA - Spring2.5 - Tapestry5 » (du 16/12/2008 , par Loïc Frering & Baptiste Meurant)
J'arrive sans problème jusqu'à l'étape "2-3-2. Premier test avec la configuration par défaut"
La page web s'affiche, j'obtiens bien "skillbrowser Start Page"
(Au passage il ne faut pas oublier d'installer le plugin eclipse « Maven Integration for WTP » à partir de
http://m2eclipse.sonatype.org/update)
La ou ça se complique, c'est pour les parties 2-3-3. Configuration de Tapestry / 2-3-4. Page d'accueil
J'effectue les actions suivantes :
-> Modification du web.xml comme indiqué
-> Création de la classe Index.java comme indiqué
-> Création du fichier Index.tml (ici un petit doute : il est indiqué qu'il faut créer ce fichier dans src/main/resources or il me parait plus logique de le créer dans src\main\webapp)
Je démarre Tomcat, et là, patatra, j'obtiens l'erreur suivante :
Comme cette classe fait partie du package tapestry-spring, dans mon pom.xml, je décide de remplacer :
1 2 3 4 5 6 7 8 9 10 11
| <dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
par
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-spring</artifactId>
<version>${tapestry-release-version}</version>
</dependency> |
(tapestry-spring a une dépendance sur tapestry-core)
Je redemarre tomcat, et ici j'obtiens l'erreur suivante :
hum hum
En cherchant un peu, je me rend compte que "tapestry-spring 5.1.0.2" (et non pas 5.0.15) a une dépendance sur "spring-web 2.5.6" (qui contient org/springframework/web/context/WebApplicationContext)
Je tente le coup et je passe donc avec une tapestry-release-version 5.1.0.2
Je redemarre tomcat, et cette fois j'ai l'erreur suivante :
Mais dans le tutorial il n'est pas mentionné de fichier "applicationContext.xml" à configurer (est-ce implicite?)
Voilà. Pouvez vous m'aider sur ce point? Suis-je sur la bonne piste?
Merci pour votre aide!
Mon web.xml :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>SkillBrowser</display-name>
<context-param>
<!-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -->
<param-name>tapestry.app-package</param-name>
<param-value>net.ilabs.skillbrowser.web</param-value>
</context-param>
<filter>
<filter-name>app</filter-name>
<filter-class>org.apache.tapestry5.spring.TapestrySpringFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>app</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>Index</welcome-file>
</welcome-file-list>
</web-app> |
Mon pom.xml final
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>net.ilabs</groupId>
<artifactId>skillbrowser</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>skillbrowser Tapestry 5 Application</name>
<dependencies>
<!-- <dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-core</artifactId>
<version>${tapestry-release-version}</version>
</dependency> -->
<dependency>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-spring</artifactId>
<version>${tapestry-release-version}</version>
</dependency>
<!-- A dependency on either JUnit or TestNG is required, or the surefire plugin (which runs the tests)
will fail, preventing Maven from packaging the WAR. Tapestry includes a large number
of testing facilities designed for use with TestNG (<a href="http://testng.org/" target="_blank">http://testng.org/</a>), so it's recommended. -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.1</version>
<classifier>jdk15</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>skillbrowser</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<optimize>true</optimize>
</configuration>
</plugin>
<!-- Run the application using "mvn jetty:run" -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.9</version>
<configuration>
<!-- Log to the console. -->
<requestLog implementation="org.mortbay.jetty.NCSARequestLog">
<!-- This doesn't do anything for Jetty, but is a workaround for a Maven bug
that prevents the requestLog from being set. -->
<append>true</append>
</requestLog>
</configuration>
</plugin>
<!-- This changes the WAR file packaging so that what would normally go into WEB-INF/classes
is instead packaged as WEB-INF/lib/skillbrowser.jar. This is necessary for Tapestry
to be able to search for page and component classes at startup. Only
certain application servers require this configuration, please see the documentation
at the Tapestry 5 project page (<a href="http://tapestry.apache.org/tapestry5/" target="_blank">http://tapestry.apache.org/tapestry5/</a>). -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archiveClasses>true</archiveClasses>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<!-- Adds a report detailing the components, mixins and base classes defined by this module. -->
<plugins>
<plugin>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry-component-report</artifactId>
<version>${tapestry-release-version}</version>
<configuration>
<rootPackage>net.ilabs.skillbrowser</rootPackage>
</configuration>
</plugin>
</plugins>
</reporting>
<repositories>
<!-- This can be commented out when the tapestry-release-version is a not a snapshot.
The non-snapshot Tapestry artifacts are distributed through the central
repository at ibiblio. -->
<repository>
<id>tapestry-snapshots</id>
<url>http://tapestry.formos.com/maven-snapshot-repository/</url>
</repository>
<repository>
<id>codehaus.snapshots</id>
<url>http://snapshots.repository.codehaus.org</url>
</repository>
<repository>
<id>OpenQA_Release</id>
<name>OpenQA Release Repository</name>
<url>http://archiva.openqa.org/repository/releases/</url>
</repository>
</repositories>
<pluginRepositories>
<!-- As above, this can be commented out when access to the snapshot version
of a Tapestry Maven plugin is not required. -->
<pluginRepository>
<id>tapestry-snapshots</id>
<url>http://tapestry.formos.com/maven-snapshot-repository/</url>
</pluginRepository>
</pluginRepositories>
<properties>
<tapestry-release-version>5.1.0.2</tapestry-release-version>
</properties>
</project> |
Partager