Spring MVC Project(s) setup in Eclipse - separate base packages and web and rest apis
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
- mydomain.myapp.constants
- mydomain.myapp.dao
- mydomain.myapp.services
- mydomain.myapp.util
Web App Project with the following packages
- mydomain.myapp.config
- mydomain.myapp.controller
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
[ParallelWebappClassLoaderAm i missing anything/any step here ?
Note: I am using Maven Archetype
https://javalibs.com/archetype/fr.uha.ensisa.ff/spring-mvc-archetype
java spring eclipse model-view-controller project
add a comment |
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
- mydomain.myapp.constants
- mydomain.myapp.dao
- mydomain.myapp.services
- mydomain.myapp.util
Web App Project with the following packages
- mydomain.myapp.config
- mydomain.myapp.controller
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
[ParallelWebappClassLoaderAm i missing anything/any step here ?
Note: I am using Maven Archetype
https://javalibs.com/archetype/fr.uha.ensisa.ff/spring-mvc-archetype
java spring eclipse model-view-controller project
add a comment |
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
- mydomain.myapp.constants
- mydomain.myapp.dao
- mydomain.myapp.services
- mydomain.myapp.util
Web App Project with the following packages
- mydomain.myapp.config
- mydomain.myapp.controller
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
[ParallelWebappClassLoaderAm i missing anything/any step here ?
Note: I am using Maven Archetype
https://javalibs.com/archetype/fr.uha.ensisa.ff/spring-mvc-archetype
java spring eclipse model-view-controller project
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
- mydomain.myapp.constants
- mydomain.myapp.dao
- mydomain.myapp.services
- mydomain.myapp.util
Web App Project with the following packages
- mydomain.myapp.config
- mydomain.myapp.controller
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
[ParallelWebappClassLoaderAm i missing anything/any step here ?
Note: I am using Maven Archetype
https://javalibs.com/archetype/fr.uha.ensisa.ff/spring-mvc-archetype
java spring eclipse model-view-controller project
java spring eclipse model-view-controller project
edited Nov 14 '18 at 6:41
kjpradeep
asked Nov 13 '18 at 18:40
kjpradeepkjpradeep
13
13
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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")
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
add a comment |
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287546%2fspring-mvc-projects-setup-in-eclipse-separate-base-packages-and-web-and-rest%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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")
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
add a comment |
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")
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
add a comment |
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")
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")
answered Nov 13 '18 at 19:57
Issmeil EL.Issmeil EL.
670423
670423
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
add a comment |
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
i want to clarify one thing that the exception is there even in the build. Edited the question accordingly.
– kjpradeep
Nov 14 '18 at 6:39
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 14 '18 at 16:18
kjpradeepkjpradeep
13
13
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287546%2fspring-mvc-projects-setup-in-eclipse-separate-base-packages-and-web-and-rest%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown