• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call a non-annotated class from a third party from a @controller annotated class?  RSS feed

 
mike darthvader
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my project I have a controller class. It is marked with @Controller annotation.

The ServiceMapper class looks like this:

Dispatcher-servlet looks like this:

Problem: When <context:component-scan> is present in the dispatcher-servlet - Spring seems to be scanning the classes inside the third party jar as well. Third party jar classes have no annotations at all. It throws an error saying it <b>cant create the beans</b> in the third party.

When I remove the <context:component-scan> totally, an error similar to the one below is thrown:

No mapping found for HTTP request with URI [/MYWS/cc] in DispatcherServlet with name 'mvc-dispatcher'


Does anyone know a possible solution to this? I need to be able to use the third party jar's classes and at the same time use @controller to access the web services.
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't want to scan all packages, please mention list of packages so Spring scans those packages.

 
mike darthvader
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring stopped autowiring of third party jar's classes when I removed the @Service annotation from my ServiceMapper class
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!