Announcement Announcement Module
No announcement yet.
Using configuration file in a jar library (Creating hibernate library) Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using configuration file in a jar library (Creating hibernate library)


    I have a huge datebase and I am using it in several applications, So I thought it should be easier for me to create a jar file that contains all the classes, xml files and mappings into one jar file and to just import it when I need it. The problem is that the program doesn't recognise my mapping in the configuration file placed in the jar library .. it says:
    Unknown entity: NomadHibXml.TestNetwork
    and I think that's a problem regarding the configuration file, The library is working good, I tested it, The configuration file is read also in this program since there is no problem of connection .. but the mapping is not working
    Anyone can help? thanks.

  • #2
    I had the same problem the domain objects are scattered into multiple java projects, These projects intrun are part of an ear file. Since all the domain objects and mappings are in individual jar file when I start the application I got the same error as you described in your post.

    I resolved the problem by adding class definition of all domain objects into the persistence.xml file

    1. Poject A -- projecta.domain.One

    2. Project B -- projectb.domain.Two

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <persistence xmlns=""
    <persistence-unit name="cwCareweb">