Skip to main content

DataSet NullPointerException with b98 and Derby

2 replies [Last post]
fuerte
Offline
Joined: 2004-11-22

I get the following excection quite frequently but not always:

<br />
java.sql.SQLRuntimeException: Cannot store DataSet instance to WeakHashMap<br />
        at com.sun.sql.QueryObject.registerDataSet(QueryObject.java:1306)<br />
        at com.sun.sql.QueryObject.getQueryImpl(QueryObject.java:767)<br />
        at com.sun.sql.QueryObject.access$000(QueryObject.java:26)<br />
        at com.sun.sql.QueryObject$1.run(QueryObject.java:229)<br />
        at java.security.AccessController.doPrivileged(Native Method)<br />
        at com.sun.sql.QueryObject.invoke(QueryObject.java:224)<br />
        at $Proxy6.system_Prefs_get(Unknown Source)<br />
        at Kahvi.Kahvi.get_sys_pref(Kahvi.java:871)<br />
        at Kahvi.Kahvi.get_sys_pref(Kahvi.java:867)<br />
        at Kahvi.Kahvi.cache_filename(Kahvi.java:2572)<br />
        at Kahvi.Kahvi.servletThumb(Kahvi.java:321)<br />
        at Kahvi.thumb.processKahvi(thumb.java:23)<br />
        at Kahvi.KahviServlet.processRequest(KahviServlet.java:67)<br />
        at Kahvi.KahviServlet.doGet(KahviServlet.java:89)<br />
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)<br />
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br />
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br />
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />
        at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)<br />
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br />
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)<br />
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)<br />
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br />
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br />
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br />
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)<br />
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)<br />
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br />
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)<br />
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)<br />
        at java.lang.Thread.run(Thread.java:619)<br />
Caused by: java.lang.NullPointerException<br />
        at com.sun.sql.DataSetImpl$DataSetItr.(DataSetImpl.java:1759)<br />
        at com.sun.sql.DataSetImpl$DataSetListIterator.(DataSetImpl.java:1846)<br />
        at com.sun.sql.DataSetImpl.listIterator(DataSetImpl.java:1628)<br />
        at java.util.AbstractList.equals(AbstractList.java:503)<br />
        at java.util.WeakHashMap.eq(WeakHashMap.java:259)<br />
        at java.util.WeakHashMap.put(WeakHashMap.java:406)<br />
        at com.sun.sql.QueryObject.registerDataSet(QueryObject.java:1304)<br />
        ... 32 more<br />

My code is very much like the sample in DataSet documentation. Any clues what might be causing this?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
forax
Offline
Joined: 2004-10-07

Perhaps a known bug :
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6466201

It seems to be a difference between the number of arguments
of the SQL request and its corresponding method.

Rémi

fuerte
Offline
Joined: 2004-11-22

Thanks for finding that bug. It is a similar error, but I am able to workaround my problem by creating the BaseQuery proxy in the function where I create DataSet next. If I have created the proxy earlier, in another thread perhaps, then I get that error. I filed a bug of my case.