Basic Spring MVC 4.0.x application using WebApplicationInitializer
instead of web.xml
.
Check out kielczewski.eu/blog!
mvn jetty:run
- Point your browser to http://localhost:8080/
Basic Spring MVC 4.0.x application using WebApplicationInitializer
instead of web.xml
.
Check out kielczewski.eu/blog!
mvn jetty:run
Please update - mvn clean install
throws the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project example-spring-initializer: Fatal error compiling: invalid target release: 1.7 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Nice Example. I was looking through the Spring 4 documentation and couldn't find a complete MVC sample that didn't use Spring Boot.
Cloned this and ran it ('mvn jetty:Run') on jdk1.7.0_75 and no pages are served from localist:8080, just your plain old "Whitelabel Error Page" complaining about a 404
For us non-maven folks =)
When I try to start with jetty (below example using jetty runner for easier example), I get a typicaly nullPointerExample as WebXmlParser is trying to access web.xml. I believe this is a problem with the app, but please correct me if I'm wrong and it's a problem with how I'm running the war.
jadekler at Jeans-MacBook-Pro in ~/workspace
$ java -jar jetty-runner.jar ~/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war
2015-02-15 20:36:31.048:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog
2015-02-15 20:36:31.049:INFO::Runner
2015-02-15 20:36:31.049:WARN::No tx manager found
2015-02-15 20:36:31.074:INFO::Deploying file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war @ /
[WebAppContext@7a07c5b4@7a07c5b4/,null,file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war]
2015-02-15 20:36:31.083:INFO::jetty-7.0.0.v20091005
2015-02-15 20:36:31.108:INFO::Extract jar:file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war!/ to /private/var/folders/15/r6j3mdp97p5247bkkj94p4v00000gn/T/Jetty_0_0_0_0_8080_example.spring.initializer.1.0.SNAPSHOT.war____.wa9uz3/webapp
2015-02-15 20:36:31.340:WARN::Failed startup of context WebAppContext@7a07c5b4@7a07c5b4/,file:/private/var/folders/15/r6j3mdp97p5247bkkj94p4v00000gn/T/Jetty_0_0_0_0_8080_example.spring.initializer.1.0.SNAPSHOT.war____.wa9uz3/webapp/,file:/Users/jadekler/workspace/example-spring-mvc-initializer/target/example-spring-initializer-1.0-SNAPSHOT.war
java.lang.NullPointerException
at org.eclipse.jetty.webapp.WebXmlProcessor.parseFragment(WebXmlProcessor.java:316)
at org.eclipse.jetty.webapp.FragmentConfiguration.parseWebFragments(FragmentConfiguration.java:93)
at org.eclipse.jetty.webapp.FragmentConfiguration.preConfigure(FragmentConfiguration.java:47)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:339)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92)
at org.eclipse.jetty.server.Server.doStart(Server.java:232)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.mortbay.jetty.runner.Runner.run(Runner.java:448)
at org.mortbay.jetty.runner.Runner.main(Runner.java:587)
2015-02-15 20:36:31.355:INFO::Started [email protected]:8080
^C2015-02-15 20:36:32.622:INFO::Shutdown hook executing
2015-02-15 20:36:32.687:INFO::Shutdown hook complete
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.