• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring stopped autowiring of third party jar's classes when I removed the @Service annotation from my ServiceMapper class
 
reply
    Bookmark Topic Watch Topic
  • New Topic