Hibernate version: latest (3.2.2 with EntityManager and Annotations 3.3.0), JBoss 4.0.5, EJB3_RC9_Patch1 (I've placed new hibernate jars in jboss/server/default/lib )
Source code:
@Entity
public class Sport implements Serializable {
//...
private Map<String, String> nameMap = new HashMap<String, String>();
//...
public Map<String, String> getNameMap() {
return nameMap;
}
public String getName(String lang){
return nameMap.get(lang);
}
public void setNameMap(Map<String, String> nameMap) {
this.nameMap = nameMap;
}
public void setName(String lang, String name){
nameMap.put(lang, name);
}
//...
}
Extra info:
With hibernate version included in EJB3_RC9_Patch1 there was another excepton:
Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Map, for columns: [org.hibernate.mapping.Column(nameMap)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:410)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
... 99 more
Full stack trace of any exception that occurs:
23:45:55,780 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=LineModule.jar
java.lang.NoSuchMethodError: org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(Ljava/net/URL;Ljava/util/Map;Lorg/xml/sax/EntityResolver;)Ljava/util/List;
at org.jboss.ejb3.Ejb3Deployment.initializePersistenceUnits(Ejb3Deployment.java:444)
at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:307)
at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:77)
-- update --
This exception was cause by incompatibility of EJB3 RC9 with Hibernate EntityManager 3.3.0 (
details)
Name and version of the database you are using:
MySQL 4