Boa tarde caros amigos, estou com um problema.
Eu tenho o seguinte faces
ublic class SolicitacaoMB {
private SolicitacaoDAO solicitacaoDAO = new SolicitacaoDAO();
private Solicitacao solicitacao;
private ViagemDAO viagemDAO = new ViagemDAO();
private Viagem viagem;
private PessoaMB pessoaMb;
private static final long serialVersionUID = 1L;
public SolicitacaoMB() {
}
public String iniciarFaces(){
viagem = new Viagem();
return "Solicitacao";
}
public String inserirViagem(){
viagemDAO.inserirViagem(viagem);
return "sucesso";
}
public void setPessoaMb(PessoaMB pessoaMb) {
this.pessoaMb = pessoaMb;
}
public PessoaMB getPessoaMb() {
return pessoaMb;
}
public Solicitacao getSolicitacao() {
return solicitacao;
}
public void setSolicitacao(Solicitacao solicitacao) {
this.solicitacao = solicitacao;
}
public Viagem getViagem() {
return viagem;
}
public void setViagem(Viagem viagem) {
this.viagem = viagem;
}
tenho minha entidade:
@Entity
@Table(name="tbsisc_viagem")
public class Viagem implements java.io.Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="pktbsisc_viagem")
private Integer id;
@Column(name="ds_cidade")
private String cidade;
@Column(name="ds_objetivo")
private String objetivo;
@Column(name="dt_periodoinicial")
private Date periodoInicial;
@Column(name="dt_periodofinal")
private Date periodoFinal;
@Column(name="ds_pessoa")
private String nomePessoa;
@Column(name="in_passagem")
private boolean passagem;
@Column(name="in_ajudacusto")
private boolean ajudaDeCusto;
@Column(name="in_diaria")
private boolean diaria;
@Column(name="in_coletiva")
private boolean coletiva;
@Column(name="vl_ajudacusto")
private int valorDaAjudaDeCusto;
@Column(name="vl_diaria")
private Double valorDaDiaria;
@Column(name="vl_passagens")
private Double valorDaPassagem;
public Viagem() {
}
/**
* @param id
* @param objetivo
* @param periodoInicial
* @param periodoFinal
* @param nomePessoa
* @param passagem
* @param ajudaDeCusto
* @param diaria
* @param coletiva
* @param valorDaAjudaDeCusto
* @param valorDaDiaria
* @param valorDaPassagem
*/
public Viagem(Integer id, String objetivo, Date periodoInicial,
Date periodoFinal, String nomePessoa, boolean passagem,
boolean ajudaDeCusto, boolean diaria, boolean coletiva,
int valorDaAjudaDeCusto, Double valorDaDiaria,
Double valorDaPassagem) {
super();
this.id = id;
this.objetivo = objetivo;
this.periodoInicial = periodoInicial;
this.periodoFinal = periodoFinal;
this.nomePessoa = nomePessoa;
this.passagem = passagem;
this.ajudaDeCusto = ajudaDeCusto;
this.diaria = diaria;
this.coletiva = coletiva;
this.valorDaAjudaDeCusto = valorDaAjudaDeCusto;
this.valorDaDiaria = valorDaDiaria;
this.valorDaPassagem = valorDaPassagem;
}
/**
* @return the id
*/
public Integer getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the objetivo
*/
public String getObjetivo() {
return objetivo;
}
/**
* @param objetivo the objetivo to set
*/
public void setObjetivo(String objetivo) {
this.objetivo = objetivo;
}
/**
* @return the periodoInicial
*/
public Date getPeriodoInicial() {
return periodoInicial;
}
/**
* @param periodoInicial the periodoInicial to set
*/
public void setPeriodoInicial(Date periodoInicial) {
this.periodoInicial = periodoInicial;
}
/**
* @return the periodoFinal
*/
public Date getPeriodoFinal() {
return periodoFinal;
}
/**
* @param periodoFinal the periodoFinal to set
*/
public void setPeriodoFinal(Date periodoFinal) {
this.periodoFinal = periodoFinal;
}
/**
* @return the nomePessoa
*/
public String getNomePessoa() {
return nomePessoa;
}
/**
* @param nomePessoa the nomePessoa to set
*/
public void setNomePessoa(String nomePessoa) {
this.nomePessoa = nomePessoa;
}
/**
* @return the passagem
*/
public boolean isPassagem() {
return passagem;
}
/**
* @param passagem the passagem to set
*/
public void setPassagem(boolean passagem) {
this.passagem = passagem;
}
/**
* @return the ajudaDeCusto
*/
public boolean isAjudaDeCusto() {
return ajudaDeCusto;
}
/**
* @param ajudaDeCusto the ajudaDeCusto to set
*/
public void setAjudaDeCusto(boolean ajudaDeCusto) {
this.ajudaDeCusto = ajudaDeCusto;
}
/**
* @return the diaria
*/
public boolean isDiaria() {
return diaria;
}
/**
* @param diaria the diaria to set
*/
public void setDiaria(boolean diaria) {
this.diaria = diaria;
}
/**
* @return the coletiva
*/
public boolean isColetiva() {
return coletiva;
}
/**
* @param coletiva the coletiva to set
*/
public void setColetiva(boolean coletiva) {
this.coletiva = coletiva;
}
/**
* @return the valorDaAjudaDeCusto
*/
public int getValorDaAjudaDeCusto() {
return valorDaAjudaDeCusto;
}
/**
* @param valorDaAjudaDeCusto the valorDaAjudaDeCusto to set
*/
public void setValorDaAjudaDeCusto(int valorDaAjudaDeCusto) {
this.valorDaAjudaDeCusto = valorDaAjudaDeCusto;
}
/**
* @return the valorDaDiaria
*/
public Double getValorDaDiaria() {
return valorDaDiaria;
}
/**
* @param valorDaDiaria the valorDaDiaria to set
*/
public void setValorDaDiaria(Double valorDaDiaria) {
this.valorDaDiaria = valorDaDiaria;
}
/**
* @return the valorDaPassagem
*/
public Double getValorDaPassagem() {
return valorDaPassagem;
}
/**
* @param valorDaPassagem the valorDaPassagem to set
*/
public void setValorDaPassagem(Double valorDaPassagem) {
this.valorDaPassagem = valorDaPassagem;
}
public void setCidade(String cidade) {
this.cidade = cidade;
}
public String getCidade() {
return cidade;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Viagem other = (Viagem) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
tenho aqui meu persiste.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
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">
<persistence-unit name="bancoLocal" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>br.gov.ce.srh.siscontv.model.entity.Usuario</class>
<class>br.gov.ce.srh.siscontv.model.entity.Solicitacao</class>
<class>br.gov.ce.srh.siscontv.model.entity.Viagem</class>
<properties>
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.username" value="postgres" />
<property name="hibernate.connection.password" value="1234" />
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/SISCONTV" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
</properties>
</persistence-unit>
</persistence>
dae, qndo vou inserir um objeto viagem, aparece o seguinte erro:
09/09/2009 13:17:13 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SistemaControleDeViagem' did not find a matching property.
09/09/2009 13:17:13 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.16.
09/09/2009 13:17:13 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
09/09/2009 13:17:13 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
09/09/2009 13:17:13 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
09/09/2009 13:17:13 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 549 ms
09/09/2009 13:17:13 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
09/09/2009 13:17:13 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
09/09/2009 13:17:13 org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
09/09/2009 13:17:13 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra (1.2_13-b01-FCS) for context '/SistemaControleDeViagem'
09/09/2009 13:17:13 com.sun.faces.config.ConfigureListener contextInitialized
WARNING: JSF1059: WARNING! The com.sun.faces.verifyObjects feature is to aid developers not using tools. It shouldn''t be enabled if using an IDE, or if this application is being deployed for production as it will impact application start times.
09/09/2009 13:17:14 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
09/09/2009 13:17:14 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
09/09/2009 13:17:14 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1005 ms
09/09/2009 13:17:15 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/galileo/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SistemaControleDeViagem/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
09/09/2009 13:17:15 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/galileo/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SistemaControleDeViagem/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
09/09/2009 13:17:15 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/apache-tomcat-6.0.20/lib/jsf-impl.jar!/META-INF/mojarra_ext.taglib.xml
09/09/2009 13:17:15 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/galileo/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SistemaControleDeViagem/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
09/09/2009 13:17:15 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/galileo/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SistemaControleDeViagem/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
09/09/2009 13:17:15 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/galileo/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SistemaControleDeViagem/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select pessoa0_.Ds_Login as Ds1_0_0_, pessoa0_.MATRÍCULA as MATRÍCULA0_0_, pessoa0_.NOME as NOME0_0_, pessoa0_.[UNIDADE DE EXERCÍCIO] as UNIDADE4_0_0_ from [DADOS DO SERVIDOR] pessoa0_ where pessoa0_.Ds_Login=?
Hibernate: select pessoa0_.Ds_Login as Ds1_0_0_, pessoa0_.MATRÍCULA as MATRÍCULA0_0_, pessoa0_.NOME as NOME0_0_, pessoa0_.[UNIDADE DE EXERCÍCIO] as UNIDADE4_0_0_ from [DADOS DO SERVIDOR] pessoa0_ where pessoa0_.Ds_Login=?
Hibernate: insert into tbsisc_viagem (in_ajudacusto, ds_cidade, in_coletiva, in_diaria, ds_pessoa, ds_objetivo, in_passagem, dt_periodofinal, dt_periodoinicial, vl_ajudacusto, vl_diaria, vl_passagens) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
09/09/2009 13:17:37 com.sun.faces.application.ActionListenerImpl processAction
SEVERE: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
at br.gov.ce.srh.siscontv.model.DAO.ViagemDAO.inserirViagem(ViagemDAO.java:16)
at br.gov.ce.srh.siscontv.MB.SolicitacaoMB.inserirViagem(SolicitacaoMB.java:29)
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.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 20 more
Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
... 30 more
Caused by: java.sql.SQLException: Invalid object name 'tbsisc_viagem'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 45 more
09/09/2009 13:17:37 com.sun.faces.lifecycle.InvokeApplicationPhase execute
WARNING: #{solicitacaoMB.inserirViagem}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
javax.faces.FacesException: #{solicitacaoMB.inserirViagem}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 19 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
at br.gov.ce.srh.siscontv.model.DAO.ViagemDAO.inserirViagem(ViagemDAO.java:16)
at br.gov.ce.srh.siscontv.MB.SolicitacaoMB.inserirViagem(SolicitacaoMB.java:29)
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.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 20 more
Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [br.gov.ce.srh.siscontv.model.entity.Viagem]
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
... 30 more
Caused by: java.sql.SQLException: Invalid object name 'tbsisc_viagem'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 45 more
09/09/2009 13:17:37 com.sun.faces.lifecycle.Phase doPhase
SEVERE: JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /pages/cadSolicitacao.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@18dfa76]
09/09/2009 13:17:37 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.sql.SQLException: Invalid object name 'tbsisc_viagem'.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:368)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2816)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2254)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:631)
at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:584)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:546)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:505)
at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2176)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2656)
at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:646)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:620)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:624)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
at br.gov.ce.srh.siscontv.model.DAO.ViagemDAO.inserirViagem(ViagemDAO.java:16)
at br.gov.ce.srh.siscontv.MB.SolicitacaoMB.inserirViagem(SolicitacaoMB.java:29)
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.apache.el.parser.AstValue.invoke(AstValue.java:172)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
at java.lang.Thread.run(Unknown Source)
Porém, eu tenho a tabela chamada tbsisc_viagem.
Alguém poderia me dar uma ajuda ? Agradeceria já antecipadamente.