Reputation: 27
I am working towards building a Spring MVC based Web application project along with rest API for the same to work with mobile Apps.
For this i am trying to setup the project structure in Eclipse as the following.
Base Project with the following packages
Web App Project with the following packages
Restful Services project ( not started yet)
I have added the base project as a dependency for web app project. The build is NOT working after putting in some dao, model ,service , controller, views to start with.
it is giving below errors
ClassnotDefinedException for dao classes and model classes.
java.lang.IllegalStateException: Failed to introspect Class [in.ovid.hms.config.MvcConfiguration] from ClassLoader [ParallelWebappClassLoader
Am i missing anything/any step here ?
Note: I am using Maven Archetype https://javalibs.com/archetype/fr.uha.ensisa.ff/spring-mvc-archetype
Upvotes: 0
Views: 214
Reputation: 27
Got the root-cause for my problem. The order of projects for export/build in Deployment Assembly was having the dependency/base project at the bottom of the list. Once i moved it to the top things started working. Thanks everyone for the support.
Upvotes: 1
Reputation: 8448
This usually happens whenever you have a class file that your program relies on and it is found at compile time, but unfound at runtime. Try to check out your build time and runtime classpaths to see if there are any differences.
The other thing to try is try to declare the following in your main application class:
@ComponentScan("org.example.base")
@EntityScan("declare.base.package")
@EnableJpaRepositories("declare.dao.package")
Upvotes: 0