Spring MVC Project(s) setup in Eclipse - separate base packages and web and rest apis










0















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.




  1. Base Project with the following packages



    • mydomain.myapp.constants

    • mydomain.myapp.dao

    • mydomain.myapp.services

    • mydomain.myapp.util



  2. Web App Project with the following packages



    • mydomain.myapp.config

    • mydomain.myapp.controller


  3. 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










share|improve this question




























    0















    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.




    1. Base Project with the following packages



      • mydomain.myapp.constants

      • mydomain.myapp.dao

      • mydomain.myapp.services

      • mydomain.myapp.util



    2. Web App Project with the following packages



      • mydomain.myapp.config

      • mydomain.myapp.controller


    3. 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










    share|improve this question


























      0












      0








      0








      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.




      1. Base Project with the following packages



        • mydomain.myapp.constants

        • mydomain.myapp.dao

        • mydomain.myapp.services

        • mydomain.myapp.util



      2. Web App Project with the following packages



        • mydomain.myapp.config

        • mydomain.myapp.controller


      3. 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










      share|improve this question
















      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.




      1. Base Project with the following packages



        • mydomain.myapp.constants

        • mydomain.myapp.dao

        • mydomain.myapp.services

        • mydomain.myapp.util



      2. Web App Project with the following packages



        • mydomain.myapp.config

        • mydomain.myapp.controller


      3. 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







      java spring eclipse model-view-controller project






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 14 '18 at 6:41







      kjpradeep

















      asked Nov 13 '18 at 18:40









      kjpradeepkjpradeep

      13




      13






















          2 Answers
          2






          active

          oldest

          votes


















          0














          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")





          share|improve this answer























          • 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


















          0














          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.






          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            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









            0














            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")





            share|improve this answer























            • 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















            0














            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")





            share|improve this answer























            • 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













            0












            0








            0







            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")





            share|improve this answer













            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")






            share|improve this answer












            share|improve this answer



            share|improve this answer










            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

















            • 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













            0














            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.






            share|improve this answer



























              0














              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.






              share|improve this answer

























                0












                0








                0







                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 14 '18 at 16:18









                kjpradeepkjpradeep

                13




                13



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kleinkühnau

                    Makov (Slowakei)

                    Deutsches Schauspielhaus