This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 220098 - NPE whenever o.e.c.internal.runtime.InternalPlatform.getDefault().getLog(...) is called
Summary: NPE whenever o.e.c.internal.runtime.InternalPlatform.getDefault().getLog(...)...
Status: RESOLVED FIXED
Alias: None
Product: connecteddeveloper
Classification: Unclassified
Component: Bugzilla (show other bugs)
Version: 7.3
Hardware: All All
: P1 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
: 215224 219018 220799 221361 221683 223514 (view as bug list)
Depends on:
Blocks: 220899
  Show dependency tree
 
Reported: 2012-10-15 09:12 UTC by Tomas Stupka
Modified: 2012-12-10 12:38 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
LogReaderServiceTest (3.67 KB, text/plain)
2012-10-15 09:14 UTC, Tomas Stupka
Details
rewritten to real test (6.52 KB, patch)
2012-11-06 08:05 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Stupka 2012-10-15 09:12:31 UTC
Product Version = NetBeans IDE Dev (Build 20121015-5fde2391c680)
Operating System = Mac OS X version 10.6.8 running on x86_64
Java; VM; Vendor = 1.6.0_35
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.10-b01-428

A NPE is raised whenever there is an error which mylyn tries to log. Happens on regular basis on builds from branch team_support. P1 because the NPE is obfuscating the actual problem that occurred and makes therefore development/debugging very cumbersome.

java.lang.NullPointerException
	at org.eclipse.core.internal.runtime.InternalPlatform.getLog(InternalPlatform.java:418)
	at org.eclipse.mylyn.commons.core.StatusHandler.log(StatusHandler.java:45)
	at com.tasktop.c2c.client.commons.client.ClientExceptionWrapper$1.logProblem(ClientExceptionWrapper.java:73)
	at com.tasktop.c2c.client.commons.client.ClientExceptionWrapper$1.invoke(ClientExceptionWrapper.java:61)
	at $Proxy33.performQuery(Unknown Source)
	at com.tasktop.c2c.internal.client.tasks.core.C2CRepositoryConnector.performQuery(C2CRepositoryConnector.java:198)
	at org.netbeans.modules.mylyn.util.PerformQueryCommand.execute(PerformQueryCommand.java:88)
	at org.netbeans.modules.ods.tasks.C2CExecutor.execute(C2CExecutor.java:71)
	at org.netbeans.modules.ods.tasks.query.C2CQuery$1.run(C2CQuery.java:316)
	at org.netbeans.modules.ods.tasks.query.C2CQuery.executeQuery(C2CQuery.java:365)
	at org.netbeans.modules.ods.tasks.query.C2CQuery.refreshIntern(C2CQuery.java:282)
	at org.netbeans.modules.ods.tasks.query.C2CQuery$PredefinedQuery.refresh(C2CQuery.java:467)
	at org.netbeans.modules.ods.tasks.query.C2CQueryController$QueryTask.executeQuery(C2CQueryController.java:1024)
	at org.netbeans.modules.ods.tasks.query.C2CQueryController$QueryTask.run(C2CQueryController.java:1044)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Caused: org.openide.util.RequestProcessor$SlowItem: task failed due to
	at org.openide.util.RequestProcessor$Task.schedule(RequestProcessor.java:1495)
	at org.netbeans.modules.ods.tasks.query.C2CQueryController$QueryTask.post(C2CQueryController.java:1056)
	at org.netbeans.modules.ods.tasks.query.C2CQueryController.refresh(C2CQueryController.java:691)
	at org.netbeans.modules.ods.tasks.query.C2CQueryController.refresh(C2CQueryController.java:676)
	at org.netbeans.modules.ods.tasks.C2CQueryProvider.refresh(C2CQueryProvider.java:98)
	at org.netbeans.modules.ods.tasks.C2CQueryProvider.refresh(C2CQueryProvider.java:59)
	at org.netbeans.modules.bugtracking.QueryImpl.refresh(QueryImpl.java:161)
	at org.netbeans.modules.bugtracking.api.Query.refresh(Query.java:108)
	at org.netbeans.modules.tasks.ui.dashboard.QueryNode.load(QueryNode.java:85)
	at org.netbeans.modules.tasks.ui.dashboard.QueryNode.load(QueryNode.java:63)
	at org.netbeans.modules.tasks.ui.treelist.AsynchronousNode$Loader$1.run(AsynchronousNode.java:251)
[catch] at java.lang.Thread.run(Thread.java:680)

see attached test which tries to reflect what happens in InternalPlatform.getLog(...)
Comment 1 Tomas Stupka 2012-10-15 09:14:23 UTC
Created attachment 125961 [details]
LogReaderServiceTest
Comment 2 Jaroslav Tulach 2012-10-19 12:20:12 UTC
LogReader is null. Now the question is who is supposed to implement that service?

ExtendedLogReaderService logReader = (ExtendedLogReaderService) logReaderTracker.getService();
logReader.addLogListener(result, result);
Comment 3 Jaroslav Tulach 2012-10-19 14:26:20 UTC
ergonomics#0565a5a3c4c9
Comment 4 Tomas Stupka 2012-10-25 13:07:47 UTC
*** Bug 220799 has been marked as a duplicate of this bug. ***
Comment 5 Tomas Stupka 2012-10-25 21:21:06 UTC
*** Bug 219018 has been marked as a duplicate of this bug. ***
Comment 6 Quality Engineering 2012-10-28 01:49:01 UTC
Integrated into 'main-golden', will be available in build *201210280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0565a5a3c4c9
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #220098: Initialize EclipseLogHook as some mylyn modules need the logging service
Comment 7 Jaroslav Tulach 2012-11-05 14:20:31 UTC
*** Bug 221361 has been marked as a duplicate of this bug. ***
Comment 8 Tomas Stupka 2012-11-05 18:40:05 UTC
the NPE is gone, but the logger accessed from StatusHandler still doesn't seem to be configured properly.

java.lang.NoClassDefFoundError: org/eclipse/core/internal/runtime/PlatformLogWriter
	at org.eclipse.core.internal.runtime.Log.log(Log.java:60)
	at org.eclipse.mylyn.commons.core.StatusHandler.log(StatusHandler.java:47)
	at com.tasktop.c2c.client.commons.client.ClientExceptionWrapper$1.logProblem(ClientExceptionWrapper.java:73
Comment 9 Tomas Stupka 2012-11-05 18:41:02 UTC
test:

    public void testLogWriter() throws Throwable {
        BundleContext ctx = PlatformActivator.getContext();
        assertNotNull(ctx);
        StatusHandler.log(new TestStatus());
    }

    private class TestStatus implements IStatus {
        @Override
        public IStatus[] getChildren() {
            return new IStatus[0];
        }
        @Override
        public int getCode() {
            return -1;
        }
        @Override
        public Throwable getException() {
            return new NullPointerException("test exception");
        }
        @Override
        public String getMessage() {
            return "test";
        }
        @Override
        public String getPlugin() {
            return "testplugin";
        }
        @Override
        public int getSeverity() {
            return -1;
        }
        @Override
        public boolean isMultiStatus() {
            return false;
        }
        @Override
        public boolean isOK() {
            return false;
        }
        @Override
        public boolean matches(int i) {
            return true;
        }
    };
Comment 10 Jaroslav Tulach 2012-11-06 08:05:22 UTC
Created attachment 127189 [details]
rewritten to real test
Comment 11 Jaroslav Tulach 2012-11-06 08:06:43 UTC
I may be slow this morning, but I am unable to find PlatformLogWriter in any of our JARs. If that is true, then it is a packaging problem.
Comment 12 Tomas Stupka 2012-11-06 08:27:03 UTC
included in org.eclipse.equinox.common since 3.6.0_20100523 and also part of org.eclipse.equinox.common.3.6.100 which ships together with equinox 3.8. 

in NetBeans we still bundle 3.6.0.v20100503 which doesn't contain it.

will update all equinox libs to be on the state from 3.8

in the future we should be more careful when updating o.e.c.runtime or equinox ...
Comment 13 Tomas Stupka 2012-11-07 20:49:15 UTC
fixed the packaging discrepancy in core-main #5ca16dc27578

we should though upgrade all equinox and related o.eclipse.core packages to 3.8.
covered by issue #221680
Comment 14 Tomas Stupka 2012-11-08 00:10:36 UTC
*** Bug 221683 has been marked as a duplicate of this bug. ***
Comment 15 Quality Engineering 2012-11-09 02:52:14 UTC
Integrated into 'main-golden', will be available in build *201211090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5ca16dc27578
User: Tomas Stupka <tstupka@netbeans.org>
Log: issue #220098 - NPE whenever o.e.c.internal.runtime.InternalPlatform.getDefault().getLog(...) is called
fixed the packaging problem where o.e.equinox.common and some other equinox libs were in a wrong version
Comment 16 Tomas Stupka 2012-11-21 08:07:06 UTC
*** Bug 215224 has been marked as a duplicate of this bug. ***
Comment 17 Jaroslav Tulach 2012-12-10 12:38:12 UTC
*** Bug 223514 has been marked as a duplicate of this bug. ***