Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6901869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:43:39+00:00 2026-05-27T07:43:39+00:00

I have a Spring MVC based Web Application with Hibernate. Following is the directory

  • 0

I have a Spring MVC based Web Application with Hibernate. Following is the directory structure:

  • src
    • com/myproject/abstractmodels/ <- contains some abstract java files for domain objects
    • com/myproject/dao/personsmodel/ <- dao layer, using hibernate to get data
    • com/myproject/dao/anothermodel/
    • com/myproject/domain/personsmodel/ <- Domain/BusinessObjects and HBM files for hibernate mappings
    • com/myproject/domain/anothermodel/
    • com/myproject/service/personsmodelservice <- Service layer talks to DAO layer
    • com/myproject/service/anothermodelservice
    • com/myproject/controller/ <- Servlets, using Service layer and Domain objects for web presentation (JSP files)
  • WebRoot
    • WEB-INF
      • web.xml <- sets up the web app and spring framework to use the below xmls to configure the layers.
      • config
        • services.xml <- Sets up the service layer, that is glues the service interface with its implementations and injects the DAO beans
        • hibernate.xml <- uses hibernate hbm files for mappings and defines DAO beans
        • servlets.xml <- beans for controllers and service beans are injected into it
        • views.xml <- jsp files

Now I need to create a library (jar) using the Service, DAO, Domain, and AbstractModels packages. Basically, the idea is, that when given this jar file, and the database any one can create their own servlets/user interfaces or make web services based using our hibernate, service and domain objects.

I have simply made the jar file containing the directories:

 - com/myproject/abstractmodels/
 - com/myproject/dao/personsmodel/
 - com/myproject/dao/anothermodel/
 - com/myproject/domain/personsmodel/
 - com/myproject/domain/anothermodel/
 - com/myproject/service/personsmodelservice
 - com/myproject/service/anothermodelservice

with out the servlets and added it to build path of the web app. The project compiles, meaning that the servlets can find the service beans and domain objects but it does not run. The beans defined in services.xml could not be created. I checked the jar file and the package structure is correct and contains the class file. But when run, it would still give this error:

Loading XML bean definitions from ServletContext resource [/WEB-INF/config/servlet.xml]
Loading XML bean definitions from ServletContext resource [/WEB-INF/config/services.xml]
Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/config/services.xml]; nested exception is org.springframework.beans.FatalBeanException: Unable to create DWR bean creator for 'com.myproject.abstractmodels.ModelConstants#0'.; nested exception is java.lang.ClassNotFoundException: com.myproject.abstractmodels.ModelConstants

How can I make the jar file to correct this issue? Do I need to put the WEB-INF directory in the jar file as well? Is there some special Manifest configuration required?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:43:40+00:00Added an answer on May 27, 2026 at 7:43 am

    The jar must not be put in the project’s build path. It must be put in the WEB-INF/lib folder, and Eclipse will

    • put this jar in the build path automatically
    • deploy this jar as part of the web app, where it will be in the webapp’s classpath, as per the servlet specification.

    If you put the jar in the project build path, the project will compile, but the jar won’t be part of the deployed webapp.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java web application based on Spring MVC. The task is to
I have a Spring Web MVC application that I'd like to serve a large,
I am using Spring MVC to build my web application, and I have a
I have an existing, fully functional Spring web application based on Spring 2.5.6 -
I have my web application written in Spring MVC. It is quite simple app
In a web application based on propraietery MVC and authorization model, we have recently
I have two class definitions in my Spring MVC web application named Class and
I have web application on spring mvc and maven. When I execute mvn clean
I have a Spring MVC application trying to use a rich domain model, with
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.