2012-10-30 87 views
0

我想讓jenkins觸發聲吶使用Sonar Runner進行分析,但我收到一條錯誤信息,我該怎麼辦,有什麼問題,請幫助我,謝謝。 (我安裝了jenkins,聲納和聲吶亞軍)Jenkins觸發聲吶轉輪聲吶分析

錯誤細節; (從詹金斯)

[workspace] $ "C:\Program Files (x86)\Jenkins\tools\Sonar_Runner\Sonar_Runner_2.0\bin\sonar- runner.bat" "-Dsonar.projectBaseDir=C:\Program Files (x86)\Jenkins\jobs\E-Power\workspace" - Dsonar.fxcop.assemblyDependencyDirectories=/bin/Debug -Dsonar.dotnet.version=4.0 - Dsources=C:/Users/eazakli/Desktop/sonar-runner-2.0/sonar-runner-2.0/test -Dsonar.language=cs - Dsonar.stylecop.mode=skip -Dsonar.gendarme.mode=skip -Dsonar.projectVersion=1.0 - Dsonar.gendarme.assemblies=build\DmgTech*.* -Dsonar.projectKey=EA:TESTEA -Dsonar.gallio.mode=skip - Dsonar.dotnet.4.0.sdk.directory=C:/WIndows/Microsoft.NET/Framework/v4.0.30319 "- Dsonar.fxcop.installDirectory=C:/Program Files/Microsoft FxCop 1.36" -Dsonar.projectName=E-POWER 
C:\Program Files (x86)\Jenkins\tools\Sonar_Runner\Sonar_Runner_2.0 
Runner configuration file: C:\Program Files (x86)\Jenkins\tools\Sonar_Runner\Sonar_Runner_2.0 \conf\sonar-runner.properties 
Project configuration file: C:\Program Files (x86)\Jenkins\jobs\E-Power\workspace\sonar- project.properties 
Runner version: 2.0 
Java version: 1.6.0_35, vendor: Sun Microsystems Inc. 
OS name: "Windows 7", version: "6.1", arch: "x86" 
Default locale: "tr_TR", source code encoding: "windows-1254" (analysis is platform dependent) 
Server: http://localhost:9000 
Work directory: C:\Program Files (x86)\Jenkins\jobs\E-Power\workspace\.sonar 
14:33:54.737 [main] WARN o.s.r.i.batch.SonarProjectBuilder - /!\ The 'sources' property is  deprecated and is replaced by 'sonar.sources'. Don't forget to update your files. 
14:33:56.420 WARN .c.p.DefaultDatabase - H2 database should be used for evaluation purpose only 
14:33:56.421 INFO  o.s.c.p.Database - Create JDBC datasource to url  jdbc:h2:tcp://localhost/sonar 
Total time: 8.119s 
Final Memory: 2M/15M 
Exception in thread "main" org.sonar.runner.RunnerException:  org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public  org.sonar.core.persistence.MyBatis org.sonar.core.persistence.MyBatis.start()',  instance '[email protected], org.apache.ibatis.builder.BuilderException:  Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Integer'. Cause:  java.lang.ClassNotFoundException: Cannot find class: Integer 
at org.sonar.runner.Runner.delegateExecution(Runner.java:288) 
at org.sonar.runner.Runner.execute(Runner.java:151) 
at org.sonar.runner.Main.execute(Main.java:84) 
at org.sonar.runner.Main.main(Main.java:56) 
Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public  org.sonar.core.persistence.MyBatis org.sonar.core.persistence.MyBatis.start()',  instance '[email protected], org.apache.ibatis.builder.BuilderException:  Error resolving class . Cause:  org.apache.ibatis.type.TypeException: Could not resolve type alias 'Integer'. Cause:  java.lang.ClassNotFoundException: Cannot find class: Integer 
at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed (NullComponentMonitor.java:77) 
at  org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException (ReflectionLifecycleStrategy.java:132) 
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod (ReflectionLifecycleStrategy.java:115) 
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) 
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84) 
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169) 
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132) 
at org.picocontainer.behaviors.Stored.start(Stored.java:110) 
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter (DefaultPicoContainer.java:1009) 
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002) 
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760) 
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:70) 
at org.sonar.batch.bootstrap.Module.start(Module.java:82) 
at org.sonar.batch.Batch.execute(Batch.java:104) 
at org.sonar.runner.internal.batch.Launcher.executeBatch(Launcher.java:69) 
at org.sonar.runner.internal.batch.Launcher.execute(Launcher.java:61) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.sonar.runner.Runner.delegateExecution(Runner.java:285) 
... 3 more 
Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Integer'. Cause: java.lang.ClassNotFoundException: Cannot find class: Integer 
at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:94) 
at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:83) 
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128) 
at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:121) 
at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:111) 
at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:88) 
at org.sonar.core.persistence.MyBatis.loadMapper(MyBatis.java:177) 
at org.sonar.core.persistence.MyBatis.loadMappers(MyBatis.java:154) 
at org.sonar.core.persistence.MyBatis.start(MyBatis.java:121) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) 
... 21 more 
Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Integer'. Cause: java.lang.ClassNotFoundException: Cannot find class: Integer 
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:109) 
at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:115) 
at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:92) 
... 34 more 
Caused by: java.lang.ClassNotFoundException: Cannot find class: Integer 
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:188) 
at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:87) 
at org.apache.ibatis.io.Resources.classForName(Resources.java:250) 
at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:105) 
... 36 more 
Finished: SUCCESS 

回答

0

以下錯誤往往表明你的Java環境的安裝是不正確的:

java.lang.ClassNotFoundException: Cannot find class: Integer 

你應該看看這個方向發展。

+0

給我怎樣才能改變? (它不是在詹金斯工作,但工作很好獨立) –

+0

也許詹金斯是作爲Windows服務運行,與Windows用戶不同? (並且該用戶沒有正確配置的環境) –

1

這是 stack overflow thread與幾乎相同的錯誤有關。

的解決辦法是 「添加Java的附加參數的conf/wrapper.conf」 由@Erkut Evirgen

wrapper.java.additional.3=-Duser.language=en