-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: could not retrieve snapshot
PostPosted: Fri May 26, 2006 2:08 pm 
Newbie

Joined: Fri May 26, 2006 1:31 pm
Posts: 2
I use a session bean in jboss 4.0.2 with hibernate and the ejb was deployed with success, but when I call my bussines method I receive a exeception.
I must tell that the har archive was deployed with success too.
All mapping docs was created with JBOSS-IDE.

Hibernate version:
3.0.2

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 23/05/2006 12:06:20 by Hibernate Tools 3.1.0 beta3 -->
<hibernate-mapping>
<class name="com.docatel.versionador.pojos.Neax61brsigma45Rt" table="NEAX61BRSIGMA_4_5_rt">
<composite-id name="id" class="com.docatel.versionador.pojos.Neax61brsigma45RtId" >
<key-property name="codequipamento" type="big_decimal" >
<column name="_codequipamento" precision="22" scale="0" not-null="true"/>
</key-property>
<key-property name="rn" type="string">
<column name="rn" length="10" />
</key-property>
</composite-id>
<property name="coletado" type="char">
<column name="_coletado" length="1" not-null="true" />
</property>
<property name="estado" type="char">
<column name="_estado" length="1" not-null="true" />
</property>
<property name="operacao" type="char">
<column name="_operacao" length="1" not-null="true" />
</property>
<property name="datahora" type="timestamp">
<column name="_datahora" length="11" not-null="true" />
</property>
<property name="codusuario" type="big_decimal">
<column name="_codusuario" precision="22" scale="0" not-null="true" />
</property>
<property name="codinstrumento" type="big_decimal">
<column name="_codinstrumento" precision="22" scale="0" />
</property>
<property name="codscript" type="big_decimal">
<column name="_codscript" precision="22" scale="0" />
</property>
<property name="typeP" type="string">
<column name="type_p" length="50" />
</property>
<property name="typeTrk" type="string">
<column name="type_trk" length="50" />
</property>
<property name="acdxOr" type="java.lang.Byte">
<column name="acdx_or" precision="2" scale="0" />
</property>
<property name="typeChrg" type="string">
<column name="type_chrg" length="10" />
</property>
<property name="blk" type="string">
<column name="blk" length="3" />
</property>
<property name="rr" type="java.lang.Short">
<column name="rr" precision="3" scale="0" />
</property>
<property name="typeCn" type="string">
<column name="type_cn" length="50" />
</property>
<property name="node" type="string">
<column name="node" length="8" />
</property>
<property name="pad" type="string">
<column name="pad" length="50" />
</property>
<property name="clsRut" type="string">
<column name="cls_rut" length="50" />
</property>
<property name="pi" type="string">
<column name="pi" length="6" />
</property>
<property name="typeSw" type="string">
<column name="type_sw" length="50" />
</property>
<property name="sat" type="string">
<column name="sat" length="50" />
</property>
<property name="idIwk" type="string">
<column name="id_iwk" length="50" />
</property>
<property name="rtt" type="java.lang.Boolean">
<column name="rtt" precision="1" scale="0" />

ANOTHER MAPPNIGS WAS OMITTED .........

<property name="trkTst" type="string">
<column name="trk_tst" length="50" />
</property>
</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ServerException: RuntimeException; nested exception is:
org.hibernate.exception.GenericJDBCException: could not retrieve snapshot: [com.docatel.versionador.pojos.Neax61brsigma45Rt#component[codequipamento,rn]{rn=r, codequipamento=10}]
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy1.saveOrUpdate(Unknown Source)
at Cliente.main(Cliente.java:93)
Caused by: java.rmi.ServerException: RuntimeException; nested exception is:
org.hibernate.exception.GenericJDBCException: could not retrieve snapshot: [com.docatel.versionador.pojos.Neax61brsigma45Rt#component[codequipamento,rn]{rn=r, codequipamento=10}]
at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:386)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:873)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.exception.GenericJDBCException: could not retrieve snapshot: [com.docatel.versionador.pojos.Neax61brsigma45Rt#component[codequipamento,rn]{rn=r, codequipamento=10}]
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.getDatabaseSnapshot(BasicEntityPersister.java:893)
at org.hibernate.engine.PersistenceContext.getDatabaseSnapshot(PersistenceContext.java:302)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:189)
at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:408)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:82)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:454)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:449)
at com.docatel.versionador.ejb.VersionadorDAOBean.saveOrUpdate(VersionadorDAOBean.java:185)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
... 25 more
Caused by: java.sql.SQLException: ORA-00911: caractere inválido
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:799)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:839)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1132)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3329)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
at org.hibernate.persister.entity.BasicEntityPersister.getDatabaseSnapshot(BasicEntityPersister.java:868)

Name and version of the database you are using:
I'm using oracle 10g


My bussiness method:
/**
* Business method
*
* @ejb.interface-method view-type = "both"
*/
public void saveOrUpdate(Object instance) {
try {
factory.getCurrentSession().saveOrUpdate(instance);
} catch (RuntimeException re) {
throw re;
}

}

Thanks in advanced and excuse-me for my bad english.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 2:51 pm 
Regular
Regular

Joined: Thu Sep 22, 2005 1:53 pm
Posts: 88
Location: Rio de Janeiro
Maybe:

Caused by: java.sql.SQLException: ORA-00911: caractere inválido

this is in your stacktrace......
If you want to know it Hibernate is ok create a normal configuration file
and a simple java class where you create a sessionfactory....
Much faster to check your mappings and stuff like that.....

If you want to check the sql that hibernate generates put this in your configuration file :

Code:
<property name="show_sql">true</property>



Good Luck

_________________
Don´t forget to rate!


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 5:08 pm 
Newbie

Joined: Fri May 26, 2006 1:31 pm
Posts: 2
the sql generated is :


Hibernate: select neax61brsi_._codequipamento, neax61brsi_.rn, neax61brsi_._coletado as column3_14_, neax61brsi_._estado as column4_14_, neax61brsi_._operacao as column5_14_, neax61brsi_._datahora as column6_14_, neax61brsi_._codusuario as column7_14_, neax61brsi_._codinstrumento as column8_14_, neax61brsi_._codscript as column9_14_, neax61brsi_.type_p as type10_14_, neax61brsi_.type_trk as type11_14_, neax61brsi_.acdx_or as acdx12_14_, neax61brsi_.type_chrg as type13_14_, neax61brsi_.blk as blk14_, neax61brsi_.rr as rr14_, neax61brsi_.type_cn as type16_14_, neax61brsi_.node as node14_, neax61brsi_.pad as pad14_, neax61brsi_.cls_rut as cls19_14_, neax61brsi_.pi as pi14_, neax61brsi_.type_sw as type21_14_, neax61brsi_.sat as sat14_, neax61brsi_.id_iwk as id23_14_, neax61brsi_.rtt as rtt14_, neax61brsi_.ani as ani14_, neax61brsi_.mltrat as mltrat14_, neax61brsi_.pdc as pdc14_, neax61brsi_.esc as esc14_, neax61brsi_.id_scr as id29_14_, neax61brsi_.kind_cme as kind30_14_, neax61brsi_.chrg_rate as chrg31_14_, neax61brsi_.mp as mp14_, neax61brsi_.orgl_no as orgl33_14_, neax61brsi_.b_sc as b34_14_, neax61brsi_.tgn as tgn14_, neax61brsi_.ovf_thr as ovf36_14_, neax61brsi_.osd as osd14_, neax61brsi_.type_slct as type38_14_, neax61brsi_.cot as cot14_, neax61brsi_.unn as unn14_, neax61brsi_.clt_supt as clt41_14_, neax61brsi_.gci as gci14_, neax61brsi_.id_cn as id43_14_, neax61brsi_.sig_snd as sig44_14_, neax61brsi_.mfc_tdm as mfc45_14_, neax61brsi_.trk_tst as trk46_14_ from NEAX61BRSIGMA_4_5_rt neax61brsi_ where neax61brsi_._codequipamento=? and neax61brsi_.rn=?

The problem is my composite-id.... hibernate does not pass the information of the composite-id object for the sql query.
Exists any option for hibernate does it ?
I think that is occur because hibernate tries load first the external object and after the object inside (the composite-id object ) , how can I solve it ?


Thanks in advanced and excuse-me for my bad english


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.