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 237392 - Cannot find service instance in lookup when using @DebuggerServiceRegistration
Summary: Cannot find service instance in lookup when using @DebuggerServiceRegistration
Status: RESOLVED WORKSFORME
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-21 03:31 UTC by bbll
Modified: 2013-10-22 12:01 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bbll 2013-10-21 03:31:38 UTC
@DebuggerServiceRegistration(
path = "CallStackView",
types = {TreeModel.class, NodeModel.class}
)
public class MyCallStackModel implements TreeModel, NodeModel
{
....
}

public class MyDebugger extends ActionsProviderSupport
{
    public MyDebugger(ContextProvider context)
    {
        MyCallStackModel callStack =
            context.lookupFirst("CallStackView", TreeModel.class);

        // callStack is null...
    }
}

However, when registering MyCallStackModel the old fashioned way, i.e. via folders:

META-INF.debugger.MySession.CallStackView (folder)
  - org.netbeans.spi.viewmodel.TreeModel (file)
      - org.mycompany.mydebugger.MyCallStackModel (file content)
...

everything works just fine.

So it seems that when using the annotation for registering a debugger service, it fails to register it within the lookup. The problem description also applies to other services such as BreakpointsView, LocalsView etc.
Comment 1 Jaroslav Tulach 2013-10-22 06:11:02 UTC
Belongs more to debugger than general lookup, I think.
Comment 2 Martin Entlicher 2013-10-22 12:01:28 UTC
The path should be "MySession/CallStackView"

@DebuggerServiceRegistration(
path = "MySession/CallStackView",
types = { ... })