netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

An error occurred during parsing

Open asbachb opened this issue 2 years ago • 3 comments

Apache NetBeans version

Apache NetBeans 18 release candidate

What happened

When I'm in a debugger session and "Step Into" the exception occurs and debug session remains stuck.

Annotation: An error occurred during parsing of 'org/jboss/as/controller/client/impl/AbstractModelControllerClient.java in /home/asbachb/.m2/repository/org/wildfly/core/wildfly-controller-client/20.0.1.Final/wildfly-controller-client-20.0.1.Final-sources.jar'. Please report a bug against java/source and attach dump file '/home/asbachb/.netbeans/18-rc3/var/log/AbstractModelControllerClient_8.dump'.
An error occurred during parsing of 'org/jboss/as/controller/client/impl/AbstractModelControllerClient.java in /home/asbachb/.m2/repository/org/wildfly/core/wildfly-controller-client/20.0.1.Final/wildfly-controller-client-20.0.1.Final-sources.jar'. Please report a bug against java/source and attach dump file '/home/asbachb/.netbeans/18-rc3/var/log/AbstractModelControllerClient_8.dump'.
Caused by: java.lang.IllegalStateException: java.lang.StackOverflowError
	at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:383)
	at org.netbeans.modules.java.source.parsing.JavacParser.moveToPhase(JavacParser.java:770)
	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:540)
	at org.netbeans.modules.java.source.parsing.JavacParser.getResult(JavacParser.java:141)
	at org.netbeans.modules.parsing.impl.TaskProcessor.callGetResult(TaskProcessor.java:608)
	at org.netbeans.modules.parsing.impl.SourceCache.getResult(SourceCache.java:241)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:775)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:288)
	at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:702)
	at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:663)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1419)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2034)
Caused by: java.lang.StackOverflowError
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:1081)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:1073)
	at com.sun.tools.javac.code.Types.isSuperType(Types.java:1300)
[...]
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:1073)
	at com.sun.tools.javac.code.Types.isSuperType(Types.java:1300)
	at com.sun.tools.javac.code.Types.isSubtype(Types.java:1082)
An error occurred during parsing of 'org/jboss/as/controller/client/impl/AbstractModelControllerClient.java in /home/asbachb/.m2/repository/org/wildfly/core/wildfly-controller-client/20.0.1.Final/wildfly-controller-client-20.0.1.Final-sources.jar'. Please report a bug against java/source and attach dump file '/home/asbachb/.netbeans/18-rc3/var/log/AbstractModelControllerClient_8.dump'.

AbstractModelControllerClient_8.dump.txt

How to reproduce

pom.xml:

        <dependency>
            <groupId>org.wildfly.core</groupId>
            <artifactId>wildfly-controller-client</artifactId>
            <version>20.0.1.Final</version>
        </dependency>

Code:

public static void main(String[] args) throws Exception {
        ModelControllerClientConfiguration config = new ModelControllerClientConfiguration.Builder()
                .setHostName("localhost")
                .setPort(9990)
                .setHandler((callbacks) -> System.out.println(callbacks))
                .setConnectionTimeout(1000)
                .setSaslOptions(Collections.EMPTY_MAP)
                .build();

        ModelControllerClient client = ModelControllerClient.Factory.create(config);
        
        ModelNode op = new ModelNode();
        op.get("operation").set("read-attribute");
        op.get("address").setEmptyList();
        op.get("name").set("server-state");

        ModelNode result = client.execute(op);

        System.out.println(result);
    }
  • Set breakpoint on ModelNode result = client.execute(op);
  • Step Into
  • Step Into -> Should result into Excpetion

Did this work correctly in an earlier version?

No / Don't know

Operating System

Archlinux

JDK

OpenJDK 64-Bit Server VM Temurin-17.0.7+7

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

asbachb avatar May 13 '23 23:05 asbachb

Same behaviour on NetBeans 17.

asbachb avatar May 13 '23 23:05 asbachb

can't reproduce this with NB 20.

@asbachb Can you confirm that it is working as intended? It might got fixed via the regular nb-javac updates since NB 20 uses javac based on JDK 21 (#6206).

mbien avatar Nov 19 '23 15:11 mbien

@asbachb should I close this?

mbien avatar May 06 '24 19:05 mbien

so I tried this with NB 17, 18 and 23 rc1 following the steps but couldn't reproduce it. I could step into the execute method of the attached (downloaded) sources. (I did get an illegal argument exception with NB 17 but this is likely unrelated and did not affect debugging)

mbien avatar Aug 05 '24 19:08 mbien