java.lang.NoClassDefFoundError: Could not initialize class br.com.teste.ganymede.util.HibernateUtil
15:36:30,543 INFO [CollectionBinder] Mapping collection: br.com.teste.ganymede.modelo.operacional.Mawb.hawbs -> AbreProcesso
15:36:30,549 INFO [Version] Hibernate Validator 3.1.0.GA
15:36:30,637 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
java.lang.NoClassDefFoundError: Could not initialize class br.com.teste.ganymede.util.HibernateUtil
at br.com.teste.ganymede.util.HibernateSessionfilter.doFilter(HibernateSessionfilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Origem do problema:
public class DespesaHawb implements Serializable{
@ManyToOne
// Origem do problema aqui!
// Origem do problema aqui!
@JoinColumn(name="hawb_id")
private AbreProcesso hawb;
private AbreProcesso hawb;
@OneToOne
// Assim funciona!
@JoinColumn(name="despesa_id",insertable=false,updatable=false)
private Despesa despesa;
@OneToOne
// Assim funciona, pois a propriedade usuario esta anotada!
@JoinColumn(name="insert_usuario")
private Usuario usuario;
@Id
@GeneratedValue
generator="seq_despesahawb",strategy=GenerationType.SEQUENCE)
generator="seq_despesahawb",strategy=GenerationType.SEQUENCE)
private int id;
private Integer despesa_id;
private Double valor;
private String moeda_codigo;
private Double valor_moeda;
private Double taxa_conversao;
private Double valor_real;
@Column(insertable=false,updatable=false)
private Integer insert_usuario;
@Column(insertable=false,updatable=false)
private Date insert_data;
private String hawb_id;
private String tipo;
Solução:
1) Remover a propriedade hawb_id deixando somente o objeto hawb.
Ou
Ou
2) Anotar a propridade hawb_id com @Column(insertable=false,updatable=false)
Ou
3) Alterar o @ManyToOne para:@ManyToOne@JoinColumn(name="hawb_id",insertable=false,updatable=false)private AbreProcesso hawb;
Nenhum comentário:
Postar um comentário