当前位置: 首页 > 知识库问答 >
问题:

Sonar runner 2.3引发Sonar 3.7异常-->IllegalDataException

杜浩壤
2023-03-14

我试图用Sonar3.7&Sonar-Runner2.3来分析Java项目。

SonarQube Runner 2.3 Java 1.6.0_30 Sun Microsystems Inc. (64-bit) Windows 7 6.1 amd64 
INFO: Error stacktraces are turned on. 
INFO: Runner configuration file: C:\Dhruba\InstallationFolder\Sonar\sonar-runner-2.3\conf\sonar-runner.properties 
INFO: Project configuration file: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\sonar-project.properties 
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is  platform dependent) 
INFO: Work directory: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar 
INFO: SonarQube Server 3.7 
13:38:29.376 INFO  - Load batch settings 
13:38:29.482 INFO  - User cache: C:\Users\Dhruba\.sonar\cache 
13:38:29.487 INFO  - Install plugins
13:38:31.219 INFO  - Install JDBC driver 
13:38:31.227 INFO  - Create JDBC datasource for jdbc:oracle:thin:@localhost:1521 /orcl
13:38:32.382 INFO  - Initializing Hibernate 13:38:34.579 INFO  - Load project settings 
13:38:34.665 INFO  - Apply project exclusions
13:38:34.788 INFO  - -------------  Scan OPSBankIIUtilityService
13:38:34.790 INFO  - Load module settings 
13:38:35.382 INFO  - Quality profile : [name=OBBase1,language=java] 
13:38:35.394 INFO  - Excluded sources: 
13:38:35.394 INFO  -   **/*_*.java 
13:38:35.394 INFO  -   **/bo/** 
13:38:35.395 INFO  -   */stub/** 
13:38:35.395 INFO  -   **/*FacadeSoap*.java    
13:38:35.395 INFO  -   com.ibm.ejs.container._EJSWrapper_**/src 
13:38:35.395 INFO  -  *_Deser/src 
13:38:35.395 INFO  -   *Proxy.java 
13:38:35.395 INFO  -   */*FacadeHome.java 
13:38:35.395 INFO  -   */*FacadeLocalHome.java 13:38:35.395 INFO  - com/elsevier/obii/xml/* 
13:38:35.395 INFO  - Excluded tests: 
13:38:35.395 INFO  -   */package-info.java
13:38:35.430 INFO  - Configure Maven plugins 
13:38:35.502 INFO  - Compare to previous analysis 
13:38:35.532 INFO  - Compare over 7 days (2013-09-14) 
13:38:35.558 INFO  - Compare to previous version
13:38:35.734 INFO  - Base dir: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\OPSBankIIUtilityService 
13:38:35.734 INFO  - Working dir: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService 
13:38:35.735 INFO  - Source dirs: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\OPSBankIIUtilityService\src 
13:38:35.735 INFO  - Source encoding: windows-1252, default locale: en_US 
13:38:36.090 INFO - Sensor JavaSourceImporter... 
13:38:37.021 INFO  - Sensor JavaSourceImporter done: 931 ms 
13:38:37.021 INFO  - Sensor JavaSquidSensor... 
13:38:37.160 INFO  - Java AST scan... 
13:38:40.518 INFO  - Java AST scan done: 3358 ms 
13:38:40.763 INFO  - Sensor JavaSquidSensor done: 3742 ms 
13:38:40.764 INFO  - Sensor SurefireSensor... 
13:38:40.765 INFO  - parsing C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService\build\surefire-reports
13:38:40.767 INFO  - Sensor SurefireSensor done: 3 ms 
13:38:40.769 INFO  - Sensor CpdSensor... 
13:38:40.770 INFO  - SonarEngine is used
13:38:40.846 INFO  - Cross-project analysis disabled 
13:38:41.511 INFO - Sensor CpdSensor done: 742 ms 
13:38:41.511 INFO  - Sensor CheckstyleSensor... 
13:38:41.514 INFO  - Execute Checkstyle 5.6...
13:38:41.534 INFO  - Checkstyle configuration: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService\checkstyle.xml
13:38:43.845 INFO  - Execute Checkstyle 5.6 done: 2331 ms
13:38:43.849 INFO  - Sensor CheckstyleSensor done: 2338 ms
13:38:43.850 INFO  - Sensor PmdSensor... 
13:38:43.853 INFO  - Execute PMD 4.3... 
13:38:43.864 INFO  - Java version: 1.5 
13:38:44.008 INFO  - Execute PMD 4.3 done: 155 ms 
INFO: ------------------------------------------------------------------------ 
INFO: EXECUTION FAILURE 
INFO: ------------------------------------------------------------------------ 
Total time: 17.761s Final Memory: 15M/406M 
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
 org.sonar.runner.impl.RunnerException: Unable to execute Sonar
     at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
     at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
     at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
     at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
     at org.sonar.runner.api.Runner.execute(Runner.java:90)
     at org.sonar.runner.Main.executeTask(Main.java:70)
     at org.sonar.runner.Main.execute(Main.java:59)
     at org.sonar.runner.Main.main(Main.java:41) Caused by: org.sonar.api.utils.XmlParserException: org.jdom.IllegalDataException : The data "null" is not legal for a JDOM attribute: A null is not a legal XML value.
     at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:55)
     at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72)
     at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
     at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:142)
     at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
     at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
     at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:186)
     at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181)
     at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:179)
     at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:174)
     at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
     at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
     at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
     at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
     at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
     at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
     at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
     at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:156)
     at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:144)
     at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88)
     at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73)
     at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
     at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
     at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
     ... 9 more
**Caused by: org.jdom.IllegalDataException: The data "null" is not legal for a JDO M attribute: A null is not a legal XML value.**
     at org.jdom.Attribute.setValue(Attribute.java:486)
     at org.jdom.Attribute.<init>(Attribute.java:229)
     at org.jdom.Attribute.<init>(Attribute.java:252)
     at org.jdom.Element.setAttribute(Element.java:1109)
     at org.sonar.plugins.pmd.PmdProfileExporter.exportPmdRulesetToXml(PmdProfileExporter.java:126)
     at org.sonar.plugins.pmd.PmdProfileExporter.exportProfile(PmdProfileExporter.java:63)
     at org.sonar.plugins.pmd.PmdExecutor.createRulesets(PmdExecutor.java:107)
     at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:89)
     at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:75)
     at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:61)
     at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:52)
     ... 37 more ERROR: ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

共有1个答案

微生鸿轩
2023-03-14

我正在分析这个问题,发现从Sonar 3.6.1到3.7导入的剖面有问题。Sonar3.7无法解析一些XPath规则。

因此,我只是删除了这些XPath规则,然后手工重新添加它们,它就开始工作了。这个问题不是声纳运行器的错误,而是声纳3.7无法正确恢复剖面。

 类似资料:
  • 你可以使用raise语句 引发 异常。你还得指明错误/异常的名称和伴随异常 触发的 异常对象。你可以引发的错误或异常应该分别是一个Error或Exception类的直接或间接导出类。 如何引发异常 例13.2 如何引发异常 #!/usr/bin/python # Filename: raising.py classShortInputException(Exception):     '''A u

  • 问题内容: 鉴于此Java 8代码 我们如何正确地将其委派给方法调用的堆栈?(简而言之,如何使此方法抛出此错误?) Java中的Lambda看起来对错误处理不是很友好… 问题答案: 我的方法是从lambda 偷偷地 将其抛出,但是要小心,使该方法在其子句中声明它。使用我在这里发布的课程: 这样,您可以有效地使编译器仅“移开视线”,从而在代码中的某个位置禁用其异常检查,但是通过在方法中声明异常,可以

  • 我使用正则表达式来查找一个字符串是否存在于一个书页中。下面是相同的代码。 观察: > 案例1:当searchText=“(222M)”时 结果:找到字符串。 案例2:当search chText="(222M"//缺少括号时 我得到以下例外。 索引22:.\b.{0}(1110r.{附近regexp模式中嵌套的括号不正确。{0}.\b 还有更好的在页面中查找字符串的选项。使用String.cont

  • 下面有一些代码,我试图在其中使用以字符串形式打印所有匹配项。 上面的代码在线程“main”java.lang.IndexOutOfBoundsException中抛出异常:没有第2组异常。

  • 我正在尝试使用@Valid验证我的JPA实体,如下所示: 它工作了一段时间,但现在它停止工作,我不知道为什么。我试着在< code>persist方法中手动执行,它按预期工作: 可能会发生什么情况,或者我该如何调试?

  • 问题内容: 我想使用HttpURLConnection进行POST。我以两种方式尝试这种方法,但是这样做总是让我兴奋不已: 我在这两种情况下得到的异常是: java.net.SocketException:操作超时:connect:可能是由于无效的地址 功能1: 或功能2: 问题答案: 根本无法访问该URL。URL错误或DNS服务器无法解析主机名。尝试使用众所周知的URL进行简单连接以排除一个和另

  • 问题内容: 当我使用下面的代码时,在什么情况下会得到异常。 任何人都可以帮忙吗???????? 问题答案: HTTP状态代码是服务器的响应,因此,如果您控制服务器,则可以使其返回所需的任何错误。如果您无法控制服务器,则可以尝试发送错误/无效的请求,以便服务器进行投诉。 在服务器端这样的事情:

  • 我无法使用Apache POI读取xlsm文件。我得到错误java.lang.StringIndexOutOfBoundsException:String index out of range:-1。 我的程序看起来像: 这是否意味着我的特定xlsm文件模板有问题?还是我漏掉了什么?有人能帮我修好吗? 更新:我把我的代码块放在一个小的java类中,并直接复制到服务器到我的web应用程序文件夹之外的