Pessoal, boa tarde. tive um problema parecido recentemente mas agora ele apareceu novamente e nao consegui resolver.
o Seguinte erro aparece quando rodo minha aplicação
16:11:35,315 ERROR BasicPropertyAccessor:167 - IllegalArgumentException in class: br.com.academia.classes.AvaliacaoFisica, getter method of property: id
Exception in thread “AWT-EventQueue-0” java.lang.ExceptionInInitializerError
at br.com.academia.forms.frm_CadastroAluno.<init>(frm_CadastroAluno.java:22)
at br.com.academia.forms.frm_CadastroAluno$2.run(frm_CadastroAluno.java:389)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of br.com.academia.classes.AvaliacaoFisica.id
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:124)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at br.com.academia.classes.Persistencia.<clinit>(Persistencia.java:20)
… 16 more
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
… 25 more
package br.com.academia.classes;
import java.util.Date;
public abstract class AvaliacaoFisica {
private int id;
private Date data_avaliacao;
private Date data_proxima_avaliacao;
private Aluno aluno;
private Instrutor instrutor;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Date getData_avaliacao() {
return data_avaliacao;
}
public void setData_avaliacao(Date data_avaliacao) {
this.data_avaliacao = data_avaliacao;
}
public Date getData_proxima_avaliacao() {
return data_proxima_avaliacao;
}
public void setData_proxima_avaliacao(Date data_proxima_avaliacao) {
this.data_proxima_avaliacao = data_proxima_avaliacao;
}
public Aluno getAluno() {
return aluno;
}
public void setAluno(Aluno aluno) {
this.aluno = aluno;
}
public Instrutor getInstrutor() {
return instrutor;
}
public void setInstrutor(Instrutor instrutor) {
this.instrutor = instrutor;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="br.com.academia.classes">
<class name="AvaliacaoFisica" table="AVALIACAOFISICA">
<id column="ID" name="id" type="int">
<generator class="native"/>
</id>
<discriminator column="TIPO_AVALIACAO" type="string" />
<property column="DATA_AVALIACAO" length="150" name="data_avaliacao" type="java.util.Date" not-null="true" />
<property column="DATA_PROXIMA_AVALIACAO" length="150" name="data_proxima_avaliacao" type="java.util.Date" not-null="true" />
<subclass name="Anamnese" extends="AvaliacaoFisica" discriminator-value="ANAMNESE">
<property column="TEMPO_DISPONIVEL" length="150" name="tempo_disponivel" type="java.lang.Double" not-null="true"/>
<property column="OBJETIVO" length="150" name="objetivo" type="java.lang.String" not-null="true"/>
<property column="NIVEL_ALUNO" length="150" name="nivel_aluno" type="java.lang.String" not-null="true"/>
<property column="SN_FUMANTE" length="1" name="sn_fumante" type="java.lang.String" not-null="true"/>
<property column="SN_PRESSAO_ARTERIAL_ALTERADA" length="1" name="sn_pressao_arterial_alterada" type="java.lang.String" not-null="true"/>
<property column="SN_BEBE" length="1" name="sn_bebe" type="java.lang.String" not-null="true"/>
<property column="SN_LESOES" length="1" name="sn_lesoes" type="java.lang.String" not-null="true"/>
<property column="OBS_LESOES" length="255" name="obs_lesoes" type="java.lang.String" not-null="true"/>
<property column="SN_DESCONFORTO_DOR_NO_CORPO" length="1" name="sn_desconforto_dor_no_corpo" type="java.lang.String" not-null="true"/>
<property column="OBS_DESCONFORTO_DOR_NO_CORPO" length="255" name="obs_desconforto_dor_no_corpo" type="java.lang.String" not-null="true"/>
<property column="SN_CONTRA_INDICACAO" length="1" name="sn_contra_indicacao" type="java.lang.String" not-null="true"/>
<property column="OBS_CONTRA_INDICACAO" length="255" name="obs_contra_indicacao" type="java.lang.String" not-null="true"/>
<property column="SN_DIETA" length="1" name="sn_dieta" type="java.lang.String" not-null="true"/>
<property column="SN_NUTRICIONISTA" length="255" name="sn_nutricionista" type="java.lang.String" not-null="true"/>
<property column="TEMPO_DIETA" length="255" name="tempo_dieta" type="java.util.Date" not-null="true"/>
<property column="SN_SUPLEMENTOS" length="1" name="sn_suplementos" type="java.lang.String" not-null="true"/>
<property column="OBS_SUPLEMENTOS" length="255" name="obs_suplementos" type="java.lang.String" not-null="true"/>
<property column="POSICAO_DORMIR" length="255" name="posicao_dormir" type="java.lang.String" not-null="true"/>
</subclass>
<subclass name="Perimetria" extends="AvaliacaoFisica" discriminator-value="PERIMETRIA">
<property column="BRACO_DIREITO" length="5" name="braco_direito" type="java.lang.Double" not-null="true"/>
<property column="BRACO_ESQUERDO" length="5" name="braco_esquerdo" type="java.lang.Double" not-null="true"/>
<property column="PERNA_DIREITA" length="5" name="perna_direita" type="java.lang.Double" not-null="true"/>
<property column="PERNA_ESQUERDA" length="5" name="perna_esquerda" type="java.lang.Double" not-null="true"/>
<property column="ANTEBRACO_DIREITO" length="5" name="antebraco_direito" type="java.lang.Double" not-null="true"/>
<property column="ANTEBRACO_ESQUERDO" length="5" name="antebraco_esquerdo" type="java.lang.Double" not-null="true"/>
<property column="TORAX" length="5" name="torax" type="java.lang.Double" not-null="true"/>
<property column="CINTURA" length="5" name="cintura" type="java.lang.Double" not-null="true"/>
<property column="ABDOME" length="5" name="abdome" type="java.lang.Double" not-null="true"/>
<property column="QUADRIL" length="5" name="quadril" type="java.lang.Double" not-null="true"/>
<property column="PESO" length="5" name="peso" type="java.lang.Double" not-null="true"/>
<property column="ALTURA" length="5" name="altura" type="java.lang.Double" not-null="true"/>
<property column="IMC" length="5" name="imc" type="java.lang.Double" not-null="true"/>
</subclass>
<subclass name="Postura" extends="AvaliacaoFisica" discriminator-value="POSTURA">
<property column="SN_ESCOLIOSE" length="1" name="sn_escoliose" type="java.lang.String" not-null="true"/>
<property column="CABECA" length="255" name="cabeca" type="java.lang.String" not-null="true"/>
<property column="CERVICAL" length="255" name="cervical" type="java.lang.String" not-null="true"/>
<property column="OMBROS" length="255" name="ombros" type="java.lang.String" not-null="true"/>
<property column="QUADRIL" length="255" name="quadril" type="java.lang.String" not-null="true"/>
<property column="JOELHOS" length="255" name="joelhos" type="java.lang.String" not-null="true"/>
<property column="ESCAPULA" length="255" name="escapula" type="java.lang.String" not-null="true"/>
<property column="PES" length="255" name="pes" type="java.lang.String" not-null="true"/>
</subclass>
<subclass name="DobrasCultaneas" extends="AvaliacaoFisica" discriminator-value="DOBRASCULTANEAS">
<property column="TRICEPS" length="5" name="triceps" type="java.lang.Double" not-null="true"/>
<property column="SUBESCAPULAR" length="5" name="subescapula" type="java.lang.Double" not-null="true"/>
<property column="AXILAR_MEDIA" length="5" name="axilar_media" type="java.lang.Double" not-null="true"/>
<property column="SUPRA_ILIACA" length="5" name="supra_iliaca" type="java.lang.Double" not-null="true"/>
<property column="BICEPS" length="5" name="biceps" type="java.lang.Double" not-null="true"/>
<property column="TORACICA" length="5" name="toracica" type="java.lang.Double" not-null="true"/>
<property column="ABDOMINAL" length="5" name="abdominal" type="java.lang.Double" not-null="true"/>
<property column="SUPRA_ESPINAL" length="5" name="supra_espinal" type="java.lang.Double" not-null="true"/>
<property column="COXA" length="5" name="coxa" type="java.lang.Double" not-null="true"/>
<property column="PANTURRILHA_MEDIAL" length="5" name="panturrilha_medial" type="java.lang.Double" not-null="true"/>
</subclass>
</class>
</hibernate-mapping>
O que acham que pode ser?