Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

  • Analyze the root cause of the "Bad value for type long" error
  • Identify that the fix has already been applied in PR Fix Hibernate ORM vs SQL schema discrepancies and document analysis #406 (merged to master)
    • Root cause: @Lob annotation on MatrixRow.symbolString caused Hibernate to use OID-based CLOB handling, but data was inserted via direct JDBC using setString()
    • Solution: Replaced @Lob with @Column(columnDefinition = "text") in MatrixRow.java and PhyloTree.java
  • Confirm this branch is based on master which already includes the fix
  • Improve error page display and logging to address "how can I see the rest of the log"
    • Enhanced dataAccessFailure.jsp with:
      • Collapsible details section for stack trace
      • Proper HTML escaping for safe display
      • Server-side logging via SLF4J for administrator review
      • User-friendly messaging
      • Try-with-resources for proper resource cleanup
    • Enhanced uncaughtException.jsp with:
      • Same improvements as dataAccessFailure.jsp
      • Removed cookie display (security improvement)
      • Better root cause extraction
      • Single logger instance (code review fix)
      • Try-with-resources for proper resource cleanup
  • Verify compilation and tests pass
  • Code review feedback addressed
  • CodeQL security check passed
Original prompt

I try to upload a nexus file but this happens:

Data Access Failure
could not load an entity: [org.cipres.treebase.domain.matrix.MatrixRow#37]; SQL [select matrixrow0_.MATRIXROW_ID as matrixro1_45_1_, matrixrow0_.VERSION as version2_45_1_, matrixrow0_.MATRIX_ID as matrix_i4_45_1_, matrixrow0_.SymbolString as symbolst3_45_1_, matrixrow0_.TAXONLABEL_ID as taxonlab5_45_1_, segments1_.MATRIXROW_ID as matrixr20_54_3_, segments1_.ROWSEGMENT_ID as rowsegme1_54_3_, segments1_.ROWSEGMENT_ID as rowsegme1_54_0_, segments1_.VERSION as version2_54_0_, segments1_.EndIndex as endindex3_54_0_, segments1_.MATRIXROW_ID as matrixr20_54_0_, segments1_.CatalogNum as catalogn4_54_0_, segments1_.CollectionCode as collecti5_54_0_, segments1_.Collector as collecto6_54_0_, segments1_.Country as country7_54_0_, segments1_.Elevation as elevatio8_54_0_, segments1_.GenBAccession as genbacce9_54_0_, segments1_.InstAcronym as instacr10_54_0_, segments1_.Latitude as latitud11_54_0_, segments1_.Locality as localit12_54_0_, segments1_.Longitude as longitu13_54_0_, segments1_.Notes as notes14_54_0_, segments1_.OtherAccession as otherac15_54_0_, segments1_.SampleDate as sampled16_54_0_, segments1_.State as state17_54_0_, segments1_.StartIndex as startin18_54_0_, segments1_.TAXONLABEL_ID as taxonla21_54_0_, segments1_.Title as title19_54_0_ from MATRIXROW matrixrow0_ left outer join ROWSEGMENT segments1_ on matrixrow0_.MATRIXROW_ID=segments1_.MATRIXROW_ID where matrixrow0_.MATRIXROW_ID=?]; nested exception is org.hibernate.exception.DataException: could not load an entity: [org.cipres.treebase.domain.matrix.MatrixRow#37]

org.springframework.dao.DataIntegrityViolationException: could not load an entity: [org.cipres.treebase.domain.matrix.MatrixRow#37]; SQL [select matrixrow0_.MATRIXROW_ID as matrixro1_45_1_, matrixrow0_.VERSION as version2_45_1_, matrixrow0_.MATRIX_ID as matrix_i4_45_1_, matrixrow0_.SymbolString as symbolst3_45_1_, matrixrow0_.TAXONLABEL_ID as taxonlab5_45_1_, segments1_.MATRIXROW_ID as matrixr20_54_3_, segments1_.ROWSEGMENT_ID as rowsegme1_54_3_, segments1_.ROWSEGMENT_ID as rowsegme1_54_0_, segments1_.VERSION as version2_54_0_, segments1_.EndIndex as endindex3_54_0_, segments1_.MATRIXROW_ID as matrixr20_54_0_, segments1_.CatalogNum as catalogn4_54_0_, segments1_.CollectionCode as collecti5_54_0_, segments1_.Collector as collecto6_54_0_, segments1_.Country as country7_54_0_, segments1_.Elevation as elevatio8_54_0_, segments1_.GenBAccession as genbacce9_54_0_, segments1_.InstAcronym as instacr10_54_0_, segments1_.Latitude as latitud11_54_0_, segments1_.Locality as localit12_54_0_, segments1_.Longitude as longitu13_54_0_, segments1_.Notes as notes14_54_0_, segments1_.OtherAccession as otherac15_54_0_, segments1_.SampleDate as sampled16_54_0_, segments1_.State as state17_54_0_, segments1_.StartIndex as startin18_54_0_, segments1_.TAXONLABEL_ID as taxonla21_54_0_, segments1_.Title as title19_54_0_ from MATRIXROW matrixrow0_ left outer join ROWSEGMENT segments1_ on matrixrow0_.MATRIXROW_ID=segments1_.MATRIXROW_ID where matrixrow0_.MATRIXROW_ID=?]; nested exception is org.hibernate.exception.DataException: could not load an entity: [org.cipres.treebase.domain.matrix.MatrixRow#37] at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:216) at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:374) at org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:334) at org.springframework.orm.hibernate5.HibernateTemplate.refresh(HibernateTemplate.java:542) at org.springframework.orm.hibernate5.HibernateTemplate.refresh(HibernateTemplate.java:537) at org.cipres.treebase.dao.AbstractDAO.refresh(AbstractDAO.java:41) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:234) at jdk.proxy3/jdk.proxy3.$Proxy115.refresh(Unknown Source) at org.cipres.treebase.service.study.SubmissionServiceImpl.addNexusFilesJDBC(SubmissionServiceImpl.java:637) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodI...

</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

@rvosa rvosa closed this Jan 15, 2026
@rvosa rvosa deleted the copilot/fix-data-access-failure branch January 15, 2026 18:40
Copilot stopped work on behalf of rvosa due to an error January 15, 2026 18:40
Copilot AI requested a review from rvosa January 15, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants