Code Monkey home page Code Monkey logo

spring-mvc-quickstart-archetype's Introduction

Spring MVC Quickstart Maven Archetype

Summary

The project is a Maven archetype for Spring MVC web application.

Generated project characteristics

  • No-xml Spring MVC web application
  • Thymeleaf, Bootstrap
  • JPA (Hibernate/HSQLDB/Spring Data JPA)
  • JUnit/Mockito
  • Spring Security
  • MongoDB (Spring Data Mongo)

Prerequisites

  • JDK 8 (tested with Java 11)
  • Maven 3 (tested with 3.6.0)

Create a project

    mvn archetype:generate \
        -DarchetypeGroupId=pl.codeleak \
        -DarchetypeArtifactId=spring-mvc-quickstart \
        -DarchetypeVersion=5.0.1 \
        -DgroupId=my.groupid \
        -DartifactId=my-artifactId \
        -Dversion=version \
        -DarchetypeRepository=http://kolorobot.github.io/spring-mvc-quickstart-archetype

Note: The above command will bootstrap a project using the archetype published here: http://kolorobot.github.io/spring-mvc-quickstart-archetype

Run the project

Navigate to newly created project directory (my-artifactId) and then run:

    mvn test tomcat7:run

Note: I do not recommend this way of running the artifact. Tomcat Maven Plugin Version 2.2 was released on 2013-11-11

Test in the browser

http://localhost:8080/

Note: No additional services are required in order to start the application. Mongo DB configuration is in place but it is not used in the code.

Create a new project in IntelliJ

  • Create new project File > New > Project
  • Click Maven on the left hand side of the new project dialog
  • Check Create from archetype
  • Click the Add Archetype button
  • Set Group Id to pl.codeleak
  • Set Artifact Id to spring-mvc-quickstart
  • Set Version to 5.0.1
  • Set Repository to http://kolorobot.github.io/spring-mvc-quickstart-archetype
  • Click next and create the project

Note: If you would like to create a project using archetype published in your local repository, skip repository field and make sure it is installed locally (see below).

Creating a new project in Spring Tool Suite

  • Create new project File > New > Maven Project
  • Make sure Create a simple project option is not selected
  • Click Next to navigate to Select an Archetype screen
  • Make sure Include snapshot archetypes is selected
  • Click Add Archetype button
  • Set Archetype Group Id to pl.codeleak
  • Set Archetype Artifact Id to spring-mvc-quickstart
  • Set Archetype Version to 5.0.1
  • Set Repository URL to http://kolorobot.github.io/spring-mvc-quickstart-archetype
  • Click OK so the Archetype is added to the list
  • Click Next and fill in Group Id, Artifact Id and Version of your new project

Note: Remember so select Include snapshot archetypes.

If you have any troubles with installation in Eclipse, you may want to have a look at this issue: #74

Install archetype locally

To install the archetype in your local repository execute the following commands:

    git clone https://github.com/kolorobot/spring-mvc-quickstart-archetype.git
    cd spring-mvc-quickstart-archetype
    mvn clean install

Create a project from a local repository

Create a new empty directory for your project and navigate into it and then run:

    mvn archetype:generate \
        -DarchetypeGroupId=pl.codeleak \
        -DarchetypeArtifactId=spring-mvc-quickstart \
        -DarchetypeVersion=5.0.1 \
        -DgroupId=my.groupid \
        -DartifactId=my-artifactId \
        -Dversion=version

Note: The above command will bootstrap a project using the archetype published in your local repository.

Switching to PostgreSQL

  • Add dependency to PostgreSQL driver in POM:
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.4.1207</version>
</dependency>
  • Change persistence.properties:
dataSource.driverClassName=org.postgresql.Driver
dataSource.url=jdbc:postgresql:postgres
dataSource.username=postgres
dataSource.password=postgres

hibernate.dialect=org.hibernate.dialect.PostgreSQL9Dialect
hibernate.hbm2ddl.auto=create
hibernate.show_sql=true
hibernate.format_sql=true
hibernate.use_sql_comments=true

Enabling MongoDB repositories

  • Open MongoConfig class and uncomment the following line:
// @EnableMongoRepositories(basePackageClasses = Application.class)

Now you can add repositories to your project:

@Repository
public interface MyRepository extends MongoRepository<MyDocument, String> {

}

spring-mvc-quickstart-archetype's People

Contributors

activequant avatar alanfranz avatar chauek avatar chris-bailey avatar christophelg avatar hansenc avatar knicholas avatar kolorobot avatar littlehans8 avatar lsiu avatar marcinmilewski avatar philnate avatar rstoyanchev avatar simbo1905 avatar tamccall avatar tomaszwojewodka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-mvc-quickstart-archetype's Issues

UserAuthenticationIntegrationTest failing

This is a very useful application to get projects off the ground. Thanks!
Here is an issue that I discovered.
Two tests (userAuthenticates and userAuthenticationFails) in UserAuthenticationIntegrationTest are failing when CSRF is turned on (<security:csrf />) in spring-security-context.xml

mvn tomcat7:run is missing messages.properties

When running from eclipse a mvn tomcat7:run (see #5) it fails to display the website as it can't find the view.index.title for en_US. Copying this file over to target/classes solves the problem. But I would find it convinient to have this included within the goal.

javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code 'view.index.title' for locale 'en_US'.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
org.apache.jsp.WEB_002dINF.views.index_jsp._jspService(index_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:65)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684)
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678)
org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
org.apache.jsp.WEB_002dINF.tiles.template_jsp._jspx_meth_tiles_005finsertAttribute_005f1(template_jsp.java:158)
org.apache.jsp.WEB_002dINF.tiles.template_jsp._jspService(template_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:64)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:65)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)

Problem creating a new maven proyect

Every time i want to create a new maven proyect in eclipse, it tells me that im missing repositories, how can i reinstall all the repositories?

this is the error im getting "could not resolve archetype com.github.spring.... from any of the configured repositories"

Vaadin Spring security csrfMatcher

Line

     security:csrf request-matcher-ref="csrfMatcher" 

in spring-security-context.xml don't allow Vaadin to work...
If I comment it it's start working as expected.

Just add depedency and create servlet like this:

public class NavigationUI extends UI {
    @Override
    protected void init(VaadinRequest request) {
        VerticalLayout v = new VerticalLayout();
        v.setMargin(true);
        v.addComponent(new Label("test passed"));

        setContent(v);
    }

    @WebServlet(value = {"/vmanager/*", "/VAADIN/*"}, asyncSupported = true, loadOnStartup = 100)
    @VaadinServletConfiguration(productionMode = false, ui = NavigationUI.class)
    public static class Servlet extends VaadinServlet {
    }
}

Can't Successfully run mvn archetype:generate command

Hi I am trying to use your project but I am having some trouble.
I am geting the error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project spring-mvc-quickstart: org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type
'pom' -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project spring-mvc-quickstart: org.apache.maven.archetype.exception.InvalidPackaging: Unable to add module to the current project as it is not of packaging type 'pom'

Is this because I am using Maven 3 and not Maven 2?

The full command I am running is

mvn archetype:generate \ -DarchetypeGroupId=com.github.spring-mvc-archetypes \ -DarchetypeArtifactId=spring-mvc-quickstart \ -DarchetypeVersion=1.0.0-SNAPSHOT \ -DgroupId=Reloader \ -DartifactId=Reloader \ -Dversion=1 -e

Maybe I am doing something incorrectly?

I did try adding pom to the root POM but that gave me a new error about \ being an invalid life-cycle.

JUnit-Test fails with Bound mismatch-Generics Error

Hi,

the dependency with version no. 4.0.0.RC2 for spring-test is invalid.

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <scope>test</scope>
    </dependency>

You get the following error in your JUnit-Classes:

"Bound mismatch: The generic method webAppContextSetup(WebApplicationContext) of type MockMvcBuilders is not applicable for the arguments (WebApplicationContext). The inferred type DefaultMockMvcBuilder<DefaultMockMvcBuilder>
is not a valid substitute for the bounded parameter ..."

Solution:

use an older spring-test dependency like so:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>4.0.0.RC1</version>
        <scope>test</scope>
    </dependency>

Best regards,
Alex

problem with th:something in the html

I'm getting the undefined attribute name (th:something) in all the tags with th, do you know how to solve this?

and, a bonus question, is it possible to use jsp instead of html on proyect creation?

Support for Eclipse

Hello,
How can we use this archtype inside Eclipse to generate web able projects ?

Switching from Apache Tiles to Thymeleaf

Using Thymeleaf instead of Apache Tiles would be a good possibility, but Thymeleaf is still to get good support on the IDE's. You should take a look, it's quite elegant and powerful.
It supports partial includes and what is more important, what is called "natural templating", providing the possibility to add server-side processing attributes (th:*) while keeping the state of the template to be run on any browser, being able to hand it back to the designer or the person responsible for the layout without getting scripting errors.

It also has integration support with Spring.

Please consider taking a look: http://www.thymeleaf.org

Cheers!

Flash messages support in the view

Once one uses FlashAttributes.addFlashAttridbute, this should be automatically displayed. The change may be added to the template.jsp, so any "message" object will be displayed properly.

Apache Tiles DTD version doesn't match tiles version defined in the pom.xml

the pom.xml use the apache tiles version is 3.0.1
but DTD reference declared in the tiles.xml and view.xml remains 2.1
these miss match can cause application failed to start while without internet connection to the apache tiles's website.
so the tiles.xml and views.xml 's DTD should be updated to:

Cloudfoundry

Hi there,
Excellent project! Just wondering why this won't start on VMware Cloud Foundry?

Cheers,
Stephen

Integrating Twitter Bootstrap?

It would be nice to have a Bootstrap (from Twitter) setup so thing would immediately look nice as you start coding in the view layer.

I know it has nothing to do with Spring, but still is a plus to have something beautiful and not intrusive from Scratch.

Even having a form example would be so useful for people starting with Spring MVC

Thanks

Method "findByUsername" used in UserServiceTest does not exist

When building the project for the first time it already complains about this method and some others that do not exist since the replacement of Username by Email

Class: UserServiceTest

Line number: 58

Line: when(accountRepositoryMock.findByUsername("user")).thenReturn(demoUser);

Running on JBoss 7.1.1

Hello,

I am trying to run the project on JBoss 7.1.1 Final. As the JBoss had Hibernate 4.0.2, I updated the module to use 4.2.5.

After running my application on my machine. The logs does not have any error. http://localhost:8080// returns 404.

I turned JBoss to Debug on org.springframework. No Errors reported.

Is there an issue, running on JBoss? I try to put a breakpoint in DispatcherServlet.doService. But its never reached on a new request.

Thank you for looking into the issue... Here is the log...

16:25:16,165 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
16:25:16,399 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
16:25:16,477 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
16:25:17,430 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
16:25:17,430 INFO [org.xnio] XNIO Version 3.0.3.GA
16:25:17,461 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
16:25:17,477 INFO [org.jboss.remoting] JBoss Remoting version 3.2.3.GA
16:25:17,493 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
16:25:17,508 INFO [org.jboss.as.configadmin](ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
16:25:17,524 INFO [org.jboss.as.clustering.infinispan](ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
16:25:17,524 INFO [org.jboss.as.naming](ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
16:25:17,539 INFO [org.jboss.as.security](ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
16:25:17,555 INFO [org.jboss.as.osgi](ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
16:25:17,555 INFO [org.jboss.as.security](MSC service thread 1-1) JBAS013100: Current PicketBox version=4.0.7.Final
16:25:17,555 INFO [org.jboss.as.connector](MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
16:25:17,571 INFO [org.jboss.as.webservices](ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
16:25:17,680 INFO [org.jboss.as.connector.subsystems.datasources](ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
16:25:17,727 INFO [org.jboss.as.naming](MSC service thread 1-4) JBAS011802: Starting Naming Service
16:25:17,758 INFO [org.jboss.as.connector.subsystems.datasources](ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.hsqldb.jdbcDriver (version 2.3)
16:25:17,789 INFO [org.jboss.as.mail.extension](MSC service thread 1-6) JBAS015400: Bound mail session [java:jboss/mail/Default]
16:25:17,883 INFO [org.apache.coyote.http11.Http11Protocol](MSC service thread 1-2) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080
16:25:17,930 INFO [org.jboss.ws.common.management.AbstractServerConfig](MSC service thread 1-7) JBoss Web Services - Stack CXF Server 4.0.2.GA
16:25:18,492 INFO [org.jboss.as.server.deployment.scanner](MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory D:\MR\Java\jboss-as-7.1.1.Final\standalone\deployments
16:25:18,492 INFO [org.jboss.as.remoting](MSC service thread 1-6) JBAS017100: Listening on localhost/127.0.0.1:4447
16:25:18,492 INFO [org.jboss.as.remoting](MSC service thread 1-8) JBAS017100: Listening on /127.0.0.1:9999
16:25:18,524 INFO [org.jboss.as.server.deployment.scanner](DeploymentScanner-threads - 1) JBAS015003: Found fullcar.war in deployment directory. To trigger deployment create a file called fullcar.war.dodeploy
16:25:18,649 INFO [org.jboss.as.connector.subsystems.datasources](MSC service thread 1-6) JBAS010400: Bound data source [java:jboss/datasources/D2DDS]
16:25:18,649 INFO [org.jboss.as.connector.subsystems.datasources](MSC service thread 1-6) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
16:25:18,664 INFO [org.jboss.as.server.deployment](MSC service thread 1-1) JBAS015876: Starting deployment of "fullcar.war"
16:25:21,757 WARN [org.jboss.as.ee](MSC service thread 1-6) JBAS011006: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.http.server.ServletServerHttpAsyncRequestControl
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

16:25:21,773 WARN [org.jboss.as.ee](MSC service thread 1-6) JBAS011006: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.springframework.web.context.request.async.StandardServletAsyncWebRequest
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

16:25:21,867 INFO [org.jboss.as.connector.deployers.jdbc](MSC service thread 1-6) JBAS010403: Deploying JDBC-compliant driver class org.hsqldb.jdbc.JDBCDriver (version 2.3)
16:25:21,960 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/fullcar]](MSC service thread 1-1) Spring WebApplicationInitializers detected on classpath: [com.mreddy.fullcar.config.WebAppSecurityInitializer@40baeb, com.mreddy.fullcar.config.WebAppInitializer@1af9c7b]
16:25:22,148 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/fullcar]](MSC service thread 1-1) Initializing Spring root WebApplicationContext
16:25:22,148 INFO [org.springframework.web.context.ContextLoader](MSC service thread 1-1) Root WebApplicationContext: initialization started
16:25:22,148 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext](MSC service thread 1-1) Refreshing Root WebApplicationContext: startup date [Tue Feb 04 16:25:22 CET 2014]; root of context hierarchy
16:25:22,195 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext](MSC service thread 1-1) Registering annotated classes: [class com.mreddy.fullcar.config.ApplicationConfig,interface com.mreddy.fullcar.config.DataSourceConfig,class com.mreddy.fullcar.config.JpaConfig,class com.mreddy.fullcar.config.SecurityConfig]
16:25:22,429 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader](MSC service thread 1-1) Loading XML bean definitions from class path resource [spring-security-context.xml]
16:25:22,757 INFO [org.springframework.security.core.SpringSecurityCoreVersion](MSC service thread 1-1) You are running with Spring Security Core 3.2.0.RELEASE
16:25:22,773 INFO [org.springframework.security.config.SecurityNamespaceHandler](MSC service thread 1-1) Spring Security 'config' module version is 3.2.0.RELEASE
16:25:22,804 INFO [org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser](MSC service thread 1-1) Creating access control expression attribute 'permitAll' for /
16:25:22,804 INFO [org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser](MSC service thread 1-1) Creating access control expression attribute 'permitAll' for /favicon.ico
16:25:22,804 INFO [org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser](MSC service thread 1-1) Creating access control expression attribute 'permitAll' for /resources/**
16:25:22,804 INFO [org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser](MSC service thread 1-1) Creating access control expression attribute 'permitAll' for /signin
16:25:22,804 INFO [org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser](MSC service thread 1-1) Creating access control expression attribute 'permitAll' for /signup
16:25:22,804 INFO [org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser](MSC service thread 1-1) Creating access control expression attribute 'isAuthenticated()' for /**
16:25:22,835 INFO [org.springframework.security.config.http.HttpSecurityBeanDefinitionParser](MSC service thread 1-1) Checking sorted filter chain: [Root bean: class [org.springframework.security.web.context.SecurityContextPersistenceFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 200, Root bean: class [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 400, Root bean: class [org.springframework.security.web.authentication.logout.LogoutFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 700, <org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0>, order = 1100, Root bean: class [org.springframework.security.web.authentication.www.BasicAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1500, Root bean: class [org.springframework.security.web.savedrequest.RequestCacheAwareFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1600, Root bean: class [org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1700, Root bean: class [org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1900, Root bean: class [org.springframework.security.web.authentication.AnonymousAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 2000, Root bean: class [org.springframework.security.web.session.SessionManagementFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 2100, Root bean: class [org.springframework.security.web.access.ExceptionTranslationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 2200, <org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0>, order = 2300]
16:25:23,007 INFO [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer](MSC service thread 1-1) Loading properties file from class path resource [persistence.properties]
16:25:23,038 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor](MSC service thread 1-1) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
16:25:23,319 INFO [org.springframework.jdbc.datasource.DriverManagerDataSource](MSC service thread 1-1) Loaded JDBC driver: org.hsqldb.jdbcDriver
16:25:23,413 INFO [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean](MSC service thread 1-1) Building JPA container EntityManagerFactory for persistence unit 'default'
16:25:23,647 INFO [org.hibernate.annotations.common.Version](MSC service thread 1-1) HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
16:25:23,663 INFO [org.hibernate.Version](MSC service thread 1-1) HHH000412: Hibernate Core {4.2.5.Final}
16:25:23,663 INFO [org.hibernate.cfg.Environment](MSC service thread 1-1) HHH000206: hibernate.properties not found
16:25:23,679 INFO [org.hibernate.cfg.Environment](MSC service thread 1-1) HHH000021: Bytecode provider name : javassist
16:25:23,897 INFO [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator](MSC service thread 1-1) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
16:25:24,350 INFO [org.hibernate.dialect.Dialect](MSC service thread 1-1) HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
16:25:24,460 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator](MSC service thread 1-1) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
16:25:24,475 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory](MSC service thread 1-1) HHH000397: Using ASTQueryTranslatorFactory
16:25:24,538 INFO [org.hibernate.validator.internal.util.Version](MSC service thread 1-1) HV000001: Hibernate Validator 4.3.0.Final
16:25:24,788 INFO [org.hibernate.tool.hbm2ddl.SchemaExport](MSC service thread 1-1) HHH000227: Running hbm2ddl schema export
16:25:24,788 INFO [org.hibernate.tool.hbm2ddl.SchemaExport](MSC service thread 1-1) HHH000230: Schema export complete
16:25:25,209 WARN [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl](MSC service thread 1-1) HHH000386: ResultSet had no statement associated with it, but was not yet registered
16:25:25,241 WARN [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl](MSC service thread 1-1) HHH000386: ResultSet had no statement associated with it, but was not yet registered
16:25:25,772 INFO [org.springframework.security.web.DefaultSecurityFilterChain](MSC service thread 1-1) Creating filter chain: org.springframework.security.web.util.matcher.AnyRequestMatcher@1, [org.springframework.security.web.context.SecurityContextPersistenceFilter@ec669f, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@458baa, org.springframework.security.web.authentication.logout.LogoutFilter@1d486aa, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@1d506ea, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@b8f5cb, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@110ff84, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@f7702d, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@e5da73, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@68e19d, org.springframework.security.web.session.SessionManagementFilter@1b438ca, org.springframework.security.web.access.ExceptionTranslationFilter@fc63fb, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@81f54]
16:25:25,803 INFO [org.springframework.security.config.http.DefaultFilterChainValidator](MSC service thread 1-1) Checking whether login URL '/signin' is accessible with your configuration
16:25:25,866 INFO [org.springframework.web.context.ContextLoader](MSC service thread 1-1) Root WebApplicationContext: initialization completed in 3718 ms
16:25:25,881 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/fullcar]](MSC service thread 1-1) Initializing Spring FrameworkServlet 'dispatcher'
16:25:25,881 INFO [org.springframework.web.servlet.DispatcherServlet](MSC service thread 1-1) FrameworkServlet 'dispatcher': initialization started
16:25:25,912 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext](MSC service thread 1-1) Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Tue Feb 04 16:25:25 CET 2014]; parent: Root WebApplicationContext
16:25:25,928 INFO [org.springframework.web.context.support.AnnotationConfigWebApplicationContext](MSC service thread 1-1) Registering annotated classes: [class com.mreddy.fullcar.config.WebMvcConfig]
16:25:26,069 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor](MSC service thread 1-1) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
16:25:26,709 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping](MSC service thread 1-1) Mapped "{[/account/current],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public com.mreddy.fullcar.account.Account com.mreddy.fullcar.account.AccountController.accounts(java.security.Principal)
16:25:26,709 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping](MSC service thread 1-1) Mapped "{[/generalError],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.mreddy.fullcar.error.CustomErrorController.generalError(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.springframework.ui.Model)
16:25:26,709 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping](MSC service thread 1-1) Mapped "{[/],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.mreddy.fullcar.home.HomeController.index(java.security.Principal)
16:25:26,709 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping](MSC service thread 1-1) Mapped "{[/signin],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.mreddy.fullcar.signin.SigninController.signin()
16:25:26,709 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping](MSC service thread 1-1) Mapped "{[/signup],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.mreddy.fullcar.signup.SignupController.signup(org.springframework.ui.Model)
16:25:26,709 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping](MSC service thread 1-1) Mapped "{[/signup],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String com.mreddy.fullcar.signup.SignupController.signup(com.mreddy.fullcar.signup.SignupForm,org.springframework.validation.Errors,org.springframework.web.servlet.mvc.support.RedirectAttributes)
16:25:26,850 INFO [org.springframework.web.servlet.DispatcherServlet](MSC service thread 1-1) FrameworkServlet 'dispatcher': initialization completed in 969 ms
16:25:26,865 INFO [org.jboss.web](MSC service thread 1-1) JBAS018210: Registering web context: /fullcar
16:25:26,865 INFO [org.jboss.as](MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990
16:25:26,865 INFO [org.jboss.as](MSC service thread 1-1) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 11013ms - Started 239 of 317 services (76 services are passive or on-demand)
16:25:26,943 INFO [org.jboss.as.server](DeploymentScanner-threads - 2) JBAS018559: Deployed "fullcar.war"
16:26:01,060 DEBUG org.springframework.security.web.FilterChainProxy / at position 1 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
16:26:01,060 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository No HttpSession currently exists
16:26:01,060 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository No SecurityContext was available from the HttpSession: null. A new one will be created.
16:26:01,060 DEBUG org.springframework.security.web.FilterChainProxy / at position 2 of 12 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 3 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 4 of 12 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 5 of 12 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 6 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 7 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 8 of 12 in additional filter chain; firing Filter: 'RememberMeAuthenticationFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
16:26:01,076 DEBUG org.springframework.security.web.authentication.AnonymousAuthenticationFilter Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
16:26:01,076 DEBUG org.springframework.security.web.util.matcher.AntPathRequestMatcher Checking match of request : '/'; against '/'
16:26:01,076 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor Secure object: FilterInvocation: URL: /; Attributes: [permitAll]
16:26:01,076 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS
16:26:01,076 DEBUG org.springframework.security.access.vote.AffirmativeBased Voter: org.springframework.security.web.access.expression.WebExpressionVoter@359214, returned: 1
16:26:01,076 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor Authorization successful
16:26:01,076 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor RunAsManager did not change Authentication object
16:26:01,076 DEBUG org.springframework.security.web.FilterChainProxy / reached end of additional filter chain; proceeding with original chain
16:26:01,076 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
16:26:01,076 DEBUG org.springframework.security.web.access.ExceptionTranslationFilter Chain processed normally
16:26:01,076 DEBUG org.springframework.security.web.context.SecurityContextPersistenceFilter SecurityContextHolder now cleared, as request processing completed

Why does Root context and dispatcher context both instantiate @Service's, @Component's, etc?

Hi Kolorobot, with the way you have setup the WebAppInitializer and WebMvcConfig it seems that everything is getting instantiated twice--once under the Root context and once as the dispatcher context. This means all database connections for Jpa and Mongo, but it also means all of your @Services, etc get instantiated twice. Why is that?

Here's my output of Tomcat7 starting up with your archetype. I added a bunch of System.out.println()'s for the overriden methods in WebAppInitializer and WebMvcConfig to watch how Tomcat goes through them.

I also added two services called MyServiceOne and MyServiceTwo to the base project just to see how/when they get instantiated. Am I doing something wrong? Or is the config not setup correctly?

INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Dec 09, 2013 4:17:44 PM org.apache.catalina.core.ApplicationContext log
INFO: Spring WebApplicationInitializers detected on classpath: [com.zipwhip.testSpring4.config.WebAppSecurityInitializer@2d9272f8, com.zipwhip.testSpring4.config.WebAppInitializer@69ba0f27]
Inside init getRootConfigClasses
Inside init getServletConfigClasses
Inside init getServletMappings
Inside init getServletFilters
Inside init customizeRegistration
Dec 09, 2013 4:17:44 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2013-12-09 16:17:44.963 [pool-2-thread-1] WARN o.s.s.c.SpringSecurityCoreVersion - *** Spring Major version '3' expected, but you are running with version: 4.0.0.RC2. Please check your classpath for unwanted jar files.
Inside JpaConfig annotationDrivenTransactionManager
Inside JpaConfig configureEntityManagerFactory
Inside JpaConfig configureDataSource
Inside WebMvcConfig messageSource
MyServiceOne just got created.
MyServiceTwo just got created.
2013-12-09 16:17:47.269 [pool-2-thread-1] WARN o.h.e.j.i.JdbcCoordinatorImpl - HHH000386: ResultSet had no statement associated with it, but was not yet registered
2013-12-09 16:17:47.281 [pool-2-thread-1] WARN o.h.e.j.i.JdbcCoordinatorImpl - HHH000386: ResultSet had no statement associated with it, but was not yet registered
Inside WebMvcConfig templateResolver
Inside WebMvcConfig templateEngine
Inside WebMvcConfig viewResolver
Inside WebMvcConfig requestMappingHandlerMapping
Inside WebMvcConfig addResourceHandlers
Inside WebMvcConfig configureDefaultServletHandling
Inside WebMvcConfig getValidator
Dec 09, 2013 4:17:48 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatcher'
Inside JpaConfig annotationDrivenTransactionManager
Inside JpaConfig configureEntityManagerFactory
Inside JpaConfig configureDataSource
2013-12-09 16:17:48.567 [pool-2-thread-1] WARN o.h.e.i.EntityManagerFactoryRegistry - HHH000436: Entity manager factory name (default) is already registered. If entity manager will be clustered or passivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
Inside WebMvcConfig messageSource
MyServiceOne just got created.
MyServiceTwo just got created.
2013-12-09 16:17:48.620 [pool-2-thread-1] WARN o.h.e.j.i.JdbcCoordinatorImpl - HHH000386: ResultSet had no statement associated with it, but was not yet registered
2013-12-09 16:17:48.625 [pool-2-thread-1] WARN o.h.e.j.i.JdbcCoordinatorImpl - HHH000386: ResultSet had no statement associated with it, but was not yet registered
Inside WebMvcConfig viewResolver
Inside WebMvcConfig templateEngine
Inside WebMvcConfig templateResolver
Inside WebMvcConfig getValidator
Inside WebMvcConfig requestMappingHandlerMapping
Inside WebMvcConfig addResourceHandlers
Inside WebMvcConfig configureDefaultServletHandling
Dec 09, 2013 4:17:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Dec 09, 2013 4:17:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 09, 2013 4:17:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6948 ms

You can see it goes through the WebAppInitializer once, which is expected, however it would seem the Root context should not instantiate all of the WebMvcConfig stuff. What's the best way to fix this?

Thanks,
John

After updating Spring to 3.1.3.RELEASE application does not start

2012-12-04 22:49:01.614 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.github.kolorobot.config.PersistenceConfig': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'annotationDrivenTransactionManager' defined in class path resource [com/github/kolorobot/config/PersistenceConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:915) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) ~[spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) ~[spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791) [catalina.jar:7.0.32]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285) [catalina.jar:7.0.32]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) [catalina.jar:7.0.32]
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) [catalina.jar:7.0.32]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_09]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'annotationDrivenTransactionManager' defined in class path resource [com/github/kolorobot/config/PersistenceConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:86) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:100) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:86) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322) ~[spring-aop-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 30 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'annotationDrivenTransactionManager' defined in class path resource [com/github/kolorobot/config/PersistenceConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:298) ~[spring-context-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at com.github.kolorobot.config.PersistenceConfig$$EnhancerByCGLIB$$5b02a847.annotationDrivenTransactionManager() ~[cglib-2.2.2.jar:na]
at org.springframework.transaction.annotation.AbstractTransactionManagementConfiguration.setConfigurers(AbstractTransactionManagementConfiguration.java:62) ~[spring-tx-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_09]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_09]
at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_09]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:593) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:92) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 55 common frames omitted
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
at org.springframework.beans.factory.BeanFactoryUtils.beanOfType(BeanFactoryUtils.java:394) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.jpa.EntityManagerFactoryUtils.findEntityManagerFactory(EntityManagerFactoryUtils.java:111) ~[spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.orm.jpa.JpaTransactionManager.setBeanFactory(JpaTransactionManager.java:291) ~[spring-orm-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1475) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1443) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) ~[spring-beans-3.1.3.RELEASE.jar:3.1.3.RELEASE]
... 70 common frames omitted

Support MySQL Database please?

I am a new guy from PHPer. Configure MySQL Database support is very hard to me.
Be a "quick start" archetype we'll very glad to see MySQL Database supported :)
That will be save so many hours for our who very new to Java and Spring.

Thank you for reading.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.