• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Spring : DefaultAnnotationHandlerMapping not mapping URL using annotation

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.....................(...)
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic