I get the following error on select using jpa from a table (no joins), the table data columns are all there in database and other similar classes and functions are there for other tables and work just fine (same logic just different table), I have no idea what the cause of this error is the jpa class and code to get select are below --------------------------------------------------------------------------------------- [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><100,temp=11:22:33:44:55:66] [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><200] [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><201] [DEBUG][Database][logQuery][10:14:00:AM][select * from MODEM_DEVICE a where a.CM_MACADDRESS = '11:22:33:44:55:66'] [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><300] [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><400, q = org.apache.openjpa.persistence.queryi...@11314cc ] [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><400.5, id=888] [ERROR][Database][getModemDeviceByCmMacAddress][10:14:00:AM][><><><430] [ERROR][DeviceManagementEJB][createHsdDevice][10:14:00:AM][[EXCEPTION=<1.0.0 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null
[ERROR[[EXCEPTION=<1.0.0 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: null at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:857) at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:756) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:776) at org.apache.openjpa.jdbc.kernel.GenericResultObjectProvider.getResultObject(GenericResultObjectProvider.java:93) at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:36) at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1219) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:987) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:796) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:766) at kodo.kernel.KodoQuery.execute(KodoQuery.java:43) at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:762) at kodo.kernel.KodoQuery.execute(KodoQuery.java:39) at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517) at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:230) at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:269) at com.mcc.maestro.persistence.Database.getModemDeviceByCmMacAddress(Unknown Source) --------------------------------------------------------------------------------------- @Entity() @Table(name = "MODEM_DEVICE") public class ModemDevice implements Serializable { //default serial version id, required for serializable classes. private static final long serialVersionUID = 1L; private Long id; private String classOfService; private String cmMacaddress; private String createdBy; private java.sql.Timestamp dateCreated; private java.sql.Timestamp dateModified; private String dhcpCriteria; private String docsisVersion; private String firmwareVersion; private String modifiedBy; private long orderedProductId; private String ownerId; private long maxCpe; public ModemDevice() { } @Id() @SequenceGenerator(name = "ModemDeviceIdGenerator", sequenceName = "SEQ_MODEM_DEVICE") @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ModemDeviceIdGenerator") @Column(name = "ID", unique = true, nullable = false, precision = 38) public Long getId() { return this.id; } public void setId(Long id) { this.id = id; } @Column(name = "MAX_CPE") public Long getMaxCpe() { return this.maxCpe; } public void setMaxCpe(Long maxCpe) { this.maxCpe = maxCpe; } @Column(name = "CLASS_OF_SERVICE") public String getClassOfService() { return this.classOfService; } public void setClassOfService(String classOfService) { this.classOfService = classOfService; } @Column(name = "OWNER_ID") public String getOwnerId() { return Tools.checkForNULLUpperTrim(this.ownerId); } public void setOwnerId(String temp) { this.ownerId = Tools.checkForNULLUpperTrim(temp); } @Column(name = "CM_MACADDRESS") public String getCmMacaddress() { return com.mcc.maestro.utils.Tools.formatMacaddressToStandardFormat(this.cmMacaddress); } public void setCmMacaddress(String cmMacaddress) { this.cmMacaddress = com.mcc.maestro.utils.Tools.formatMacaddressToStandardFormat(cmMacaddress); } @Column(name = "CREATED_BY") public String getCreatedBy() { return Tools.checkForNULLUpperTrim(this.createdBy); } public void setCreatedBy(String createdBy) { this.createdBy = Tools.checkForNULLUpperTrim(createdBy); } @Column(name = "DATE_CREATED") public java.sql.Timestamp getDateCreated() { return this.dateCreated; } public void setDateCreated(java.sql.Timestamp dateCreated) { this.dateCreated = dateCreated; } @Column(name = "DATE_MODIFIED") public java.sql.Timestamp getDateModified() { return this.dateModified; } public void setDateModified(java.sql.Timestamp dateModified) { this.dateModified = dateModified; } @Column(name = "DHCP_CRITERIA") public String getDhcpCriteria() { return this.dhcpCriteria; } public void setDhcpCriteria(String dhcpCriteria) { this.dhcpCriteria = dhcpCriteria; } @Column(name = "DOCSIS_VERSION") public String getDocsisVersion() { return this.docsisVersion; } public void setDocsisVersion(String docsisVersion) { this.docsisVersion = Tools.checkForNULLUpperTrim(docsisVersion); } @Column(name = "FIRMWARE_VERSION") public String getFirmwareVersion() { return this.firmwareVersion; } public void setFirmwareVersion(String firmwareVersion) { this.firmwareVersion = Tools.checkForNULLUpperTrim(firmwareVersion); } @Column(name = "MODIFIED_BY") public String getModifiedBy() { return this.modifiedBy; } public void setModifiedBy(String modifiedBy) { this.modifiedBy = Tools.checkForNULLUpperTrim(modifiedBy); } @Column(name = "ORDERED_PRODUCT_ID") public long getOrderedProductId() { return this.orderedProductId; } public void setOrderedProductId(long orderedProductId) { this.orderedProductId = orderedProductId; } public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof ModemDevice)) { return false; } ModemDevice castOther = (ModemDevice) other; return new EqualsBuilder().append(this.getId(), castOther.getId()).isEquals(); } public int hashCode() { return new HashCodeBuilder().append(getId()).toHashCode(); } } --------------------------------------------------------------------------------------- public ModemDevice getModemDeviceByCmMacAddress ( final String temp , final EntityManager em , final boolean canCloseEntityManager ) { LOG.error("><><><100,temp="+temp); ModemDevice rtn = null ; try { LOG.error("><><><200"); final String sql = "select * from MODEM_DEVICE a where a.CM_MACADDRESS = \'" + temp + "\'" ; LOG.error("><><><201"); // i get the same issue with JPAQL final Query q = em.createNativeQuery( sql , ModemDevice.class ) ; this.logQuery( sql ) ; LOG.error("><><><300"); if ( q != null ) { LOG.error("><><><400, q = "+q+"\n"); List rslts = q.getResultList( ); // fails at this line, persistence exception null // never gets past here List rslts = throws the error LOG.error("><><><401"); if ( (rslts!=null) && (rslts.size( )>0) ) { LOG.error("><><><402"); rtn = (ModemDevice)rslts.get( 0 ); LOG.error("><><><403"); } } } catch ( final NoResultException nre ) { LOG.error("><><><410"); rtn = null ; } finally { if ( canCloseEntityManager ) { LOG.error("><><><430"); this.closeEntityManager( em ) ; } } return rtn ; } -- View this message in context: http://n2.nabble.com/select-query-on-database-returns-null-exception-at-getResultList-tp4393514p4393514.html Sent from the OpenJPA Users mailing list archive at Nabble.com.