[jboss-jira] [JBoss JIRA] (AS7-6872) Entity Not Mapped Exception
Shankar Mandal (JIRA)
jira-events at lists.jboss.org
Wed Apr 10 20:16:55 EDT 2013
Shankar Mandal created AS7-6872:
-----------------------------------
Summary: Entity Not Mapped Exception
Key: AS7-6872
URL: https://issues.jboss.org/browse/AS7-6872
Project: Application Server 7
Issue Type: Feature Request
Components: EE, EJB
Affects Versions: EAP 6.1.0.Alpha (7.2.0.Final)
Environment: Windows 7
Reporter: Shankar Mandal
Assignee: David Lloyd
Entity's are not mapped with using "jar-file" in persistence.xml
The structure of my EAR file is as under.
I even tried moving the persistance.xml to MYEAR\METAINF but still could not make hibernate read the entities from the jar files.
My application is packaged in a EAR file like this
MYEAR-
|
|__lib\
| |
| |__JPA.jar\
| | |__METAINF\
| | . |__persistence.xml
| |__1.jar
| |__2.jar
| |__3.jar
| |__4.jar
|
|
|
|
|__METAINF\
| |__application.xml
| |__jboss-app.xml
| |__jboss-deployment-structure.xml
|
|
|__MY-JAR-1.jar
|__MY-JAR-2.jar
|__MY-JAR-3.jar
|__MY-JAR-4.jar
contents of persistence.xml is
<?xml version="1.0" encoding="UTF-8"?>
<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="myPU">
<provider>com.envista.jpa.ENPersistenceProvider</provider>
<!--provider>com.envista.core.persistence.ENPersistenceProvider</provider-->
<!--provider>org.hibernate.ejb.HibernatePersistence</provider-->
<jta-data-source>java:jboss/datasources/EnvistaOracleDS</jta-data-source>
<jar-file>../MY-JAR-1.jar</jar-file>
<jar-file>../MY-JAR-2.jarr</jar-file>
<jar-file>../MY-JAR-3.jar</jar-file>
<jar-file>../MY-JAR-4.jar</jar-file>
<properties>
<property name="hibernate.archive.autodetection" value="class,hbm" />
<property name="hibernate.dialect" value="com.envista.core.hibernate.dialects.CustomOracle11gDialect" />
<property name="hibernate.max_fetch_depth" value="0" />
<property name="hibernate.default_batch_fetch_size" value="200" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.default.indexBase" value="./indexes" />
<property name="hibernate.search.autoregister_listeners" value="false" />
<property name="hibernate.search.indexing_strategy" value="event" />
<property name="hibernate.hbm2ddl.auto" value="${envista.db.auto}" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.cache.use_query_cache" value="false" />
<property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook" />
<property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache" />
<property name="hibernate.hbm2ddl.auto" value="validate"/> -->
</properties>
</persistence-unit>
I get an error that the Entity is not mapped.
What I see while debugging that when hibernate is scanning the classes to register all the entities marked with @Entity
in class org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(URL jarToScan, Set<Class<? extends Annotation>> annotationsToLookFor)
The value of jarToScan is takes the location where I run JBoss
for e.g. if my JBOSS_INSTALLED directory is C:/Jboss6.0.1Alpha and I run the command from C:/Jboss6.0.1Alpha/bin
C:/Jboss6.0.1Alpha/bin > standalone.bat -c standalone-full.xml
The value of jarToScan = C:/Jboss6.0.1Alpha/bin/content/MYEAR.ear/MY-JAR-1.jar
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list