While installing xnat 1.3.3 on os x I ran across the following issue
with the jdbc driver. I'm running postgres 8.2.5 and assumed I could
use the corresponding jdbc driver postgresql-8.2-506.jdbc3.jar. When
executing the StoreXML command at stage 8 it fails when trying to read
the resultset from postgres with the error below.
It looks like the later postgres jdbc drivers now requires that jdbc
resultset be explicitly defined as TYPE_SCROLL_INSENSITIVE or
TYPE_SCROLL_SENSITIVE to use the first/last methods etc in
org.apache.commons.dbcp.DelegatingResultSet class. I tested this by
reverted the jdbc driver back to pg74.216.jdbc2ee.jar and all was
well.
Just thought this would be good to know if anyone else installs with
recent drivers and comes across the same issue.
James
> StoreXML -project xnat -l security/security.xml -allowDataDeletion
Error Output:
> Unable to connect to web service.
> SETTINGS LOCATION: /Users/jdickson/Desktop/dev/xnat/deployments/xnat/
> WARNING: Data Type:xdat:userGroup has no columns which uniquely identify it.
> WARNING: Data Type:xnat:statisticsData has no columns which uniquely identify it.
> WARNING: Data Type:xnat:abstractStatistics has no columns which uniquely identify it.
> WARNING: Data Type:xnat:qcAssessmentData_scan has no columns which uniquely identify it.
> WARNING: Data Type:wrk:abstractExecutionEnvironment has no columns which uniquely identify it.
> WARNING: Data Type:wrk:xnatExecutionEnvironment has no columns which uniquely identify it.
> WARNING: Data Type:wrk:xnatExecutionEnvironment_notify has no columns which uniquely identify it.
> Found Document:security/security.xml
> XERCES - XML Document is valid
> Loaded XML Item:xdat:security
> Validation: PASSED
> Operation requires a scrollable ResultSet, but this ResultSet is FORWARD_ONLY.
> ERROR: See log for details (logs/xdat.log).
Here's the stack:
org.postgresql.util.PSQLException: Operation requires a scrollable
ResultSet, but this ResultSet is FORWARD_ONLY.
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkScrollable(AbstractJdbc2ResultSet.java:
190)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.first(AbstractJdbc2ResultSet.java:
275)
at
org.apache.commons.dbcp.DelegatingResultSet.first(DelegatingResultSet.java:
325)
at org.nrg.xft.db.PoolDBUtils.getNextID(PoolDBUtils.java:155)
at org.nrg.xft.db.DBAction.InsertItem(DBAction.java:1749)
at org.nrg.xft.db.DBAction.StoreItem(DBAction.java:664)
at org.nrg.xft.db.DBAction.StoreItem(DBAction.java:155)
at org.nrg.xft.db.DBAction.StoreItem(DBAction.java:505)
at org.nrg.xft.db.DBAction.StoreItem(DBAction.java:84)
at org.nrg.xft.XFTItem.save(XFTItem.java:6112)
at org.nrg.xdat.XDATTool.storeXML(XDATTool.java:196)
at org.nrg.xdat.XDATTool.storeXML(XDATTool.java:130)
at StoreXML.process(StoreXML.java:255)
at
org.nrg.xft.commandPrompt.CommandPromptTool._process(CommandPromptTool.java:
204)
at
org.nrg.xft.commandPrompt.CommandPromptTool.run(CommandPromptTool.java:
178)
at
org.nrg.xft.commandPrompt.CommandPromptTool.<init>(CommandPromptTool.java:
76)
at StoreXML.<init>(StoreXML.java:45)
at StoreXML.main(StoreXML.java:49)
I had the same issue. As I was editing the code, I replaced all
occurences of
st = getConnection(db).createStatement();
by
st =
getConnection(db).createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
into the XDAT code.
And then everything worked fine.
Adrien
I'll add it to the source for version 1.4.
Tim