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 5846551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:35:35+00:00 2026-05-22T12:35:35+00:00

In my Java/Seam/JbossAS app, I decided to externalize my Model classes (hibernate entities) and

  • 0

In my Java/Seam/JbossAS app, I decided to externalize my Model classes (hibernate entities) and moved them into another project. The project produces model.jar, which is then used by the main app. The model.jar dependency is resolved by Ivy.
Building the main app with Ant works without problems. Then I copy manually the model.jar into ‘mainapp.ear/lib’ directory. Afterwards I deploy the app and there are no problems (although I notice that there are is no log info about found mappings). But when I want to login, I get the exception:

javax.el.ELException: javax.ejb.EJBTransactionRolledbackException:
    org.hibernate.hql.ast.QuerySyntaxException: AppUser is not
    mapped [select u from AppUser u where u.userName = :usernamePar]

There were no code changes in the meantime, just externalizing some of the classes into a jar. Does this mean, that I need the source code of the Model classes when compiling the main app?

  • 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-22T12:35:35+00:00Added an answer on May 22, 2026 at 12:35 pm

    The EntityManagerFactory is built for scanning entities only from the jar that has a /META-INF/persistence.xml file into.

    In order to scan other jars you have to use <jar-file>:

    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
                 version="2.0">
       <persistence-unit name="manager1" transaction-type="JTA">
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <jta-data-source>java:/DefaultDS</jta-data-source>
          <mapping-file>ormap.xml</mapping-file>
          <jar-file>MyApp.jar</jar-file>
          <class>org.acme.Employee</class>
          <class>org.acme.Person</class>
          <class>org.acme.Address</class>
          <shared-cache-mode>ENABLE_SELECTOVE</shared-cache-mode>
          <validation-mode>CALLBACK</validation-mode>
          <properties>
             <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
          </properties>
       </persistence-unit>
    </persistence>
    

    See 2.2.1 Packaging in Hibernate doc.

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

Sidebar

Related Questions

Java has generics and C++ provides a very strong programming model with template s.
Java Newbie here. I have a JFrame that I added to my netbeans project,
Java is one of my programming languages of choice. I always run into the
I have a website developed using Java EE and the Seam Framework. We are
Is there a Java analogue to Pinax/Django? (Perhaps an extension to Jboss Seam and/or
Is there a way to use a Seam Logger inside of a standard Java
I'm using JBOSS Seam 2.0 with JBoss 6 to send emails. I'm getting java.lang.UnsupportedOperationException
I have a Seam 2.2 app running under JBoss5.1. In this application I have
Java has a convenient split method: String str = The quick brown fox; String[]
(Java question) If I reference a field in an inner class, does this cause

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.