I have tried all the possible solutions found here, including:
find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;
mvn -U clean
It does not work anyway, the specific log is as below:
btw: I was trying to run a struts2 sample code from mkyong site
[DEBUG] =======================================================================
[DEBUG] com.mkyong.common:Struts2Example:war:com.mkyong.common
[DEBUG] junit:junit:jar:3.8.1:test
[DEBUG] org.apache.struts:struts2-core:jar:2.1.8:compile
[DEBUG] com.opensymphony:xwork-core:jar:2.1.6:compile
[DEBUG] org.springframework:spring-test:jar:2.5.6:compile
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile
[DEBUG] org.freemarker:freemarker:jar:2.3.15:compile
[DEBUG] ognl:ognl:jar:2.7.3:compile
[DEBUG] commons-fileupload:commons-fileupload:jar:1.2.1:compile
[DEBUG] commons-io:commons-io:jar:1.3.2:compile
[DEBUG] com.sun:tools:jar:1.5.0:system
[DEBUG] org.apache.struts:struts2-convention-plugin:jar:2.1.8:compile
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo
.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/org/apache/struts/struts2-core/
2.1.8/struts2-core-2.1.8.jar
[DEBUG] Writing resolution tracking file D:\ProgramData\apache-maven-repo\.m2\re
pository\org\apache\struts\struts2-core\2.1.8\struts2-core-2.1.8.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 52:31.162s
[INFO] Finished at: Fri Jan 18 20:16:49 CST 2013
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Struts2Example: Could not resolve depe
ndencies for project com.mkyong.common:Struts2Example:war:com.mkyong.common: Cou
ld not transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to centra
l (http://repo.maven.apache.org/maven2): GET request of: org/apache/struts/strut
s2-core/2.1.8/struts2-core-2.1.8.jar from central failed: Read timed out -> [Hel
p 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project Struts2Example: Could not resolve dependencies for project com.mkyong.
common:Struts2Example:war:com.mkyong.common: Could not transfer artifact org.apa
che.struts:struts2-core:jar:2.1.8 from/to central (http://repo.maven.apache.org/
maven2): GET request of: org/apache/struts/struts2-core/2.1.8/struts2-core-2.1.8
.jar from central failed
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:210)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:117)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:201)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project com.mkyong.common:Struts2Example:war:com.mkyong.co
mmon: Could not transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/
to central (http://repo.maven.apache.org/maven2): GET request of: org/apache/str
uts/struts2-core/2.1.8/struts2-core-2.1.8.jar from central failed
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:189)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:185)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Could n
ot transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to central (h
ttp://repo.maven.apache.org/maven2): GET request of: org/apache/struts/struts2-c
ore/2.1.8/struts2-core-2.1.8.jar from central failed
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:183)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not
transfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to central (htt
p://repo.maven.apache.org/maven2): GET request of: org/apache/struts/struts2-cor
e/2.1.8/struts2-core-2.1.8.jar from central failed
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:358)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not tra
nsfer artifact org.apache.struts:struts2-core:jar:2.1.8 from/to central (http://
repo.maven.apache.org/maven2): GET request of: org/apache/struts/struts2-core/2.
1.8/struts2-core-2.1.8.jar from central failed
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(Run
nableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: org/a
pache/struts/struts2-core/2.1.8/struts2-core-2.1.8.jar from central failed
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
49)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
10)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:2
87)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:97)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:601)
... 4 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionInputBuffer.read(AbstractSessionInputBuffer.java:187)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengt
hInputStream.read(ContentLengthInputStream.java:176)
at org.apache.maven.wagon.providers.http.httpclient.conn.EofSensorInputS
tream.read(EofSensorInputStream.java:138)
at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:493)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
39)
... 9 more
Read timed out means you have a network problem. Either repo.maven.apache.org is down (very unlikely) or you have connectivity issues on your end.
Read Timeout errors can also happen with big dependency resolution on slow networks (that you may not be able to fix by yourself). You may also want to consider this other thread, here you will find how to increase the Maven Wagon timeout which will help you in such cases.
Also check the official documentation for more details.
But using wget I am able to download instance. It is almost halt here..waited more than 15 mins..
INFO]
[INFO] --- maven-checkstyle-plugin:2.13:check (validate-checkstyle) # onos ---
[DEBUG] Using connector WagonRepositoryConnector with priority 0.0 for http://repo.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-module-xhtml/1.2/doxia-module-xhtml-1.2.pom
2/2 KB
Regards,
Bala
Related
I followed the steps to install :
wget http://dl.bintray.com/sbt/rpm/sbt-0.13.16.rpm
And install by yum
sudo yum install sbt-0.13.16.rpm
Check it with sbt about
sbt about
It give me an error please help with this issue
$ sbt about
[info] Loading project definition from /../scala/2.11.12/project/project
[info] Loading project definition from //scala/2.11.12/project
[info] Updating {file://scala/2.11.12/project/}root-2-11-12-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Resolving key references (10396 settings) ...
fatal: Not a git repository (or any parent up to mount point /scratch)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: Not a git repository (or any parent up to mount point /scratch)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: Not a git repository (or any parent up to mount point /scratch)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
java.lang.StringIndexOutOfBoundsException: String index out of range: 7
at java.lang.String.substring(String.java:1963)
at VersionUtil$$anonfun$versionPropertiesImpl$1.apply(VersionUtil.scala:81)
at VersionUtil$$anonfun$versionPropertiesImpl$1.apply(VersionUtil.scala:61)
at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] java.lang.StringIndexOutOfBoundsException: String index out of range: 7
[error] Use 'last' for the full log.
I'm getting the following response while trying to run sonar-scanner from Jenkins per pull request -
org.sonar.plugins.github.PullRequestProjectBuilder: Unable to
perform GitHub WS operation: Server returned HTTP response code: -1,
message: 'null' for URL: https://api.github.com/user -> [Help 1]
I'm working internal organization network, but I've configured the proxy on Jenkins, maven, git. My SonarQube runs on different server than the Jenkins node executing the build.
If I'm trying the sonar scan on the Jenkins build without trying to use the GitHub option - it runs smoothly. Moreover all other tools reach github perfectly, pullrequestbuilder(jenkins) even updates the status automatically (so it seems a strictly sonarqube issue).
Thanks ahead.
Update #1:
mvn command -
mvn -X -e sonar:sonar >> SonarQubeReport.txt \
-Dsonar.host.url=http://XXX:9000/ -Dsonar.sourceEncoding=UTF-8 \
-Dsonar.verbose=true -Dsonar.sources=src\main\java -Dsonar.forceUpdate=true \
-Dsonar.analysis.mode=issues -Dsonar.github.pullRequest=${gphrbPullId} \
-Dsonar.github.user="XXXX" -Dgithub.oauth="XXXXX" \
-Dsonar.github.repository=XXX/XXXX -Dsonar.login=XXXXX
Result:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00)
Maven home: C:\maven\3.3.9\bin\..
Java version: 1.8.0_77, vendor: Oracle Corporation
Java home: C:\Java\jdk1.8.0_77\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows server 2012 r2", version: "6.3", arch: "amd64", family: "dos"
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: org.jenkins-ci.plugins:hello-world:hpi:2.1-SNAPSHOT
[DEBUG] Tasks: [sonar:sonar]
[DEBUG] Style: Aggregating
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hello World Example Plugin 2.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- sonar-maven-plugin:3.0.2:sonar (default-cli) # hello-world ---
[DEBUG] Configuring mojo org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar from plugin realm ClassRealm[plugin>org.codehaus.mojo:sonar-maven-plugin:3.0.2, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
[DEBUG] Configuring mojo 'org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar' with basic configurator -->
[DEBUG] (f) localRepository = id: local
url: file:///C:/Users/xxxx/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) session = org.apache.maven.execution.MavenSession#53a84ff4
[DEBUG] (f) skip = false
[DEBUG] -- end configuration --
[INFO] User cache: C:\Users\xxxx\.sonar\cache
[DEBUG] Extract sonar-scanner-api-batch in temp...
[DEBUG] Get bootstrap index...
[DEBUG] Download: http://xxx.xxx.net:9000/batch_bootstrap/index
[DEBUG] Get bootstrap completed
[DEBUG] Create isolated classloader...
[DEBUG] Start temp cleaning...
[DEBUG] Temp cleaning done
[DEBUG] Execution getVersion
[DEBUG] Execution start
[DEBUG] Issues global mode
[INFO] Load global repositories
[DEBUG] GET 200 http://xxx.xxx.net:9000/batch/global | time=93ms
[INFO] Load global repositories (done) | time=315ms
[INFO] User cache: C:\Users\xxx\.sonar\cache
[INFO] Exclude plugins: devcockpit, buildstability, pdfreport, report, scmstats, buildbreaker, views, jira
[INFO] Load plugins index
[DEBUG] GET 200 http://xxx.xxx.net:9000/deploy/plugins/index.txt | time=8ms
[INFO] Load plugins index (done) | time=8ms
[DEBUG] Load plugins
[DEBUG] Load plugins (done) | time=17ms
[DEBUG] API compatibility mode is enabled on plugin C# [csharp] (built with API lower than 5.2)
[DEBUG] API compatibility mode is enabled on plugin Git [scmgit] (built with API lower than 5.2)
[DEBUG] API compatibility mode is enabled on plugin SVN [scmsvn] (built with API lower than 5.2)
[DEBUG] Plugins:
[DEBUG] * C# 5.3.2 (csharp)
[DEBUG] * GitHub 1.3 (github)
[DEBUG] * Java 4.2 (java)
[DEBUG] * Git 1.2 (scmgit)
[DEBUG] * SVN 1.3 (scmsvn)
[DEBUG] * JavaScript 2.14 (javascript)
[DEBUG] Execution getVersion
[INFO] SonarQube version: 6.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[DEBUG] Work directory: C:\workspace\xxx\208\target\sonar
[DEBUG] Execution getVersion
[DEBUG] Execution execute
[INFO] Process project properties
[DEBUG] Process project properties (done) | time=6ms
[INFO] Load project repositories
[DEBUG] GET 200 http://xxx.xxx.net:9000/batch/project.protobuf?key=org.jenkins-ci.plugins%3Ahello-world&issues_mode=true | time=31ms
[INFO] Load project repositories (done) | time=213ms
[INFO] Execute project builders
[DEBUG] Unable to perform GitHub WS operation
org.kohsuke.github.HttpException: Server returned HTTP response code: -1, message: 'null' for URL: https://api.github.com/user
at org.kohsuke.github.Requester.parse(Requester.java:532) ~[github-api-1.76.jar:na]
at org.kohsuke.github.Requester._to(Requester.java:247) ~[github-api-1.76.jar:na]
at org.kohsuke.github.Requester.to(Requester.java:209) ~[github-api-1.76.jar:na]
at org.kohsuke.github.GitHub.getMyself(GitHub.java:279) ~[github-api-1.76.jar:na]
at org.kohsuke.github.GitHub.<init>(GitHub.java:145) ~[github-api-1.76.jar:na]
at org.kohsuke.github.GitHubBuilder.build(GitHubBuilder.java:196) ~[github-api-1.76.jar:na]
at org.sonar.plugins.github.PullRequestFacade.init(PullRequestFacade.java:80) ~[sonar-github-plugin-1.3.jar:na]
at org.sonar.plugins.github.PullRequestProjectBuilder.build(PullRequestProjectBuilder.java:52) [sonar-github-plugin-1.3.jar:na]
at org.sonar.scanner.scan.ProjectBuildersExecutor.execute(ProjectBuildersExecutor.java:53) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.scanner.scan.ImmutableProjectReactorProvider.provide(ImmutableProjectReactorProvider.java:32) [sonar-scanner-engine-shaded-6.0.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_77]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77]
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.MethodInjector.access$000(MethodInjector.java:39) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:113) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:67) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118) [sonar-scanner-engine-shaded-6.0.jar:na]
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62) [sonar-scanner-api-batch4396532511294315936.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_77]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77]
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) [sonar-scanner-api-2.6.jar:na]
at com.sun.proxy.$Proxy23.execute(Unknown Source) [na:na]
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240) [sonar-scanner-api-2.6.jar:na]
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151) [sonar-scanner-api-2.6.jar:na]
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78) [sonar-maven-plugin-3.0.2.jar:na]
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112) [sonar-maven-plugin-3.0.2.jar:na]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) [maven-core-3.3.9.jar:3.3.9]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) [maven-embedder-3.3.9.jar:3.3.9]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) [maven-embedder-3.3.9.jar:3.3.9]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) [maven-embedder-3.3.9.jar:3.3.9]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_77]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_77]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_77]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_77]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [plexus-classworlds-2.5.2.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [plexus-classworlds-2.5.2.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [plexus-classworlds-2.5.2.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [plexus-classworlds-2.5.2.jar:na]
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: access_denied
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[na:1.8.0_77]
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) ~[na:1.8.0_77]
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023) ~[na:1.8.0_77]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125) ~[na:1.8.0_77]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) ~[na:1.8.0_77]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) ~[na:1.8.0_77]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) ~[na:1.8.0_77]
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) ~[na:1.8.0_77]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[na:1.8.0_77]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513) ~[na:1.8.0_77]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441) ~[na:1.8.0_77]
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[na:1.8.0_77]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) ~[na:1.8.0_77]
at org.kohsuke.github.Requester.parse(Requester.java:510) ~[github-api-1.76.jar:na]
... 80 common frames omitted
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.603 s
[INFO] Finished at: 2016-09-14T10:29:09+03:00
[INFO] Final Memory: 78M/382M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project hello-world: Unable to load component class org.sonar.scanner.scan.ImmutableProjectReactor: Failed to execute project builder: org.sonar.plugins.github.PullRequestProjectBuilder: Unable to perform GitHub WS operation: Server returned HTTP response code: -1, message: 'null' for URL: https://api.github.com/user -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project hello-world: Unable to load component class org.sonar.scanner.scan.ImmutableProjectReactor
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to load component class org.sonar.scanner.scan.ImmutableProjectReactor
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:112)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ImmutableProjectReactor
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:69)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1034)
at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1026)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1003)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:115)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:118)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy23.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
... 23 more
Caused by: Failed to execute project builder: org.sonar.plugins.github.PullRequestProjectBuilder
Caused by: Unable to perform GitHub WS operation: Server returned HTTP response code: -1, message: 'null' for URL: https://api.github.com/user
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Update #3:
I've ran a manual test using cURL to try to reach GitHub with same token and all, and it seems that for some reason the sonar github plugin doesn't use the proxy configuration defined at the SonarQube configuration file (I will look at the code later).
Command:
curl -x http://<proxy address>:8080 -u <github user>:<personal token> https://api.github.com/users/<github user> -I
Result:
HTTP/1.1 200 Connection established
HTTP/1.1 200 OK
Server: GitHub.com
Date: Thu, 15 Sep 2016 06:51:06 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1201
Status: 200 OK
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4966
X-RateLimit-Reset: 1473922618
Cache-Control: private, max-age=60, s-maxage=60
Vary: Accept, Authorization, Cookie, X-GitHub-OTP
ETag: "xxx"
Last-Modified: Sun, 11 Sep 2016 06:21:00 GMT
X-OAuth-Scopes: admin:repo_hook, notifications, repo
X-Accepted-OAuth-Scopes:
X-GitHub-Media-Type: github.v3
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
Access-Control-Allow-Origin: *
Content-Security-Policy: default-src 'none'
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-XSS-Protection: 1; mode=block
Vary: Accept-Encoding
X-Served-By: 8dd185e423974a7e13abbbe6e060031e
X-GitHub-Request-Id: D4758807:3394:7FFB04:57DA44D9
The error comes from GitHub: "Unable to perform GitHub WS operation"
Double check your sonar.github.oath configuration to make sure you've properly configured an access token with public_repo scope.
I had the same Problem. Our GitHub Enterprise works with a self signed certificate. So I had to import the Certificate into my Java-Keystore for the JVM my gradle Process runs with.
Issue have probably occurred due to proxy support issues, fix details is in the following pull request:
https://github.com/SonarSource/sonar-github/pull/20
I was getting the same error, but in my case, it was not a proxy issue since all my servers (sonar/github/jenkis) are behind the firewall.
I ended up using keineantwort solution.
I'm just extending the answer for the people looking for the commands to do it.
Download the certificate
openssl s_client -connect github.MYDOMAIN:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
Import the certificate
<JAVA_HOME>/bin/keytool -import -alias github.MYDOMAIN -keystore <JAVA_HOME>/jre/lib/security/cacerts -file public.crt
Where github.MYDOMAIN is the fqdn of my github enterprise instance
I have a large and moderately complex web application, using the standard Typesafe Stack of Play, Scala and Akka. (I'm in the process of adding scala.js, but this problem predates that.)
A couple of months ago, I upgraded to the current Activator-based version of the world (having fallen behind the times), and that's mostly worked fine. But ever since then, I am semi-frequently getting a weird error when I try to compile:
[Querki] $ compile
[trace] Stack trace suppressed: run last scalajvm/compile:compile for the full output.
[error] (scalajvm/compile:compile) java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt2595416303704565240.class (Access is denied)
[error] Total time: 3 s, completed Sep 2, 2014 3:26:43 PM
Once it starts, it usually keeps recurring until I do a clean recompilation, so it's kind of a pain in the tuchus -- full recompilation of the system takes a while, and this is typically happening a couple of times a day. (OTOH, sometimes it simply stops happening, apparently for no reason.) Restarting Activator does not appear to help.
Anyone have any idea what's going on here? As far as I can tell, the classes.bak folder gets created temporarily during the compile process -- I can see it appear and then disappear again once the compile is finished, regardless of whether it succeeds. It definitely does not exist before the failed compiles start. It appears as if sbt is creating a temp folder in a broken state, or something like that.
If it's relevant, this is running on a Windows 7 box; I am using sbt 0.13.5, scala 2.11.1 and Activator 1.2.10.
ETA: Also conceivably relevant, now that I think of it -- I'm also running GitHub for Windows. I mention this because it's a Java-based app that is clearly doing something to check for changes to the tree periodically. (It auto-refreshes now and then; whether it is scanning the tree for changes or listening a la JNotify, I don't know.)
ETA2: Hah -- finally remembered to print the full log before cleaning. Here's the full stack traceback: I don't know what to make of it, but possibly someone on the sbt side of things can use it:
[Querki] $ compile
[info] Compiling 1 Scala source to C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajs\target\scala-2.11\classes...
[info] Fast optimizing C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes\public\javascripts\querki-client-fastopt.js
[trace] Stack trace suppressed: run last scalajvm/compile:compile for the full output.
[error] (scalajvm/compile:compile) java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt1117112335838311075.class (Access is denied)
[error] Total time: 22 s, completed Sep 5, 2014 3:17:25 PM
[Querki] $ last scalajvm/compile:compile
scalajs/compile:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala)
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala)
[info] Compiling 1 Scala source to C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajs\target\scala-2.11\classes...
[debug] Getting compiler-interface from component compiler for Scala 2.11.1
[debug] Getting compiler-interface from component compiler for Scala 2.11.1
[debug] Running cached compiler 1f1ebd37, interfacing (CompilerInterface) with Scala compiler version 2.11.1
[debug] Calling Scala compiler with arguments (CompilerInterface):
[debug] -Xplugin:C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-compiler_2.11.1\jars\scalajs-compiler_2.11.1-0.5.4.jar
[debug] -bootclasspath
[debug] C:\Program Files\Java\jdk1.6.0_38\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_38\jre\lib\modules\jdk.boot.jar;C:\Program Files\Java\jdk1.6.0_38\jre\classes;C:\Users\jducoeur\.ivy2\cache\org.scala-lang\scala-library\jars\scala-library-2.11.1.jar
[debug] -classpath
[debug] C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajs\target\scala-2.11\classes;C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-library_2.11\jars\scalajs-library_2.11-0.5.4.jar;C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-dom_sjs0.5_2.11\jars\scalajs-dom_sjs0.5_2.11-0.6.jar;C:\Users\jducoeur\.ivy2\cache\org.scala-lang.modules.scalajs\scalajs-jquery_sjs0.5_2.11\jars\scalajs-jquery_sjs0.5_2.11-0.6.jar;C:\Users\jducoeur\.ivy2\cache\org.webjars\jquery\jars\jquery-1.10.2.jar
[debug] Scala compilation took 6.133828284 s
[debug] New invalidations:
[debug] Set()
[debug] Initial set of included nodes: Set()
[debug] Previously invalidated, but (transitively) depend on new invalidations:
[debug] Set()
[debug] All newly invalidated sources after taking into account (previously) recompiled sources:Set()
scalajvm/compile:compile
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala, C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\app\qtext\LineParsers.scala)
[debug] Removed products: Set()
[debug] External API changes: API Changes: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala, C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\app\qtext\LineParsers.scala)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set(C:\Users\jducoeur\Documents\GitHub\Querki\querki\scala\src\main\scala\qtexttest\LineParsers.scala, C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\app\qtext\LineParsers.scala)
java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt1117112335838311075.class (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at sbt.Using$$anonfun$fileOutputChannel$1.apply(Using.scala:82)
at sbt.Using$$anonfun$fileOutputChannel$1.apply(Using.scala:82)
at sbt.Using$$anon$2.openImpl(Using.scala:72)
at sbt.OpenFile$class.open(Using.scala:46)
at sbt.Using$$anon$2.open(Using.scala:70)
at sbt.Using$$anon$2.open(Using.scala:70)
at sbt.Using.apply(Using.scala:24)
at sbt.IO$$anonfun$copyFile$3.apply(IO.scala:583)
at sbt.IO$$anonfun$copyFile$3.apply(IO.scala:582)
at sbt.Using.apply(Using.scala:25)
at sbt.IO$.copyFile(IO.scala:582)
at sbt.IO$.move(IO.scala:764)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2.sbt$inc$ClassfileManager$$anonfun$$anon$$move(ClassfileManager.scala:77)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2$$anonfun$delete$3.apply(ClassfileManager.scala:53)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2$$anonfun$delete$3.apply(ClassfileManager.scala:52)
at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:153)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:306)
at sbt.inc.ClassfileManager$$anonfun$transactional$1$$anon$2.delete(ClassfileManager.scala:52)
at sbt.inc.Incremental$.prune(Incremental.scala:58)
at sbt.inc.IncrementalCommon.cycle(Incremental.scala:96)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:38)
at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:37)
at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:65)
at sbt.inc.Incremental$.compile(Incremental.scala:37)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:27)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:157)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile.apply(AggressiveCompile.scala:46)
at sbt.Compiler$.apply(Compiler.scala:75)
at sbt.Compiler$.apply(Compiler.scala:66)
at sbt.Defaults$.sbt$Defaults$$compileTaskImpl(Defaults.scala:770)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:762)
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:762)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
at sbt.std.Transform$$anon$4.work(System.scala:64)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:244)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[error] (scalajvm/compile:compile) java.io.FileNotFoundException: C:\Users\jducoeur\Documents\GitHub\Querki\querki\scalajvm\target\scala-2.11\classes.bak\sbt1117112335838311075.class (Access is denied)
[Querki] $
If I run play run from my scala project root, it launches normally and I can test against it.
If I run play start, it does not bind to a port and there's no log output or any other indication that anything is wrong.
$ play run
[info] Loading project definition from /Users/Daenyth/myproject/project
[info] Set current project to myproject (in build file:/Users/Daenyth/myproject/)
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0%0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
$ play start
[info] Loading project definition from /Users/Daenyth/Localytics/myproject/project
[info] Set current project to profile-api (in build file:/Users/Daenyth/myproject/)
(Starting server. Type Ctrl+D to exit logs, the server will remain in background)
If I start the app by using the launcher generated by play dist or play stage it shows me the process ID but it does not bind the port.
I'm at a loss on how to proceed here - googling hasn't returned anything useful at all.
Edit:
After leaving it running for quite a long time (at least 10 minutes, I'm not sure), it finally put this output:
[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sleeping for 0ms and trying again. Attempts left: 0. Exception: java.net.ConnectException: Connection timed out.Message:Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Oops, cannot start the server.
Configuration error: Configuration error[Cannot connect to database [default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:92)
at play.api.Configuration.reportError(Configuration.scala:570)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:252)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:243)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at play.api.db.BoneCPPlugin.onStart(DB.scala:243)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:88)
at scala.collection.immutable.List.foreach(List.scala:318)
at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.api.Play$$anonfun$start$1.apply(Play.scala:88)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.api.Play$.start(Play.scala:87)
at play.core.StaticApplication.<init>(ApplicationProvider.scala:52)
at play.core.server.NettyServer$.createServer(NettyServer.scala:243)
at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:279)
at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:274)
at scala.Option.map(Option.scala:145)
at play.core.server.NettyServer$.main(NettyServer.scala:274)
at play.core.server.NettyServer.main(NettyServer.scala)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:344)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2332)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2369)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2153)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:381)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at com.jolbox.bonecp.BoneCP.obtainRawInternalConnection(BoneCP.java:363)
at com.jolbox.bonecp.BoneCP.<init>(BoneCP.java:416)
at com.jolbox.bonecp.BoneCPDataSource.getConnection(BoneCPDataSource.java:120)
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:245)
... 22 more
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:241)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:257)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:294)
... 40 more
The issue here was that the mysql server that I had configured was not reachable from my local machine, and I had a mistake in my EC2 security group that prevented my deployed instance from connecting. The defaults for timeout and max retry are very high, so I didn't see it at first because it doesn't print anything if you ^C it.
Changing my network security rules solved the problem.
This question already has answers here:
How to prevent java.lang.OutOfMemoryError: PermGen space at Scala compilation?
(9 answers)
Closed 9 years ago.
I am frequently getting an OutOfMemoryError from SBT.
> test
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
[error] Use 'last' for the full log.
> last
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] Initially invalidated: Set()
[debug] Copy resource mappings:
[debug]
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] Initially invalidated: Set()
[debug] Copy resource mappings:
[debug]
[debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
[debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
[debug] Framework implementation 'org.scalatest.tools.ScalaTestFramework' not present.
[debug] Framework implementation 'com.novocode.junit.JUnitFramework' not present.
[debug] Subclass fingerprints: Stream((org.specs2.specification.SpecificationStructure,false,org.specs2.runner.Fingerprints$$anon$1#34d6488c), ?)
[debug] Annotation fingerprints: Stream()
[debug] Running Test ExpandoObjectTest : subclass(false, org.specs2.specification.SpecificationStructure) with arguments
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:196)
at sbt.Execute.next$1(Execute.scala:85)
at sbt.Execute.processAll(Execute.scala:88)
at sbt.Execute.runKeep(Execute.scala:68)
at sbt.EvaluateTask$.run$1(EvaluateTask.scala:162)
at sbt.EvaluateTask$.runTask(EvaluateTask.scala:177)
at sbt.Aggregation$$anonfun$4.apply(Aggregation.scala:46)
at sbt.Aggregation$$anonfun$4.apply(Aggregation.scala:44)
at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:137)
at sbt.Aggregation$.runTasksWithResult(Aggregation.scala:44)
at sbt.Aggregation$.runTasks(Aggregation.scala:59)
at sbt.Aggregation$$anonfun$applyTasks$1.apply(Aggregation.scala:31)
at sbt.Aggregation$$anonfun$applyTasks$1.apply(Aggregation.scala:30)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:62)
at sbt.Command$.process(Command.scala:90)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:71)
at sbt.State$$anon$2.process(State.scala:170)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(MainLoop.scala:71)
at sbt.MainLoop$.run(MainLoop.scala:64)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:53)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:50)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:50)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:33)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:17)
at sbt.MainLoop$.runLogged(MainLoop.scala:13)
at sbt.xMain.run(Main.scala:26)
at xsbt.boot.Launch$.run(Launch.scala:55)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:69)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at sbt.Project$$anon$5.apply(Project.scala:130)
at sbt.Project$$anon$5.apply(Project.scala:128)
at sbt.LogManager$.commandBase$1(LogManager.scala:59)
at sbt.LogManager$.command$1(LogManager.scala:60)
at sbt.LogManager$$anonfun$suppressedMessage$1.apply(LogManager.scala:61)
at sbt.LogManager$$anonfun$suppressedMessage$1.apply(LogManager.scala:61)
at sbt.ConsoleLogger.trace(ConsoleLogger.scala:163)
at sbt.AbstractLogger.log(Logger.scala:32)
at sbt.MultiLogger$$anonfun$dispatch$1.apply(MultiLogger.scala:40)
at sbt.MultiLogger$$anonfun$dispatch$1.apply(MultiLogger.scala:38)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:76)
at sbt.MultiLogger.dispatch(MultiLogger.scala:38)
at sbt.MultiLogger.trace(MultiLogger.scala:30)
at sbt.TestLogger$$anon$2.trace(TestReportListener.scala:71)
at sbt.TestLogger.endGroup(TestReportListener.scala:88)
at sbt.TestRunner$$anonfun$run$5.apply(TestFramework.scala:87)
at sbt.TestRunner$$anonfun$run$5.apply(TestFramework.scala:87)
at sbt.TestFramework$$anonfun$safeForeach$1.apply(TestFramework.scala:112)
at sbt.TestFramework$$anonfun$safeForeach$1.apply(TestFramework.scala:112)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
[error] Use 'last' for the full log.
Sometimes it also exits abruptly with:
sbt appears to be exiting abnormally.
The log file for this session is at /var/folders/vf/3khb58091wd0_1rz1yh6knb00000gp/T/sbt3242766352271599341.log
java.lang.OutOfMemoryError: PermGen space
Error during sbt execution: java.lang.OutOfMemoryError: PermGen space
Any solutions?
This sometimes happens if you compile huge codebases - a lot of classes get loaded into the VM running sbt.
You need to increase the PermGen space for sbt - use the flag -XX:MaxPermSize=256m, where 256 you can change with the desired size of the permanent generation.
Run:
cat `which sbt`
to locate you sbt startup script. Then edit it to include the flag with the java command that runs the sbt launcher in the similar way as it is described here for modifying -Xmx and -Xms.
Adding the -XX:+CMSClassUnloadingEnabled flag should also enable sbt to unload the classloaders with classes from the previous compilation runs that are no longer being used.
EDIT:
Alternatively, you can set these options in the SBT_OPTS environment variable if you are using the extended script for running sbt.