Re: Strange NullPointerException
Leo Mekenkamp <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <1079730390.5168.2.camel@jupiter> |
On Fri, 2004-03-19 at 20:55, "Gonçalo E.D. Luiz" wrote:
> 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.
When something strange happens to me, I always
- build all classes (i.e. rm -rf classes/*)
- run opp
- restart the database
99 out of a 100 times my problems go away.
Cheers,
Leo
--
.--. .---------------.----------------------------------------.
|o_o | | Leo Mekenkamp | Free, as in 'beer' and as in 'speech': |
|:_/ | | +31 641234919 | office software http://openoffice.org |
// \ \ | | 100% java odbms http://ozone-db.org |
(| | ) | Long Live Tux | e-mail & browser http://mozilla.org |
/'\_ _/`\ | | operating system http://linux.org |
\___)=(___/ `---------------'----------------------------------------'
-------------------------------------------------------
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_id70&alloc_id638&op=click