Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Noclassdeffound error when calling rest services - bean creation error  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Have a java spring app running on tomcat container. It has all the components to launch itself as a rest service, META-INF/context.xml, web.xml which has the ContextLoaderListener and the contextConfigLocation is defined as well with test-servlet.xml.  The test-servlet.xml has the controller bean definitions in it. I also have the applicationContext.xml defined with all the delegate and service beans. I  have a BeanFactory class which implements ApplicationContextAware interface and has the class path defined there for the applicationContext. It is not even hitting the BeanFactory class though, it fails even before that. When I call the restservices from a rest client, it is unable to recognise the controller bean. I used a debugger to see where exactly it fails and seems like the controller is not fully qualified and hence it fails to pick it up.

Any suggestions of how to go about fixing it.

Thanks!

 
Marshal
Posts: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

What does it mean about fully qualified? The only thing “fully qualified” I can think of just at the moment is the name of a class. Please provide the fully qualified name of the class you appear to be missing, where you think it is or where its containing .jar file is, show us how you are referring to the class in your code, and also show us the CLASSPATH you are using.
 
Nancy Joe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank for your quick response. It seems to be working now. I did not make any c hanges to the code, I probably was not testing it correctly.
 
Campbell Ritchie
Marshal
Posts: 62819
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you got it working: well done.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!