Analyzing jsp war file

SonarScan is required to scan the jsp war file but it not getting indexed on language. Setting properties has already been set for .jsp in for language java.

sonar.login = squ_xxxxx\Oracle\Java\jdk1.8.0_144\bin\java
sonar.language =.jsp

16:01:35.710 DEBUG: Declared extensions of language JSON were converted to sonar.lang.patterns.json : **/*.json
16:01:35.717 DEBUG: Will ignore generated code
16:01:35.720 DEBUG: Will ignore generated code
16:01:35.750 INFO: Indexing files…
16:01:35.753 INFO: Project configuration:
16:01:35.775 DEBUG: ‘CHG_JSP_123\VolumetrixScanItg.war’ indexed with no language
16:01:35.805 DEBUG: ‘CHG_TEST_123\PURGE_ZEB_OIC_INSTANCES_DETAILS_Tbl.sql’ indexed with language ‘plsql’

After adding .war in Java language setting properties was able to resolve the indexing issue, but still the code is not getting scanned successfully.


16:18:54.012 WARN: Invalid character encountered in file C:/Sonarqube/IT_Integrations/CHG_JSP_123/VolumetrixScanItg.war at line 47 for encoding windows-1252. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
16:18:54.066 DEBUG: 'CHG_JSP_123/VolumetrixScanItg.war' generated metadata with charset 'windows-1252'
16:19:26.156 ERROR: ECJ: Unable to parse file
java.nio.file.InvalidPathException: Path: NUL character not allowed: /modules/java.base/java/lang/Statement ‼☺ .class
16:19:26.164 ERROR: Unable to parse source file : 'CHG_JSP_123/VolumetrixScanItg.war'
16:19:26.164 ERROR: ECJ: Unable to parse file.
16:19:26.285 INFO: Did not optimize analysis for any files, performed a full analysis for all 1 files.
16:19:26.288 DEBUG: Could not write DBD Java frontend version to cache (key 'javabugs:dataVersion', value '')

16:19:26.939 DEBUG: Populating index from CHG_JSP_123/VolumetrixScanItg.war
16:19:27.036 INFO: ------------------------------------------------------------------------
16:19:27.041 INFO: ------------------------------------------------------------------------
16:19:27.042 INFO: Total time: 49.288s
16:19:27.121 INFO: Final Memory: 39M/116M
16:19:27.122 INFO: ------------------------------------------------------------------------
16:19:27.123 ERROR: Error during SonarScanner execution
org.sonar.duplications.DuplicationsException: Unable to build statement from token : '♫'[1568,13]
        at org.sonar.duplications.statement.StatementChunker.chunk(
        at org.sonar.scanner.cpd.JavaCpdBlockIndexerSensor.createIndex(
        at org.sonar.scanner.cpd.JavaCpdBlockIndexerSensor.execute(
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(
        at org.sonar.scanner.sensor.ProjectSensorsExecutor.execute(
        at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(
        at org.sonar.core.platform.SpringComponentContainer.startComponents(
        at org.sonar.core.platfo
Caused by: java.lang.IllegalStateException: None of the statement channel has been able to consume token: '♫'[1568,13]
        at org.sonar.
16:19:27.140 ERROR:
16:19:27.140 ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hey there.

You can’t analyze a.war file – which is a .jar file (and not source code). You need to scan the source code.