Quel problema è stato risolto, ora ne ho un altro.
Ho creato la seguente classe
codice:
package it.telecomitalia.db.util;
import it.telecomitalia.util.MyLogger;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
public class HibernateUtil {
private static SessionFactory sessionFactory;
private static ServiceRegistry serviceRegistry;
private static SessionFactory createSessionFactory() {
MyLogger.printLogDebug("HibernateUtil -> createSessionFactory START!");
Configuration configuration = new Configuration();
MyLogger.printLogDebug("HibernateUtil -> createSessionFactory 1");
configuration.configure();
MyLogger.printLogDebug("HibernateUtil -> createSessionFactory 2");
serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
MyLogger.printLogDebug("HibernateUtil -> createSessionFactory 3");
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
MyLogger.printLogDebug("HibernateUtil -> createSessionFactory 4");
return sessionFactory;
}
public static SessionFactory getSessionFactory() {
MyLogger.printLogDebug("HibernateUtil -> getSessionFactory START!");
if (sessionFactory == null) createSessionFactory();
return sessionFactory;
}
}
e sembra che su questo metodo: configuration.buildSessionFactory(serviceRegistry)
ci sia qualche problema.
I log sono i seguenti:
codice:
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.EntityBinder ? Import with entity name Contact
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.EntityBinder ? Bind entity it.telecomitalia.strutsexample.model.Contact on table Contacts
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=id, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property id with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:id]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for id
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property id
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=birthdate, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property birthDate with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:birthDate]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for birthDate
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property birthDate
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=cell_no, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property cellNo with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:cellNo]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for cellNo
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property cellNo
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=created, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property created with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:created]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for created
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property created
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=email_id, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property emailId with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:emailId]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for emailId
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property emailId
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=firstname, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property firstName with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:firstName]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for firstName
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property firstName
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=lastname, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property lastName with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:lastName]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for lastName
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property lastName
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.Ejb3Column ? Binding column: Ejb3Column{table=org.hibernate.mapping.Table(Contacts), mappingColumn=website, insertable=true, updatable=true, unique=false}
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? MetadataSourceProcessor property website with lazy=false
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.AbstractPropertyHolder ? Attempting to locate auto-apply AttributeConverter for property [it.telecomitalia.strutsexample.model.Contact:website]
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.SimpleValueBinder ? building SimpleValue for website
DEBUG http-bio-8080-exec-35 org.hibernate.cfg.annotations.PropertyBinder ? Building property website
DEBUG http-bio-8080-exec-35 com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor ? Error calling method through OGNL: object: [it.telecomitalia.strutsexample.view.ContactAction@11040e2] method: [add] args: [[]]
java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
at org.hibernate.cfg.annotations.EntityBinder.processComplementaryTableDefinitions(EntityBinder.java:973)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:824)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3845)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3799)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1412)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)
at it.telecomitalia.db.util.HibernateUtil.createSessionFactory(HibernateUtil.java:23)
at it.telecomitalia.db.util.HibernateUtil.getSessionFactory(HibernateUtil.java:30)
at it.telecomitalia.controller.ContactManager.add(ContactManager.java:26)
at it.telecomitalia.strutsexample.view.ContactAction.add(ContactAction.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:870)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1293)
at ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:68)
at
Qualche idea? 



Grazie a chi risponderà