Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO / Net4J]Null Pointer Exception
[CDO / Net4J]Null Pointer Exception [message #425660] Thu, 04 December 2008 09:23 Go to next message
David Bonneau is currently offline David BonneauFriend
Messages: 28
Registered: July 2009
Junior Member
Hi

I'm working wtih CDO and Net4J. I was on CDO/Net4J 1.0.3 and it works
fine except a LRUCache bug. I upgraded to 2.0.0M3.

It works but I have lot of NullPointerException in Net4J. I suspect a
no thread safe code. The stack trace is :

Exception in thread "Thread-286" java.lang.NullPointerException
at
org.eclipse.net4j.signal.IndicationWithMonitoring$1.run(Indi cationWithMonitoring.java:94)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)


In IndicationWithMonitoring we have the following code. It crashes on
sendProgress call with a null monitor. I think between while and
sendProgress there is another thread wich set the monitor field to null ?

while (monitor != null)
{
if (System.currentTimeMillis() - lastMonitorAccess >
monitorProgressInterval)
{
setMonitorCanceled();
break;
}

sendProgress(monitor.getTotalWork(), monitor.getWork());
ConcurrencyUtil.sleep(monitorProgressInterval);
}


I'm also quite surprised with the number of threads. I have more than
1000 Daemon Threads in my Eclipse Debug view. With the previous Net4J
version (1.0.3), I had no more than ten Daemon Thread.

I tried to reproduce the problem with a small unit test and a
MEMStore, but it works (no NPE, but lot of threads). I'm working with my
own Store implementation, perhaps I miss something ? I try to add a
synchronized on IStoreAccessor commit method but it still doesn't work.

Someone have an idea ?

David
Re: [CDO / Net4J]Null Pointer Exception [message #425663 is a reply to message #425660] Thu, 04 December 2008 12:48 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Hi David,

I think you are right about the threading.

Can you open a bugzilla ?

About the nullpointer exception..I was sure that we fixed that lately
but I'm not able to find the bugzilla...

But looking at the code you are totally right.

Can you open another bugzilla ? They will be fix very soon!!

Simon



David Bonneau wrote:
> Hi
>
> I'm working wtih CDO and Net4J. I was on CDO/Net4J 1.0.3 and it works
> fine except a LRUCache bug. I upgraded to 2.0.0M3.
>
> It works but I have lot of NullPointerException in Net4J. I suspect a
> no thread safe code. The stack trace is :
>
> Exception in thread "Thread-286" java.lang.NullPointerException
> at
> org.eclipse.net4j.signal.IndicationWithMonitoring$1.run(Indi cationWithMonitoring.java:94)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:650)
>
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:675)
>
> at java.lang.Thread.run(Thread.java:595)
>
>
> In IndicationWithMonitoring we have the following code. It crashes on
> sendProgress call with a null monitor. I think between while and
> sendProgress there is another thread wich set the monitor field to null ?
>
> while (monitor != null)
> {
> if (System.currentTimeMillis() - lastMonitorAccess >
> monitorProgressInterval)
> {
> setMonitorCanceled();
> break;
> }
>
> sendProgress(monitor.getTotalWork(), monitor.getWork());
> ConcurrencyUtil.sleep(monitorProgressInterval);
> }
>
>
> I'm also quite surprised with the number of threads. I have more than
> 1000 Daemon Threads in my Eclipse Debug view. With the previous Net4J
> version (1.0.3), I had no more than ten Daemon Thread.
>
> I tried to reproduce the problem with a small unit test and a MEMStore,
> but it works (no NPE, but lot of threads). I'm working with my own Store
> implementation, perhaps I miss something ? I try to add a synchronized
> on IStoreAccessor commit method but it still doesn't work.
>
> Someone have an idea ?
>
> David
Re: [CDO / Net4J]Null Pointer Exception [message #425669 is a reply to message #425663] Thu, 04 December 2008 13:30 Go to previous message
David Bonneau is currently offline David BonneauFriend
Messages: 28
Registered: July 2009
Junior Member
I opened 2 bugzilla :

-https://bugs.eclipse.org/bugs/show_bug.cgi?id=257523
-https://bugs.eclipse.org/bugs/show_bug.cgi?id=257526

David

Simon McDuff a écrit :
> Hi David,
>
> I think you are right about the threading.
>
> Can you open a bugzilla ?
>
> About the nullpointer exception..I was sure that we fixed that lately
> but I'm not able to find the bugzilla...
>
> But looking at the code you are totally right.
>
> Can you open another bugzilla ? They will be fix very soon!!
>
> Simon
>
>
>
> David Bonneau wrote:
>> Hi
>>
>> I'm working wtih CDO and Net4J. I was on CDO/Net4J 1.0.3 and it works
>> fine except a LRUCache bug. I upgraded to 2.0.0M3.
>>
>> It works but I have lot of NullPointerException in Net4J. I suspect a
>> no thread safe code. The stack trace is :
>>
>> Exception in thread "Thread-286" java.lang.NullPointerException
>> at
>> org.eclipse.net4j.signal.IndicationWithMonitoring$1.run(Indi cationWithMonitoring.java:94)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Threa dPoolExecutor.java:650)
>>
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo lExecutor.java:675)
>>
>> at java.lang.Thread.run(Thread.java:595)
>>
>>
>> In IndicationWithMonitoring we have the following code. It crashes on
>> sendProgress call with a null monitor. I think between while and
>> sendProgress there is another thread wich set the monitor field to null ?
>>
>> while (monitor != null)
>> {
>> if (System.currentTimeMillis() - lastMonitorAccess >
>> monitorProgressInterval)
>> {
>> setMonitorCanceled();
>> break;
>> }
>>
>> sendProgress(monitor.getTotalWork(), monitor.getWork());
>> ConcurrencyUtil.sleep(monitorProgressInterval);
>> }
>>
>>
>> I'm also quite surprised with the number of threads. I have more than
>> 1000 Daemon Threads in my Eclipse Debug view. With the previous Net4J
>> version (1.0.3), I had no more than ten Daemon Thread.
>>
>> I tried to reproduce the problem with a small unit test and a
>> MEMStore, but it works (no NPE, but lot of threads). I'm working with
>> my own Store implementation, perhaps I miss something ? I try to add a
>> synchronized on IStoreAccessor commit method but it still doesn't work.
>>
>> Someone have an idea ?
>>
>> David
Previous Topic:Saving emfresource while updating references
Next Topic:[CDO] Resolve single CDOObject in state CONFLICT
Goto Forum:
  


Current Time: Wed Feb 19 14:13:41 GMT 2020

Powered by FUDForum. Page generated in 0.01733 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top