Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit 49a4122

Browse files
committed
Merge pull request #104 from kazuki43zoo/SPR-13418
Add repro project for SPR-13418
2 parents 3affcf7 + b5d4a03 commit 49a4122

File tree

9 files changed

+527
-0
lines changed

9 files changed

+527
-0
lines changed

SPR-13418/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Repro project for SPR-0000-war-java
2+
3+
The project will be available at: http://localhost:8080/SPR-0000-war-java/
4+
5+
## Deploying
6+
7+
It is possible to deploy your application directly from the command-line
8+
using maven. You can use either [cargo](http://cargo.codehaus.org/) or
9+
the [jetty plugin](http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html)
10+
to run on a wide range of containers.
11+
12+
### Cargo
13+
14+
By default Cargo is configured to start `Tomcat7` and can be invoked by
15+
running `mvn package cargo:run`. Cargo can also run a [wide range of other
16+
containers](http://cargo.codehaus.org/Containers) and you can easily add
17+
yours by editing the `pom.xml`. For instance, a `tomcat8` profile
18+
has been added and can be invoked via `mvn package cargo:run -Ptomcat8`.
19+
20+
You can remote debug the application, in your IDE, by using the following command:
21+
`mvn package cargo:run -Ptomcat8 -Pdebug`. Note that you can customize the debug
22+
port used with the `cargo.jvm.debug.port` maven property.
23+
24+
### Jetty
25+
26+
To deploy your application to jetty9, simply invoke `mvn jetty:run`. It
27+
is possible to tune the exact jetty9 version you want to use by specifying
28+
the version of the command line, e.g. `mvn jetty:run -Djetty.version=9.0.6.v20130930`
29+
30+
To run a different version of jetty, please fallback to cargo as the
31+
coordinates of the maven plugin have changed. A sample `jetty8` profile is
32+
created for reference and can be tuned to suit your needs. To deploy your
33+
sample application to jetty8 run `mvn cargo:run -Pjetty8`
34+
35+
## Logging
36+
37+
This project contains a `log4j.properties` file in `src/main/resources` that you
38+
may wish to configure to emit more detailed logging. The root logger is set to
39+
`INFO` and a custom `org.springframework.web` logger is set to `DEBUG`.
40+
41+

SPR-13418/pom.xml

Lines changed: 308 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,308 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>org.springframework.issues</groupId>
5+
<artifactId>SPR-13418</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<name>Spring MVC Issue Reproduction Project</name>
8+
<packaging>war</packaging>
9+
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
13+
<java.version>1.8</java.version>
14+
<spring.version>4.2.1.RELEASE</spring.version>
15+
<slf4j.version>1.7.5</slf4j.version>
16+
17+
<jetty.version>9.1.2.v20140210</jetty.version>
18+
<cargo.container.id>tomcat7x</cargo.container.id>
19+
<cargo.container.url>
20+
http://www.eu.apache.org/dist/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.zip
21+
</cargo.container.url>
22+
<cargo.container.jvmargs>-Xms96m -Xmx512m -Djava.awt.headless=true</cargo.container.jvmargs>
23+
<cargo.jvm.debug.port>8000</cargo.jvm.debug.port>
24+
</properties>
25+
26+
<dependencies>
27+
<!-- Spring Framework -->
28+
<dependency>
29+
<groupId>org.springframework</groupId>
30+
<artifactId>spring-context</artifactId>
31+
<version>${spring.version}</version>
32+
<exclusions>
33+
<!-- Exclude Commons Logging in favor of SLF4j -->
34+
<exclusion>
35+
<groupId>commons-logging</groupId>
36+
<artifactId>commons-logging</artifactId>
37+
</exclusion>
38+
</exclusions>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.springframework</groupId>
42+
<artifactId>spring-webmvc</artifactId>
43+
<version>${spring.version}</version>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.springframework</groupId>
48+
<artifactId>spring-test</artifactId>
49+
<version>${spring.version}</version>
50+
</dependency>
51+
52+
<!-- Logging -->
53+
<dependency>
54+
<groupId>org.slf4j</groupId>
55+
<artifactId>slf4j-api</artifactId>
56+
<version>${slf4j.version}</version>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.slf4j</groupId>
60+
<artifactId>jcl-over-slf4j</artifactId>
61+
<version>${slf4j.version}</version>
62+
<scope>runtime</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.slf4j</groupId>
66+
<artifactId>slf4j-log4j12</artifactId>
67+
<version>${slf4j.version}</version>
68+
<scope>runtime</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>log4j</groupId>
72+
<artifactId>log4j</artifactId>
73+
<version>1.2.17</version>
74+
<scope>runtime</scope>
75+
</dependency>
76+
77+
<!-- Servlet API -->
78+
<dependency>
79+
<groupId>javax.servlet</groupId>
80+
<artifactId>javax.servlet-api</artifactId>
81+
<version>3.0.1</version>
82+
</dependency>
83+
84+
<!-- JSP API and JSTL
85+
<dependency>
86+
<groupId>javax.servlet.jsp</groupId>
87+
<artifactId>jsp-api</artifactId>
88+
<version>2.1</version>
89+
<scope>provided</scope>
90+
</dependency>
91+
<dependency>
92+
<groupId>javax.servlet</groupId>
93+
<artifactId>jstl</artifactId>
94+
<version>1.2</version>
95+
</dependency>
96+
-->
97+
98+
<!-- Apache Tiles
99+
<dependency>
100+
<groupId>org.apache.tiles</groupId>
101+
<artifactId>tiles-jsp</artifactId>
102+
<version>2.1.3</version>
103+
<exclusions>
104+
<exclusion>
105+
<groupId>commons-logging</groupId>
106+
<artifactId>commons-logging-api</artifactId>
107+
</exclusion>
108+
</exclusions>
109+
</dependency>
110+
-->
111+
112+
<!-- JSR 303 with Hibernate Validator
113+
<dependency>
114+
<groupId>javax.validation</groupId>
115+
<artifactId>validation-api</artifactId>
116+
<version>1.0.0.GA</version>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.hibernate</groupId>
120+
<artifactId>hibernate-validator</artifactId>
121+
<version>4.1.0.Final</version>
122+
</dependency>
123+
-->
124+
125+
<!-- Joda Time Library
126+
<dependency>
127+
<groupId>joda-time</groupId>
128+
<artifactId>joda-time</artifactId>
129+
<version>1.6.2</version>
130+
</dependency>
131+
<dependency>
132+
<groupId>joda-time</groupId>
133+
<artifactId>joda-time-jsptags</artifactId>
134+
<version>1.0.2</version>
135+
<scope>runtime</scope>
136+
</dependency>
137+
-->
138+
139+
<!-- Apache Commons File Upload
140+
<dependency>
141+
<groupId>commons-fileupload</groupId>
142+
<artifactId>commons-fileupload</artifactId>
143+
<version>1.2.2</version>
144+
</dependency>
145+
<dependency>
146+
<groupId>commons-io</groupId>
147+
<artifactId>commons-io</artifactId>
148+
<version>2.0.1</version>
149+
</dependency>
150+
-->
151+
152+
<!-- Jackson JSON Processor
153+
<dependency>
154+
<groupId>com.fasterxml.jackson.core</groupId>
155+
<artifactId>jackson-databind</artifactId>
156+
<version>2.4.3</version>
157+
</dependency>
158+
-->
159+
160+
<!-- Rome Atom+RSS
161+
<dependency>
162+
<groupId>rome</groupId>
163+
<artifactId>rome</artifactId>
164+
<version>1.0</version>
165+
</dependency>
166+
-->
167+
168+
<!-- Test -->
169+
<dependency>
170+
<groupId>junit</groupId>
171+
<artifactId>junit</artifactId>
172+
<version>4.11</version>
173+
<scope>test</scope>
174+
</dependency>
175+
</dependencies>
176+
177+
<build>
178+
<plugins>
179+
<plugin>
180+
<groupId>org.apache.maven.plugins</groupId>
181+
<artifactId>maven-compiler-plugin</artifactId>
182+
<version>2.5.1</version>
183+
<configuration>
184+
<source>${java.version}</source>
185+
<target>${java.version}</target>
186+
</configuration>
187+
</plugin>
188+
<plugin>
189+
<groupId>org.apache.maven.plugins</groupId>
190+
<artifactId>maven-dependency-plugin</artifactId>
191+
<version>2.8</version>
192+
<executions>
193+
<execution>
194+
<id>install</id>
195+
<phase>install</phase>
196+
<goals>
197+
<goal>sources</goal>
198+
</goals>
199+
</execution>
200+
</executions>
201+
</plugin>
202+
<plugin>
203+
<groupId>org.apache.maven.plugins</groupId>
204+
<artifactId>maven-eclipse-plugin</artifactId>
205+
<version>2.8</version>
206+
<configuration>
207+
<downloadSources>true</downloadSources>
208+
<downloadJavadocs>false</downloadJavadocs>
209+
<wtpversion>2.0</wtpversion>
210+
</configuration>
211+
</plugin>
212+
<plugin>
213+
<groupId>org.apache.maven.plugins</groupId>
214+
<artifactId>maven-surefire-plugin</artifactId>
215+
<version>2.12.4</version>
216+
<configuration>
217+
<includes>
218+
<include>**/*Tests.java</include>
219+
<include>**/*Test.java</include>
220+
</includes>
221+
<excludes>
222+
<exclude>**/*Abstract*.java</exclude>
223+
</excludes>
224+
</configuration>
225+
</plugin>
226+
<plugin>
227+
<groupId>org.eclipse.jetty</groupId>
228+
<artifactId>jetty-maven-plugin</artifactId>
229+
<version>${jetty.version}</version>
230+
</plugin>
231+
<plugin>
232+
<groupId>org.codehaus.cargo</groupId>
233+
<artifactId>cargo-maven2-plugin</artifactId>
234+
<version>1.4.7</version>
235+
<configuration>
236+
<configuration>
237+
<properties>
238+
<cargo.servlet.port>8080</cargo.servlet.port>
239+
<cargo.tomcat.ajp.port>1099</cargo.tomcat.ajp.port>
240+
<cargo.rmi.port>1099</cargo.rmi.port>
241+
<cargo.logging>medium</cargo.logging>
242+
<cargo.jvmargs>${cargo.container.jvmargs}</cargo.jvmargs>
243+
</properties>
244+
</configuration>
245+
<container>
246+
<containerId>${cargo.container.id}</containerId>
247+
<zipUrlInstaller>
248+
<url>${cargo.container.url}</url>
249+
</zipUrlInstaller>
250+
</container>
251+
</configuration>
252+
</plugin>
253+
</plugins>
254+
</build>
255+
256+
<profiles>
257+
<profile>
258+
<id>tomcat8</id>
259+
<properties>
260+
<cargo.container.id>tomcat8x</cargo.container.id>
261+
<cargo.container.url>
262+
http://www.eu.apache.org/dist/tomcat/tomcat-8/v8.0.15/bin/apache-tomcat-8.0.15.zip
263+
</cargo.container.url>
264+
</properties>
265+
</profile>
266+
<profile>
267+
<id>jetty8</id>
268+
<build>
269+
<plugins>
270+
<plugin>
271+
<groupId>org.codehaus.cargo</groupId>
272+
<artifactId>cargo-maven2-plugin</artifactId>
273+
<configuration>
274+
<container>
275+
<containerId>jetty8x</containerId>
276+
<type>embedded</type>
277+
</container>
278+
</configuration>
279+
</plugin>
280+
</plugins>
281+
</build>
282+
</profile>
283+
<profile>
284+
<id>debug</id>
285+
<properties>
286+
<cargo.container.jvmargs>
287+
-Xdebug
288+
-Xrunjdwp:transport=dt_socket,address=${cargo.jvm.debug.port},suspend=n,server=y
289+
-Xnoagent
290+
-Djava.compiler=NONE
291+
</cargo.container.jvmargs>
292+
</properties>
293+
</profile>
294+
</profiles>
295+
296+
<repositories>
297+
<repository>
298+
<id>spring-maven-snapshot</id>
299+
<name>Springframework Maven Snapshot Repository</name>
300+
<url>http://repo.spring.io/snapshot</url>
301+
<snapshots>
302+
<enabled>true</enabled>
303+
</snapshots>
304+
</repository>
305+
</repositories>
306+
307+
</project>
308+

SPR-13418/src/main/java/org/springframework/issues/.gitignore

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.springframework.issues.config;
2+
3+
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.ComponentScan;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
7+
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
8+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
9+
import org.springframework.web.servlet.view.InternalResourceViewResolver;
10+
11+
@EnableWebMvc
12+
@ComponentScan(basePackages="org.springframework.issues")
13+
@Configuration
14+
public class WebConfig extends WebMvcConfigurerAdapter {
15+
16+
@Override
17+
public void addViewControllers(ViewControllerRegistry registry) {
18+
registry.addViewController("/").setViewName("home");
19+
}
20+
21+
@Bean
22+
public InternalResourceViewResolver viewResolver() {
23+
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
24+
viewResolver.setPrefix("/WEB-INF/views/");
25+
viewResolver.setSuffix(".jsp");
26+
return viewResolver;
27+
}
28+
29+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
log4j.rootCategory=INFO, stdout
2+
3+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
4+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
5+
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
6+
7+
log4j.category.org.springframework.web=DEBUG

0 commit comments

Comments
 (0)