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 255499 - IllegalStateException: No instance created for service org.netbeans.modules.debugger.jpda.actions.StepIntoActionProvider, context = Lookup.Compound@37a1c427[l1=Lookup.Compound@6e36a244[l1=Lookup.Compo
Summary: IllegalStateException: No instance created for service org.netbeans.modules.d...
Status: NEW
Alias: None
Product: third-party
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: _ dcaoyuan
URL: https://github.com/dcaoyuan/nbscala/i...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-23 04:24 UTC by sworisbreathing
Modified: 2016-06-29 18:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 189812


Attachments
stacktrace (1.83 KB, text/plain)
2015-09-23 04:24 UTC, sworisbreathing
Details
stacktrace (2.06 KB, text/plain)
2016-06-29 18:06 UTC, stefan79
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sworisbreathing 2015-09-23 04:24:50 UTC
Build: NetBeans IDE 8.0.2 (Build 201411181905)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.31-b07, Java(TM) SE Runtime Environment, 1.8.0_31-b13
OS: Mac OS X

User Comments:
GUEST: Attaching debugger.

sworisbreathing: I was trying to debug an integration test in a Gradle project.

GUEST: Whats going on?

GUEST: Trying to atach debugger

sworisbreathing: I was trying to debug a JUnit integration test in a Maven 3 project.

Maven 3.0.3, JUnit 4.11, the test class' name is suffixed with "IT" and I've got the failsafe plugin configured in pom.xml.  I ran the test by opening up the test file and using NetBeans' "Debug->Debug Test File" menu.
After reporting the error, NetBeans locked up and I had to kill the process through task manager.
Happened again after relaunching NetBeans and trying to debug an integration test.

Since this issue appears to be related to NetBeans figuring out where project sources are during debugging, I'll mentions this.  I have a logback.groovy under src/test/groovy and I'm adding it as a test source using build-helper-maven-plugin during the generate-test-sources phase like so:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>build-helper-maven-plugin</artifactId>
  <version>1.7</version>
  <executions>
    <execution>
      <phase>generate-test-sources</phase>
      <goals>
        <goal>add-test-source</goal>                            
      </goals>
      <configuration>
        <sources>
          <source>src/test/groovy/logback.groovy</source>
        </sources>
      </configuration>
    </execution>
  </executions>
</plugin>
In my case, the issue is being caused by a bad configuration of build-helper-maven-plugin, which I just posted.  The description of that particular goal at http://mojo.codehaus.org/build-helper-maven-plugin/add-test-source-mojo.html says "Add test source directories to the POM."  Changing the source path to `src/test/groovy` fixed my problem.

GUEST: Trying to debug on jboss server using attach.

GUEST: Fucking error!

GUEST: when attaching debugger

GUEST: Still trying to debug!

GUEST: Whats going on with this?




Stacktrace: 
java.lang.IllegalStateException: No instance created for service org.netbeans.modules.debugger.jpda.actions.StepIntoActionProvider, context = Lookup.Compound@37a1c427[l1=Lookup.Compound@6e36a244[l1=Lookup.Compound@62d43eb[l1=org.netbeans.api.debugger.Lookup$Instance@1202d5ed, l2=Lookup.MetaInf@63d3c633[rootFolder=netbeans-jpda-AttachingDICookie]], l2=Lookup.Compound@38ac7c8f[l1=org.netbeans.api.debugger.Lookup$Instance@54f2426a, l2=Lookup.MetaInf@505b48a4[rootFolder=netbeans-JPDASession]]], l2=Lookup.Compound@2dc4eec2[l1=org.netbeans.api.debugger.Lookup$Instance@7657b7f1, l2=Lookup.MetaInf@30f04a43[rootFolder=netbeans-JPDASession/Java]]], path = Debugger/netbeans-JPDASession/org-netbeans-modules-debugger-jpda-actions-StepIntoActionProvider.instance
   at org.netbeans.spi.debugger.ActionsProvider$ContextAware.getDelegate(ActionsProvider.java:221)
   at org.netbeans.spi.debugger.ActionsProvider$ContextAware.isEnabled(ActionsProvider.java:268)
   at org.netbeans.api.debugger.ActionsManager.isEnabled(ActionsManager.java:313)
   at org.netbeans.modules.debugger.ui.actions.DebuggerAction.isEnabled(DebuggerAction.java:129)
   at org.netbeans.modules.debugger.ui.actions.DebuggerAction.access$000(DebuggerAction.java:73)
   at org.netbeans.modules.debugger.ui.actions.DebuggerAction$Listener.propertyChange(DebuggerAction.java:395)
Comment 1 sworisbreathing 2015-09-23 04:24:53 UTC
Created attachment 156370 [details]
stacktrace
Comment 2 Martin Entlicher 2015-09-23 09:37:51 UTC
The SourcePathProviderImpl can not be created because of:
Caused: java.lang.IllegalArgumentException: file:/Users/Steveo/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.7/da39a3ee5e6b4b0d3255bfef95601890afd80709/antlr-2.7.7-sources.jar is not a valid classpath entry; use a jar-protocol URL.
	at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.verify(SimplePathResourceImplementation.java:104)
	at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.verify(SimplePathResourceImplementation.java:68)
	at org.netbeans.modules.java.classpath.SimplePathResourceImplementation.<init>(SimplePathResourceImplementation.java:131)
	at org.netbeans.spi.java.classpath.support.ClassPathSupport.createResource(ClassPathSupport.java:77)
	at org.netbeans.spi.java.classpath.support.ClassPathSupport.createClassPath(ClassPathSupport.java:126)
	at org.netbeans.modules.scala.debugger.projects.SourcePathProviderImpl.<init>(SourcePathProviderImpl.java:205)
Comment 3 Martin Entlicher 2015-09-23 09:40:17 UTC
Already fixed in debugger...
Comment 4 Tomas Zezula 2015-09-23 09:45:16 UTC
The
file:/Users/Steveo/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.7/da39a3ee5e6b4b0d3255bfef95601890afd80709/antlr-2.7.7-sources.jar

is not valid jar url it should be:

jar:file:/Users/Steveo/.gradle/caches/modules-2/files-2.1/antlr/antlr/2.7.7/da39a3ee5e6b4b0d3255bfef95601890afd80709/antlr-2.7.7-sources.jar!/

Use FileUtil.urlForArchiveOrDir(File)
Comment 5 Martin Entlicher 2015-09-23 09:58:04 UTC
Aha, this is Scala debugger:
org.netbeans.modules.scala.debugger.projects.SourcePathProviderImpl.<init>(SourcePathProviderImpl.java:205)

The code must catch IllegalArgumentException, like we do it in org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl

See: https://github.com/dcaoyuan/nbscala/issues/151
Comment 6 Martin Entlicher 2015-09-23 09:59:28 UTC
Thanks Tomasi. I believe that it's not up to debugger to prepend the "jar:".
Comment 7 Jiri Kovalsky 2015-09-23 10:47:01 UTC
Dcaoyuan, can you please take a look at this? Thanks.
Comment 8 sworisbreathing 2015-09-24 00:38:27 UTC
(In reply to Martin Entlicher from comment #5)
> Aha, this is Scala debugger:
> org.netbeans.modules.scala.debugger.projects.SourcePathProviderImpl.
> <init>(SourcePathProviderImpl.java:205)
> 
> The code must catch IllegalArgumentException, like we do it in
> org.netbeans.modules.debugger.jpda.projects.SourcePathProviderImpl
> 
> See: https://github.com/dcaoyuan/nbscala/issues/151

Thanks, guys. I've commented on the GitHub issue. Weird thing is, there weren't any scala files in the project I was debugging. Simply having the plugin installed broke the debugger :-( I've uninstalled the scala plugin and now the debugger is working again.

However, I wonder if errors like this could be handled more gracefully. When it happened, the IDE was switching to debugger mode. The stop button on the toolbar (Finish Debugger Session) was enabled, but not the play (Continue) or pause buttons. Clicking the stop button had no effect -> the spawned java processes were still running and although the UI thread in NetBeans wasn't blocked, it wasn't functional. In the end, I had to run `killall java` from the command line and then relaunch NetBeans to get back to a working IDE.
Comment 9 stefan79 2016-06-29 18:06:31 UTC
Created attachment 160194 [details]
stacktrace

Started Java-Debug-Session.