-
2. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
jaikiran Sep 6, 2012 5:04 AM (in response to klopper)I haven't kept track of Hibernate 3.x support in AS7. Do you mean that applications which use Hibernate 3.3 with JPA annotations (is that supported, by the way?) aren't scanned for annotated classes unless you explicitly specify a persistence.xml with the <classes> elements?
-
3. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 6, 2012 5:27 AM (in response to jaikiran)jaikiran, yes, it is.
Because jboss deployer use for create tables org/jboss/as/jpa/hibernate3/HibernateAnnotationScanner, extends by org.hibernate.ejb.packaging.Scanner (created on hibernate 3.5)
I think this problem with usage native hibernate (and classloaders ) on jBoss for searching (loading) entity classes
-
4. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 6, 2012 7:17 AM (in response to klopper)Any ideas?
-
5. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
smarlow Sep 6, 2012 9:37 AM (in response to klopper)Here are some options:
- Try the nightly AS7 build and add property "jboss.as.jpa.vfs" set to "false" to your persistence.xml
- Add the entity classes by name to your persistence.xml (Jaikiran already mentioned this above)
- Switch to using EAP6.
Scott
-
6. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 6, 2012 11:46 PM (in response to smarlow)Hi Scott.
Thanks for your help.
I'll try with "jboss.as.jpa.vfs"
So, unfortunatelly, entity class not mapped on DB
See server.log (and persistence.xml) in atachments.
C:/FIS/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/tmp/vfs/deploymentebdd7635d5c81e73/core.jar-e7c6c2e8ee568595/contents/ is empty folder.
>>Add the entity classes by name to your persistence.xml (Jaikiran already mentioned this above)
Our project contains many modules and hard to describe all the classes in the persistence.xml
>>Switch to using EAP6.
Requirement: Usage Jboss AS 7
-
persistence.xml 2.4 KB
-
server.log.zip 16.4 KB
-
-
7. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
jaikiran Sep 7, 2012 4:17 AM (in response to klopper)Please post a sample entity class which has the annotations and also the exact location where it's packaged in the application.
-
8. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 9, 2012 10:34 PM (in response to jaikiran)Hi jaikiran.
Thanks for reply.
In example:
<code>
/**
* TODO copyright
*/
package ru.fisgroup.fiscred.app.config.model;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class AuthInfo implements Serializable {
@Id
private String name;
public static AuthInfo newInstance(String name) {
AuthInfo auth = new AuthInfo();
auth.name = name;
return auth;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
}
<code>
This class is in core.jar, but core.jar (ejb-jar) is in own ear.
-
9. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
smarlow Sep 7, 2012 9:12 AM (in response to klopper)This class is in core.jar, but core.jar (ejb-jar) is in own ear.
How many ears are involved with your application? Can you post the output from:
jar tf core.jar
jar tf yourEAR.ear
-
10. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 9, 2012 10:33 PM (in response to smarlow)jar tf core.jar >> 1073 classes
jar tf yourEAR.ear >> 79 records
-
11. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
jaikiran Sep 10, 2012 1:25 AM (in response to klopper)Ayrat Nurtdinov wrote:
jar tf core.jar >> 1073 classes
jar tf yourEAR.ear >> 79 records
What we really wanted to see was the (relevant) contents of those archives and jar -tf is expected to show that. You don't have to post all those 1073 classes but only the main entries or you can even create a txt attachment out of that output. But we would really like to see what it looks like instead of guessing its contents.
-
12. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 10, 2012 2:49 AM (in response to jaikiran)ok, see attach
otherX.jar contains session beans.
-
ear.out.zip 244 bytes
-
core.out.zip 278 bytes
-
-
13. Re: JBoss AS 7 and Hibernate Core 3.3 - deployment entity classes without specify in the persistence.xml
klopper Sep 11, 2012 10:55 PM (in response to klopper)Ok.
Now the AS 7.x (witn Hibernate 3.3) does not support deploy tne entity beans, without describing in persistence.xml. And every developer should remember this and add hands to a file the entity class names.