openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
Subject Re: Bad value for type BigDecimal : Y
Date Thu, 11 Jun 2009 16:56:56 GMT
Can you provide more details on the Stockingpoint entity being used, 
like the orm.xml or annotations?


-Donald


Ashish Jain wrote:
> Hi All,
> 
> I am using apache geronimo v2.1.4 which is bundled with openJPA 1.2.1 and
> postgresql 8.5.3. while running an applicaiton which is based on JSF and
> EJB's I get the following error.
> 
> 
> 2009-06-11 16:19:58,417 TRACE [Runtime] An exception occurred while ending
> the transaction. This exception will be re-thrown.
> <openjpa-1.0.3-r420667:677674 nonfatal store error>
> org.apache.openjpa.util.StoreException: Bad value for type BigDecimal : Y
> at
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:3951)
> at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:97)
> at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:83)
> at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:59)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:491)
> at
> org.apache.openjpa.kernel.DelegatingStoreManager.load(DelegatingStoreManager.java:116)
> at org.apache.openjpa.kernel.ROPStoreManager.load(ROPStoreManager.java:78)
> at
> org.apache.openjpa.kernel.StateManagerImpl.loadFields(StateManagerImpl.java:2886)
> at
> org.apache.openjpa.kernel.StateManagerImpl.loadField(StateManagerImpl.java:2964)
> at
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1586)
> at
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1485)
> at
> org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.java:808)
> at
> org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl.java:4621)
> at
> org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$000(BrokerImpl.java:4361)
> at
> org.apache.openjpa.kernel.BrokerImpl.hasTransactionalObjects(BrokerImpl.java:3740)
> at org.apache.openjpa.kernel.BrokerImpl.setDirty(BrokerImpl.java:3844)
> at
> org.apache.openjpa.kernel.StateManagerImpl.setPCState(StateManagerImpl.java:207)
> at
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1546)
> at
> org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1485)
> at
> org.apache.openjpa.kernel.StateManagerImpl.dirtyCheck(StateManagerImpl.java:808)
> at
> org.apache.openjpa.kernel.BrokerImpl$ManagedCache.dirtyCheck(BrokerImpl.java:4621)
> at
> org.apache.openjpa.kernel.BrokerImpl$ManagedCache.access$000(BrokerImpl.java:4361)
> at
> org.apache.openjpa.kernel.BrokerImpl.hasTransactionalObjects(BrokerImpl.java:3740)
> at
> org.apache.openjpa.kernel.BrokerImpl.getTransactionalStates(BrokerImpl.java:3729)
> at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1872)
> at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1853)
> at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1771)
> at
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:514)
> at
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:499)
> at
> org.apache.geronimo.transaction.manager.TransactionImpl.rollback(TransactionImpl.java:472)
> at
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback(TransactionManagerImpl.java:258)
> at
> org.apache.openejb.core.transaction.TransactionPolicy.rollbackTransaction(TransactionPolicy.java:183)
> at
> org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:78)
> at
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:233)
> at
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
> at
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
> at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:217)
> at
> org.apache.openejb.core.ivm.EjbObjectProxyHandler._invoke(EjbObjectProxyHandler.java:77)
> at
> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:245)
> at
> org.apache.openejb.util.proxy.Jdk13InvocationHandler.invoke(Jdk13InvocationHandler.java:49)
> at $Proxy21.findByInsAndType(Unknown Source)
> at
> com.tnhsp.mbeans.biomedicalwaste.wasteDetailsMBean.getStockingpointList(wasteDetailsMBean.java:1658)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
> at java.lang.reflect.Method.invoke(Method.java:599)
> at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
> at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
> at
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$301(FacesCompositeELResolver.java:46)
> at
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$4.invoke(FacesCompositeELResolver.java:108)
> at
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke(FacesCompositeELResolver.java:148)
> at
> org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:104)
> at org.apache.el.parser.AstValue.getValue(AstValue.java:118)
> at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
> at
> org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
> at javax.faces.component.UIData.getValue(UIData.java:978)
> at javax.faces.component.UIData.createDataModel(UIData.java:758)
> at javax.faces.component.UIData.getDataModel(UIData.java:732)
> at javax.faces.component.UIData.getRowCount(UIData.java:174)
> at
> org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:235)
> at
> org.apache.myfaces.shared_impl.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:137)
> at
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:594)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:239)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:246)
> at javax.faces.component.UIComponent.encodeAll(UIComponent.java:246)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:424)
> at
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:380)
> at
> org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
> at
> org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
> at
> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
> at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at SessionFilter.doFilter(SessionFilter.java:43)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
> at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
> at
> org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
> at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
> 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:233)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
> at
> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
> at
> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
> at
> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
> 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.valves.AccessLogValve.invoke(AccessLogValve.java:568)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:735)
> Caused by:
> org.postgresql.util.PSQLException: Bad value for type BigDecimal : Y
> at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.toBigDecimal(AbstractJdbc2ResultSet.java:2710)
> at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBigDecimal(AbstractJdbc2ResultSet.java:2133)
> at
> org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBigDecimal(AbstractJdbc2ResultSet.java:311)
> at
> org.tranql.connector.jdbc.ResultSetHandle.getBigDecimal(ResultSetHandle.java:179)
> at
> org.apache.openjpa.lib.jdbc.DelegatingResultSet.getBigDecimal(DelegatingResultSet.java:282)
> at
> org.apache.openjpa.jdbc.sql.DBDictionary.getBigDecimal(DBDictionary.java:389)
> at
> org.apache.openjpa.jdbc.sql.PostgresDictionary.getInt(PostgresDictionary.java:210)
> at org.apache.openjpa.jdbc.sql.DBDictionary.getChar(DBDictionary.java:556)
> at
> org.apache.openjpa.jdbc.sql.ResultSetResult.getCharInternal(ResultSetResult.java:288)
> at
> org.apache.openjpa.jdbc.sql.ResultSetResult.getObjectInternal(ResultSetResult.java:356)
> at
> org.apache.openjpa.jdbc.sql.AbstractResult.getObject(AbstractResult.java:662)
> at
> org.apache.openjpa.jdbc.meta.strats.HandlerStrategies.loadDataStore(HandlerStrategies.java:205)
> at
> org.apache.openjpa.jdbc.meta.strats.HandlerFieldStrategy.load(HandlerFieldStrategy.java:172)
> at org.apache.openjpa.jdbc.meta.FieldMapping.load(FieldMapping.java:796)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:833)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:785)
> at
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:475)
> ... 92 more
> 
> 
> The error is being thrown when this query is executed.
> 2009-06-11 15:35:44,366 TRACE [SQL] <t 969554378, conn 180619972> executing
> prepstmnt 261558167 SELECT t0.st_spom_id, t0.st_spom_crt_dt,
> t0.st_spom_crt_uid, t1.AIS_INSM_CODE, t1.AIS_INSM_TYPE, t1.AIS_INSM_BEMONC,
> t1.AIS_INSM_BEMONC_START_DATE, t1.AIS_INSM_BLOCK,
> t1.AIS_INSM_BLOCK_PHC_ATTACHED, t1.AIS_INSM_CEMONC,
> t1.AIS_INSM_CEMONC_START_DATE, t1.AIS_INSM_CRT_DT, t1.AIS_INSM_CRT_UID,
> t1.AIS_INSM_DISTRICT, t1.AIS_INSM_EFFECT_DT, t1.AIS_INSM_HSC_DELIVERY_ROOM,
> t1.AIS_INSM_HSC_LAB, t1.AIS_INSM_HSC_TRIBAL_STATUS, t1.AIS_INSM_HUD,
> t1.AIS_INSM_NAME, t1.AIS_INSM_LAST_UPD_DT, t1.AIS_INSM_LAST_UPD_UID,
> t1.AIS_INSM_LOCAL_BODY, t1.AIS_INSM_LOCATION, t1.AIS_INSM_ORGANISAION,
> t1.AIS_INSM_PHC_ATTACHED, t1.AIS_INSM_PHC_DELIVERY_ROOM,
> t1.AIS_INSM_PHC_LAB_STATUS, t1.AIS_INSM_PHC_TRIBAL_STATUS,
> t1.AIS_INSM_STATUS, t1.AIS_INSM_SUB_TYPE, t1.AIS_INSM_TALUK,
> t0.st_spom_last_upd_udt, t0.st_spom_last_upd_uid, t0.st_spom_status,
> t0.st_spom_code, t0.st_spom_desc, t0.st_spom_stocking_point_grade,
> t0.st_spom_type, t0.st_spom_ward_id FROM st_stocking_point_master t0 LEFT
> OUTER JOIN AIS_INSTITUTION_MASTER t1 ON t0.st_spom_institution =
> t1.AIS_INSM_CODE WHERE (t0.st_spom_institution = ? AND (t0.st_spom_type = ?
> OR t0.st_spom_type = ? OR t0.st_spom_type = ? OR t0.st_spom_type = ? OR
> t0.st_spom_type = ? OR t0.st_spom_type = ? OR t0.st_spom_type = ?) AND
> t0.st_spom_type IS NOT NULL) [params=(String) 00017, (String) WARD, (String)
> OT, (String) OPD, (String) LAB, (String) PHARMACY, (String) ICTC, (String)
> DEPT]
> 
> I have tried manually executing the query from admin console  of geronimo
> and the query runs fine.
> 
> I also modified my persistence.xml as follows however result is same
> 
> <?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="tnhsp-ejbPU" transaction-type="JTA">
> <jta-data-source>live</jta-data-source>
> <property name="openjpa.jdbc.QuerySQLCache" value="false"/>
> <property name="openjpa.jdbc.SynchronizeMappings" value="false"/>
> <property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.PostgresDictionary(Supports
> DeferredConstraints=false)"/>
> <property name="openjpa.TransactionMode" value="managed"/>
> <property name="openjpa.RetryClassRegistration" value="true" />
> <property name="openjpa.ConnectionDriverName"
> value="org.postgresql.Driver"/>
> <properties/>
> </persistence-unit>
> </persistence>
> 
> 
> Debugging the application code suggests the error is being thrown while
> executing this statement
> 
>  this.list = this.em.createQuery("Select p from Stockingpoint p where
> p.institution.institutionCode=:ins and p.stockingType in
> ('WARD','OT','OPD','LAB','PHARMACY','ICTC','DEPT')").setParameter("ins",
> ins).getResultList();
> 
> 
> Any help in this regard will be very helpful.
> 
> Thanks
> Ashish
> 

Mime
View raw message