• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP findByPrimaryKey() - conversion error

 
Neil Richards
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm running Weblogic 6.0 and have deployed a CMP bean mapped against a SQL Anywhere 8 table with a primary key of data type String. When I call findByPrimaryKey("US") I get the following exception:
javax.ejb.FinderException: Problem in findByPrimaryKey while preparing or executing statement: 'weblogic.jdbc.jts.PreparedStatement@62f6b0':
com.sybase.jdbc.SybSQLException: ASA Error -157: Cannot convert AD to a numeric(30,6)
at com.sybase.tds.Tds.processEed(Tds.java)
at com.sybase.tds.Tds.nextResult(Tds.java)
at com.sybase.tds.TdsResultSet.nextResult(TdsResultSet.java)
at com.sybase.tds.TdsResultSet.next(TdsResultSet.java)
at com.sybase.jdbc.SybResultSet.next(SybResultSet.java)
at weblogic.jdbcbase.jts.ResultSet.next(ResultSet.java:255)
at com.noblestar.server.ejb.entitybean.CountryBean11_WebLogic_CMP_RDBMS.ejbFindByPrimaryKey(CountryBean11_WebLogic_CMP_RDBMS.java:318)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.cmp11.rdbms.PersistenceManagerImpl.findByPrimaryKey(PersistenceManagerImpl.java:109)
at weblogic.ejb20.manager.BaseEntityManager.findByPrimaryKey(BaseEntityManager.java:171)
at weblogic.ejb20.manager.BaseEntityManager.findByPrimaryKey(BaseEntityManager.java:144)
at weblogic.ejb20.internal.EntityEJBHome.findByPrimaryKey(EntityEJBHome.java:486)
at com.noblestar.server.ejb.entitybean.CountryBean11HomeImpl.findByPrimaryKey(CountryBean11HomeImpl.java:145)
at com.noblestar.server.ejb.entitybean.CountryBean11HomeImpl_WLSkel.invoke(CountryBean11HomeImpl_WLSkel.java:130)
at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:373)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:128)
at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:237)
at weblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestHandler.java:118)
at weblogic.rmi.internal.BasicRequestDispatcher.dispatch(BasicRequestDispatcher.java:115)
at weblogic.rmi.internal.ServerRequest.sendOneWayRaw(ServerRequest.java:88)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
at com.noblestar.server.ejb.entitybean.CountryBean11HomeImpl_WLStub.findByPrimaryKey(CountryBean11HomeImpl_WLStub.java:189)
at com.noblestar.server.ejb.sessionbean.TestBean11.getCountry(TestBean11.java:92)
at com.noblestar.server.ejb.sessionbean.TestBean11Impl.getCountry(TestBean11Impl.java:130)
at com.noblestar.server.ejb.sessionbean.TestBean11EOImpl.getCountry(TestBean11EOImpl.java:65)
at com.noblestar.server.ejb.sessionbean.TestBean11EOImpl_WLSkel.invoke(TestBean11EOImpl_WLSkel.java:72)
at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:373)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:128)
at weblogic.rmi.internal.BasicServerAdapter.invoke(BasicServerAdapter.java:237)
at weblogic.rmi.internal.BasicRequestHandler.handleRequest(BasicRequestHandler.java:118)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:17)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
at weblogic.rmi.internal.AbstractOutboundRequest.sendReceive(AbstractOutboundRequest.java:90)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:225)
at com.noblestar.server.ejb.sessionbean.TestBean11EOImpl_WLStub.getCountry(TestBean11EOImpl_WLStub.java:129)
at com.noblestar.client.gui.CountryPanel.<init>(CountryPanel.java:79)
at com.noblestar.client.gui.TestFrame.<init>(TestFrame.java:30)
at com.noblestar.client.gui.TestFrame.main(TestFrame.java:40)
Could someone please explain what I might be doing wrong for it to try and do a conversion from String (and a value of 'AD' not 'US') to Numeric(30,6) ?
Many thanks,
Neil
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!