Re: NPE caught in handleClientEvent in latest cvs-version

Arjen van der Meijden <[email protected]> Sat, 21 Aug 2004 15:32:40 +0200
Newsgroups gmane.comp.java.ozone.user
Message-ID <[email protected]>
I've adjusted the code of Ozone's InvokeServer (and a proxy of mine) to 
get the stacktrace of the NPE, here it is:

java.lang.NullPointerException
         at org.ozoneDB.Database.fetch(Database.java:235)
         at mypackage.user.UserImpl_Proxy.toString(UserImpl_Proxy.java:601)
         at java.lang.String.valueOf(String.java:2584)
         at java.lang.StringBuffer.append(StringBuffer.java:213)
         at 
org.ozoneDB.core.InvokeServer.handleClientEvent(InvokeServer.java:92)
         at 
org.ozoneDB.DxLib.net.DxMultiServerClient.run(DxMultiServerClient.java:44)
         at java.lang.Thread.run(Thread.java:595)

I have a toString in the interface/implementation-combo to have better 
toStrings than the default ozoneProxy ones. But apparently it doesn't 
really work well to have that toString be used inside Ozone, on the 
resulting object?

Anyway, there are two things I noticed here:
- The NPE from an in-database's remoteobject, so apparently the 
currentTransaction (Database.java:235) is null.
- The line InvokeServer.java:92 is not wrapped in an if to check for the 
loglevel.

The code around the UserImpl_Proxy.java:601 is here:
// This is 596
    public java.lang.String toString() {
       Object target;

       try {
          target = link.fetch(this, Lock.LEVEL_READ);
       } catch (Exception e) {
          //e.fillInStackTrace();
		 e.printStackTrace();
          throw new UnexpectedException(e.toString());
       }
// This is 607

Best regards,

Arjen van der Meijden

PS, the ozone-database isn't "ctrl+c"-safe anymore, it will simply stop, 
not close nicely if you use those keys.

On 21-8-2004 13:14, Arjen van der Meijden wrote:

> Hi list,
> 
> I've replaced my running ozone 1.2 with a cvs-version, just to see how 
> much performance-improvements and such it would jield. But I can't get 
> the code, that was running perfectly using 1.2, to run on the cvs-version.
> 
> The failing code is basically:
> OzoneMap map = (OzoneMap)db.objectForName("map_name");
>  // completes, map is a previously created NodeTreeMap and it's proxy is 
> returned to the client
> 
> Object x = map.get(someKey);
>  // does not complete, the clientside simply stalls, while the server is 
> catching an NPE
> 
> The above (extracted) code jields a serverside NPE in handleClientEvent, 
> according to the logging-output in the ozone-console/log. I've set it to 
> log at the FINEST-level and attached the log of those two calls.
> 
> Here is the last line of the log-output:
> WARNING [org.ozoneDB.core.InvokeServer.handleClientEvent] 
> handleClientEvent(): org.ozoneDB.UnexpectedException: 
> java.lang.NullPointerException
> 
> In the attached log, the get-command is issued with an Integer with the 
> value 1690. The return-value of that get-command at the NodeTreeMap is 
> null, by the way, I certainly hope that isn't causing this NPE over 
> there... I've not tested anything else yet, this was simply cleaning up 
> the database (ozoneInst) and starting the application again. All classes 
> have been recompiled (and run through opp), the JVM is jdk 1.5.0-beta2 
> but the Ozone-1.2 was also run in 1.5 (not compiled though).
> 
> Best regards,
> 
> Arjen van der Meijden



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285