This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Spring : DefaultAnnotationHandlerMapping not mapping URL using annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Spring : DefaultAnnotationHandlerMapping not mapping URL using annotation" Watch "Spring : DefaultAnnotationHandlerMapping not mapping URL using annotation" New topic
Author

Spring : DefaultAnnotationHandlerMapping not mapping URL using annotation

puneet dhiman
Greenhorn

Joined: Apr 10, 2008
Posts: 5
I am using Spring Tool Suite 2.5.2 IDE and tried springtravel application provided with STS.
Application worked fine with tomcat6 but not working with Jboss5.1, I am using jdk 6 update 24.

My findings are that while deploying war file application server is not resolving URL mappings defined using annotations.Following are startup logs from both servers.


Log from Jboss
21:50:53,734 INFO [STDOUT] DEBUG: org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping - Looking for URL mappings in application context: org.springframework.web.context.support.XmlWebApplicationContext@830910: display name [WebApplicationContext for namespace 'Spring MVC Dispatcher Servlet-servlet']; startup date [Tue Apr 19 21:50:50 IST 2011]; root of context hierarchy
21:50:53,734 INFO [STDOUT] DEBUG: org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': no URL paths identified
21:50:53,734 INFO [STDOUT] DEBUG: org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified
21:50:53,734 INFO [STDOUT] DEBUG: org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': no URL paths identified
21:50:53,734 INFO [STDOUT] DEBUG: org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor': no URL paths identified


Log from tomcat, lines in red are missing in Jboss log.It is not processing URL mapping defined by annotations.

DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Looking for URL mappings in application context: org.springframework.web.context.support.XmlWebApplicationContext@6551c1: display name [WebApplicationContext for namespace 'Spring MVC Dispatcher Servlet-servlet']; startup date [Tue Apr 19 21:49:11 IST 2011]; root of context hierarchy
DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'stubHotelSearchService': no URL paths identified
DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/hotels/*] onto handler [com.springsource.springtravel.hotels.web.HotelsController@143c268]
DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/hotels/*.*] onto handler [com.springsource.springtravel.hotels.web.HotelsController@143c268]

DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': no URL paths identified
DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified
DEBUG: org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': no URL paths identified


Mappings in class looks like



Have anyone faced this issue earlier or any suggestion and clues about workarounds?
Thanks
Flo Ga
Greenhorn

Joined: Oct 16, 2011
Posts: 2
Hi,

I have the same issue.

The difference is that my app works (the mapping is done) when I run it on tomcat inside Eclipse but not when I deploy it and try to run it on tomcat stand alone (not bound to eclipse)...

It might have something to do with my ant build file... I'm not that familiar with ant...

build.properties:


build.xml:


So what caused the issue for you?
Flo Ga
Greenhorn

Joined: Oct 16, 2011
Posts: 2
Nevermind... I just figured it out (after spending hours on it... it's always right after I post on a forum)...
I'm ashamed to say it but basically when I was deploying, I wasn't copying my .class files along with the rest of the app.....................(...)
 
wood burning stoves
 
subject: Spring : DefaultAnnotationHandlerMapping not mapping URL using annotation