Strange NullPointerException

"Gonçalo E.D. Luiz" <[email protected]>
Newsgroups gmane.comp.java.ozone.user
Message-ID <[email protected]>
Hello. I've been away for some time, but now I'm Back :P

I'm getting a really wierd problem on generated proxy class. The 
generated code is as follows (except for System.out.println that I have 
added for some debug):

   public void run() {
       System.out.println("Tou no run do proxy !!!!!!!!!");
      try {
         System.out.println("O link e " + link);
         System.out.println("O this e : " + this);
         Object target = link.fetch (this, Lock.LEVEL_WRITE);
         System.out.println("O target e " + target);
         if (target!=null) {
            ((kernel.ExecutionElement) target).run();
         } else {
            Object[] args   = {};
            Object   result = link.invoke(this, 12, args, Lock.LEVEL_WRITE);
         }
      } catch (ExceptionInOzoneObjectException e) {
         Throwable ee = e.getCause();
        
         // Hope that the compiler is not so smart and detect these 
statements as unreachable if these exceptions are already matched above
         if (ee instanceof RuntimeException) {
             throw (RuntimeException) ee;
         }
        
         if (ee instanceof Error) {
             throw (Error) ee;
         }
        
         throw e; // Unhandled exception.
      } catch (RuntimeException e) {
         e.fillInStackTrace();
         throw e;
      } catch (Exception e) {
         e.fillInStackTrace();
         throw new UnexpectedException (e.toString());
      }
   }

On the STDOUT I'm getting the following:
     [java] Tou no run do proxy !!!!!!!!!
     [java] O link e org.ozoneDB.Database@13e0aba
     [java] O this e : class kernel.ExecutionElement_Proxy remoteID:113
     [java] java.lang.NullPointerException
     [java]     at kernel.ExecutionElement_Proxy.run(Unknown Source)
     [java]     at 
EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Po
oledExecutor.java:725)
     [java]     at java.lang.Thread.run(Thread.java:534)


I'm running this via a PooledExecutor, thats because the stack trace 
reports it. However, because of the System.out.println one can state 
that the problem is in the link.fetch method. The "this" object is, as 
printed, kernel.ExecutionElement_Proxy remoteID:113.

What am I doing wrong ?

Please be as fast as you can, I'm going mad.

Thank you very much,
Goncalo.



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.