Hi everyone,
I'm devolpping a jboss seam 2.0.3GA application, and I have same problems when I try to map my tables from my database (Postgresql 8.2) , here is the exception and I can't deploy my application to the server:
Code:
16:18:57,609 INFO [TableMetadata] table found: public.aire_protegee
16:18:57,609 INFO [TableMetadata] columns: [rv_est, vent_vitesse_min, superficie, rv_so, pluviom_moyenne, vent_vitesse_moyenne, vent_vitesse_max, poi_id, temp_moyenne, id, pluviom_min, rv_no, nom_ap, temp_max, pluviom_max, rv_se, rv_ouest, rv_nord, temp_min, rv_sud, rv_ne, cla_id, ind_id]
16:18:57,625 ERROR [[/sigpn]] Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: sigpnEntityManagerFactory
at org.jboss.seam.Component.newInstance(Component.java:1986)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
at org.jboss.seam.init.Initialization.init(Initialization.java:596)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
............
Caused by: javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: temp_moyenne, expected: int8
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
at org.jboss.seam.Component.callComponentMethod(Component.java:2100)
at org.jboss.seam.Component.callCreateMethod(Component.java:2015)
at org.jboss.seam.Component.newInstance(Component.java:1976)
... 162 more
Caused by: org.hibernate.HibernateException: Wrong column type: temp_moyenne, expected: int8
at org.hibernate.mapping.Table.validateColumns(Table.java:261)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1083)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:317)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
... 175 more
This is my table:
Code:
CREATE TABLE aire_protegee
(
id serial NOT NULL,
poi_id integer,
cla_id integer NOT NULL,
ind_id integer,
nom_ap text,
temp_moyenne integer,
temp_max integer,
temp_min integer,
pluviom_moyenne integer,
pluviom_max integer,
pluviom_min integer,
vent_vitesse_moyenne integer,
vent_vitesse_max integer,
vent_vitesse_min integer,
rv_nord integer,
rv_sud integer,
rv_est integer,
rv_ouest integer,
rv_ne integer,
rv_no integer,
rv_se integer,
rv_so integer,
superficie double precision,
CONSTRAINT pk_aire_protegee PRIMARY KEY (id),
CONSTRAINT fk_aire_pro_aire_prot_classe_a FOREIGN KEY (cla_id)
REFERENCES classe_ap (id) MATCH SIMPLE
ON UPDATE RESTRICT ON DELETE RESTRICT,
CONSTRAINT fk_aire_pro_indicateu_indicate FOREIGN KEY (ind_id)
REFERENCES indicateur_ap (id) MATCH SIMPLE
ON UPDATE RESTRICT ON DELETE RESTRICT,
CONSTRAINT fk_aire_pro_point_obs_point_ob FOREIGN KEY (poi_id)
REFERENCES point_observation (id) MATCH SIMPLE
ON UPDATE RESTRICT ON DELETE RESTRICT
)
WITHOUT OIDS;
ALTER TABLE aire_protegee OWNER TO "admin";
My persistance.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<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_1_0.xsd"
version="1.0">
<persistence-unit name="sigpn" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/sigpnDatasource</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
and finally, the declaration of my java class:
Code:
public class AireProtegee implements java.io.Serializable {
private int id;
private IndicateurAp indicateurAp;
private PointObservation pointObservation;
private ClasseAp classeAp;
private String nomAp;
private Long tempMoyenne;
private Long tempMax;
private Long tempMin;
private Long pluviomMoyenne;
private Long pluviomMax;
private Long pluviomMin;
private Long ventVitesseMoyenne;
private Long ventVitesseMax;
private Long ventVitesseMin;
private Long rvNord;
private Long rvSud;
private Long rvEst;
private Long rvOuest;
private Long rvNe;
private Long rvNo;
private Long rvSe;
private Long rvSo;
private Double superficie;
......
}
I really need your help!!!
Thx[/code]