Unable to run check class org.sonar.java.se.SymbolicExecutionVisitor - java.nio.file.InvalidPathException: Illegal char <?> at index 0: ? extends ...

849 views
Skip to first unread message

edward...@gmail.com

unread,
Apr 17, 2018, 2:47:40 PM4/17/18
to SonarQube
Hi there,

I am running the Sonaqube plugin in Gradle on a Java project, and I'm encountering the following error:

Unable to run check class org.sonar.java.se.SymbolicExecutionVisitor -  on file C:\development\code\git_projects\bankmobile\disbursement_services\one_disburse_backup\one-disburse\lib\src\main\java\com\higherone\fis\connectware\client\services\ConnectwareClient.java, To help improve SonarJava, please report this problem to SonarSource : see https://www.sonarqube.org/community/
java.nio.file.InvalidPathException: Illegal char <?> at index 0: ? extends CoreBankingServiceException.class
        at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
        at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
        at sun.nio.fs.AbstractPath.resolve(AbstractPath.java:53)
        at org.sonar.java.bytecode.loader.FileSystemLoader.findResource(FileSystemLoader.java:47)
        at org.sonar.java.bytecode.loader.SquidClassLoader.findResource(SquidClassLoader.java:83)
        at java.lang.ClassLoader.getResource(ClassLoader.java:1096)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1307)
        at org.sonar.java.bytecode.loader.SquidClassLoader.getBytesForClass(SquidClassLoader.java:112)
... etc.

This is the only area of the source file that this can be referring to:

Class<? extends CoreBankingServiceException> exceptionClass = null;
try {
exceptionClass = (Class<? extends CoreBankingServiceException>) Class.forName(exceptionClassName);
} catch (ClassNotFoundException e) {
logger.error("Could not get class for ["+exceptionClassName+"]");
}

Any ideas on what might be causing this error?

Thanks!
-Ed

edward...@gmail.com

unread,
Apr 17, 2018, 2:49:47 PM4/17/18
to SonarQube
Sorry, first post, I realize this should have gone on StackOverflow. I'm using v 2.6.1 of the Sonarqube plugin by the way.

G. Ann Campbell

unread,
Apr 17, 2018, 3:10:49 PM4/17/18
to SonarQube
Actually Ed, this is the right place. 


:-)
Ann

Michael Gumowski

unread,
Jun 5, 2018, 12:05:21 PM6/5/18
to G. Ann Campbell, SonarQube
Hello Ed,

First, sorry for the long delay before answering you, and thanks for the feedback!
It seems that wildcards in generics are causing trouble to our symbolic execution engine when trying to read signatures directly in bytecode.

Unfortunately, I'm not able to reproduce the issue on my side with latest version of SonarJava (5.4). I'm not sure there is many things you can do on your side, except maybe excluding temporarily the file, as it is most probably caused by a bug on SonarJava side.

By the way, could you please provide the version of your SonarJava plugin? 

I would also appreciate if you could produce a small simplified single-java-file gradle project, self-contained (defining all dependencies), reproducing the issue systematically.
I tried the following, but it is not triggering anything.

import org.slf4j.Logger;

public class A {

  static Logger logger;

  static void foo(String exceptionClassName) {
    Class<? extends CoreBankingServiceException> exceptionClass = null;
    try {
      exceptionClass = (Class<? extends CoreBankingServiceException>) Class.forName(exceptionClassName);
    } catch (ClassNotFoundException e) {
      logger.error("Could not get class for [" + exceptionClassName + "]");
  }
}

  class CoreBankingServiceException extends Exception {

  }
}

Thanks in advance,
Michael

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/9afe681b-a04b-470c-b262-594024cf954a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Michael Gumowski | SonarSource
Software Developer, Language Team
https://www.sonarsource.com

s60...@gmail.com

unread,
Jun 6, 2018, 12:46:21 PM6/6/18
to SonarQube
Thanks Michael. I'll need to play around with creating that standalone project. I didn't totally follow the question about the SonarJava version - I was running this from Gradle, I don't think I specified any specific version other than the SonarQube plugin itself (which is 2.6.1, by the way) - are you referring to the version of SonarJava in the server itself that I am submitting the results to? I was on version 5.2 build 13398, but I wasn't sure if the error was coming from the server or from the local Gradle plugin. I am going to update to 5.4 to see if that changes anything.

edward...@gmail.com

unread,
Jun 6, 2018, 12:51:37 PM6/6/18
to SonarQube
Sorry, that was me, logged into the wrong Google profile.

Michael Gumowski

unread,
Jun 6, 2018, 12:53:55 PM6/6/18
to edward...@gmail.com, SonarQube
Hello,

No worries. 

Yep, I'm referring to the SonarJava plugin version which is installed on the SonarQube server, because that's the one which is going to be used by the Gradle scanner during analysis. So if there is some analysis failure, from my point of view, it's going to be on the analyzer side (SonarJava), and not on Gradle Scanner, which is simply triggering and configuring the analysis.

Don't hesitate to come back to with a small reproducer us once you updated your version of SonarJava if you are still getting the error! 

Cheers,
Michael

--
Important: this SonarQube Google Group will close on June 11th, 2018, in order to move to a new forum to power even more community discussions. See details in this post: https://groups.google.com/d/msg/sonarqube/BbSZz-JnhVM/DavhMueEAAAJ
---
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages