Tests do not start when using JProfiler plugin in Gradle - gradle

I have a Gradle project with unit tests. If I do
./gradlew tests
the tests run as expected. One of them is very slow, so I was attempting to profile it with JProfiler. Based on https://www.ej-technologies.com/resources/jprofiler/help/doc/commandLine/gradleTasks.html, I added this to my build.gradle.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.jprofiler:gradle_publish:13.0-PRE1"
}
}
apply plugin: "com.jprofiler"
<pre-existing build file>
jprofiler {
installDir = file('/Applications/JProfiler.app/Contents/Resources/app')
}
task testProfile(type: com.jprofiler.gradle.TestProfile) {
// mainClass = 'com.mycorp.MyMainClass'
//classpath sourceSets.main.testClasspath
// offline = true
// sessionId = 80
// configFile = file('path/to/jprofiler_config.xml')
}
Now if I do ./gradlew tasks, it lists the testProfile task. When I try to run the task, it waits for the profiler to connect.
$ ./gradlew testProfile
> Task :testProfile
JProfiler> Protocol version 55
JProfiler> Using JVMTI
JProfiler> Java 9+ detected.
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jprofiler.agent.LockManager to field java.util.concurrent.locks.AbstractOwnableSynchronizer.exclusiveOwnerThread
WARNING: Please consider reporting this to the maintainers of com.jprofiler.agent.LockManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
JProfiler> Retransforming 249 base class files.
JProfiler> Base classes instrumented.
JProfiler> Waiting for a connection from the JProfiler GUI ...
<===========--> 85% EXECUTING [53s]
> :testProfile > 0 tests completed
In JProfiler, I open Start Center and in the Quick Attach tab, I see to gradle related processes.
I select the one with testProfile, and get an error about numeric values.
In the gradle window, there are messages that look like JProfiler starting up.
<===========--> 85% EXECUTING [2m 32s]
> :testProfile > 0 tests completed
JProfiler> Protocol version 55
JProfiler> Using JVMTI
JProfiler> Java 9+ detected.
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 51641.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.jprofiler.agent.LockManager to field java.util.concurrent.locks.AbstractOwnableSynchronizer.exclusiveOwnerThread
WARNING: Please consider reporting this to the maintainers of com.jprofiler.agent.LockManager
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Retransforming 9 base class files.
JProfiler> Attach mode initializedzed
<===========--> 85% EXECUTING [3m 41s]
> :testProfile > 0 tests completed
When I reopen Start Center, the process is now highlighted in green.
I select it, and now JProfiler appears to connect. I can see all the types of information I expect to see about the process.
However, it appears to just be Gradle control processes.
In the gradle window, I do not see any indication that the tests are running. All I see is, every 2 minutes, a message about a timeout and (I think) a restart.
JProfiler> Using sampling (5 ms)
Unable to connect to the child process 'Gradle Test Executor 12'.
It is likely that the child process have crashed - please find the stack trace in the build log.
This exception might occur when the build machine is extremely loaded.
The connection attempt hit a timeout after 120.0 seconds (last known process state: STARTED, running: true).
org.gradle.process.internal.ExecException: Unable to connect to the child process 'Gradle Test Executor 12'.
It is likely that the child process have crashed - please find the stack trace in the build log.
This exception might occur when the build machine is extremely loaded.
The connection attempt hit a timeout after 120.0 seconds (last known process state: STARTED, running: true).
at org.gradle.process.internal.worker.DefaultWorkerProcess.doStart(DefaultWorkerProcess.java:192)
at org.gradle.process.internal.worker.DefaultWorkerProcess.start(DefaultWorkerProcess.java:168)
at org.gradle.process.internal.worker.DefaultWorkerProcessBuilder$MemoryRequestingWorkerProcess.start(DefaultWorkerProcessBuilder.java:252)
at org.gradle.api.internal.tasks.testing.worker.ForkingTestClassProcessor.forkProcess(ForkingTestClassProcessor.java:118)
at org.gradle.api.internal.tasks.testing.worker.ForkingTestClassProcessor.processTestClass(ForkingTestClassProcessor.java:91)
at org.gradle.api.internal.tasks.testing.processors.RestartEveryNTestClassProcessor.processTestClass(RestartEveryNTestClassProcessor.java:52)
at jdk.internal.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.FailureHandlingDispatch.dispatch(FailureHandlingDispatch.java:30)
at org.gradle.internal.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:87)
at org.gradle.internal.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:36)
at org.gradle.internal.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:71)
at org.gradle.internal.concurrent.InterruptibleRunnable.run(InterruptibleRunnable.java:42)
at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:834)
JProfiler> Protocol version 55
JProfiler> Using JVMTI
JProfiler> Java 9+ detected.
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
I have also tried connecting to the other gradle process, but it has similar results.
What do I need to do to get the tests to actually run?
Config:
JProfiler 9.2.1
$ ./gradlew --version
Gradle 6.4.1
Build time: 2020-05-15 19:43:40 UTC
Revision: 1a04183c502614b5c80e33d603074e0b4a2777c5
Kotlin: 1.3.71
Groovy: 2.5.10
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 11.0.8 (AdoptOpenJDK 11.0.8+10)
OS: Mac OS X 10.16 x86_64

Related

Spark - How to colourise terminal output from spark-submit

When I run spark-submit it works successfully, but the output is not colourised.
(/Users/me/bai/conda-envs/spark-mllib-kmeans) me#my-mbp spark-mllib-kmeans % spark-submit spark-helloWorld.py
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.spark.unsafe.Platform (file:/usr/local/Cellar/apache-spark/3.0.1/libexec/jars/spark-unsafe_2.12-3.0.1.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of org.apache.spark.unsafe.Platform
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
20/12/22 12:18:33 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
20/12/22 12:18:34 INFO SparkContext: Running Spark version 3.0.1
20/12/22 12:18:34 INFO ResourceUtils: ==============================================================
20/12/22 12:18:34 INFO ResourceUtils: Resources for spark.driver:
20/12/22 12:18:34 INFO ResourceUtils: ==============================================================
20/12/22 12:18:34 INFO SparkContext: Submitted application: Simple App
...
I am using Spark version 3.0.1:
(base) me#my-mbp spark-mllib-kmeans % spark-shell --version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.spark.unsafe.Platform (file:/usr/local/Cellar/apache-spark/3.0.1/libexec/jars/spark-unsafe_2.12-3.0.1.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of org.apache.spark.unsafe.Platform
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Welcome to
____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 3.0.1
/_/
Using Scala version 2.12.10, OpenJDK 64-Bit Server VM, 14.0.1
Branch HEAD
Compiled by user ubuntu on 2020-08-28T08:58:35Z
Revision 2b147c4cd50da32fe2b4167f97c8142102a0510d
Url https://gitbox.apache.org/repos/asf/spark.git
Type --help for more information.
I am using the default Mac terminal program on latest Mac OS:
% uname -a
Darwin my-mbp.lan 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
I would like to see the different log statement levels (WARN/INFO/ERROR) in different colours. Perhaps other use of colours to differentiate the output from spark framework and the output from my application.
Given there is so much framework level output and there is noise of WARNINGS due to framework issues, I was hoping better use of colour could help me to scan my output quicker.
Is there a simple solution for this?
I see this behaviour in both native Mac Terminal and MS VSC integrated terminal.
I saw the output line:
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
I see I can create then edit the log4j config file here, so perhaps I just need the config for the log4j config file to colourise all output.
% cd $SPARK_HOME/conf
% cp log4j.properties.template log4j.properties
I got the same warning but it works properly without errors.

FileNet Configuration Manager fails to connect to WebSphere Application Server

I have an issue with FileNet configuration manager connecting to WAS when configuring CPE. Details are below
OS : Windows 10 Enterprise (This is where CPE 5.5 is installed)
WAS : 8.5.5.13
WAS Java : 1.8_64_bundled
FN Config Details
I'm able to login to WAS console and the SOAP port is also correct.
Things that I tried,
adding -Dhttps.protocols="TLSv1,TLSv1.1,TLSv1.2" in configmgr.ini of FileNet configuration manager
Verified SSL configuration on WAS
But noting seems to work. I see below error message on the FileNet configuration manager logs
!ENTRY com.ibm.ecm.configmgr.engine 4 0 2018-06-27 15:45:09.289
!MESSAGE An invalid profile path was specified. C:\IBM\FileNet\ContentEngine\tools\configure\profiles\dotnetclient does not contain any configuration information.
!SESSION 2018-06-27 16:05:40.995 -----------------------------------------------
eclipse.buildId=unknown
java.fullversion=JRE 1.7.0 IBM J9 2.6 Windows 8 x86-32 20170718_357001 (JIT disabled, AOT disabled)
J9VM - R26_Java726_SR10_20170718_1208_B357001
GC - R26_Java726_SR10_20170718_1208_B357001
J9CL - 20170718_357001
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments: gui
Command-line arguments: -os win32 -ws win32 -arch x86 gui
!ENTRY com.ibm.ecm.configmgr.app.ce 4 0 2018-06-27 16:13:56.518
!MESSAGE Connection error: The connection to the application server cannot be established. Ensure the application server is running and that the SOAP connector port and host name are correct.
!STACK 0
com.ibm.ecm.configmgr.engine.ConfigurationManagerException: Connection error: The connection to the application server cannot be established. Ensure the application server is running and that the SOAP connector port and host name are correct.
at com.ibm.ecm.configmgr.engine.jmx.JMXInvoker.invokeConnectMethodAndMethods(JMXInvoker.java:243)
at com.ibm.ecm.configmgr.engine.jmx.JMXInvoker.invokeConnectMethodAndMethod(JMXInvoker.java:142)
at com.ibm.ecm.configmgr.engine.jmx.WebSphereJMXInvoker.connect(WebSphereJMXInvoker.java:86)
at com.ibm.ecm.configmgr.app.ce.applicationserver.WebsphereApplicationServer$TestActivity.testWork(WebsphereApplicationServer.java:371)
at com.ibm.ecm.configmgr.engine.profile.EnvironmentTestActivity.test(EnvironmentTestActivity.java:64)
at com.ibm.ecm.configmgr.ui.wizards.NewProfileWizardPageGetProfileEnvironmentProps$7.widgetSelected(NewProfileWizardPageGetProfileEnvironmentProps.java:604)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at com.ibm.ecm.configmgr.app.ce.handlers.ProfileNewHandler.execute(ProfileNewHandler.java:67)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.ibm.ecm.configmgr.app.ce.rcp.Application.start(Application.java:86)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.Exception: The connection to the application server cannot be established. Ensure the application server is running and that the SOAP connector port and host name are correct.
at com.ibm.ecm.configmgr.utils.websphere.WebSphereJMXUtil.connect(WebSphereJMXUtil.java:227)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56)
at java.lang.reflect.Method.invoke(Method.java:620)
at com.ibm.ecm.configmgr.engine.jmx.JMXInvoker.invokeConnectMethodAndMethods(JMXInvoker.java:191)
... 45 more
*************************telenet response**************************
When did telenet and after a few seconds, I see the below error
HTTP/1.1 408 Request Timeout Content-Type: text/html Content-Length: 117 Connection: close <HTML><TITLE>408 - Request Timeout</TITLE><BODY><h1>408 Connection timed out while reading request</h1></BODY></HTML> Connection to host lost. C:\Windows\system32>
*****************************workaround*****************************
Ok once the profile is created and ran first steps, I disabled global security and restarted websphere. Configuration manager is able to connect to WAS now (looks like issue with security. I verified Quality of protection (QoP) settings
with ssl.client.properties and it was selected as TLSv2. Then I changed it to TSLv1.2 and modified ssl.client.properties also. Still it did not work) I will updated this topic later.
Check default path Webshere.
C:\Program Files\IBM\WebSphere\AppServer
C:\Program Files\IBM\WebSphere\AppServer\profiles\your_profile
VS
C:\Program Files (x86)\IBM\WebSphere\AppServer
C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\your_profile
The Configuration Manager right now seems to support only older protocols. If you specify TLSv1 in WebSphere console, as opposed to TLSv1.2 for example, Test Connection will work. That will create you another problem though. Newer browsers don't support older protocols and you will not be able to open your WebSphere console in say, Firefox. On Windows, you can use your old but still included IE configured to use these older protocols - Tools -> Internet Options -> Advanced -> Security -> Use * . You'll get your console back that way.

sonar-runner getting java.lang.ClassNotFoundException: org.picocontainer.Startable

I upgraded my test Sonar server to 5.2 and am using sonar-runner-2.5-RC1 and haven't had any issues running sonar-runner to analyze my code. I then upgrade my production Sonar server to 5.2 and ran a production build using the same command line settings and sonar-runner.properties file and I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/picocontainer/Startable
I then ran the build on my 'test' build machine against the production sonar server and it ran correctly. So it appears to me that there must be some difference on the production build machine that is impacting sonar-runner but I can't figure out what the issue might be.
All I have in my sonar runner properties file is:
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.modules=svc1, \
svc2
svc1.sonar.java.binaries=../build/gradle/svc1/classes/
svc1.sonar.projectName=SVC1
svc2.sonar.java.binaries=../build/gradle/svc2/classes/
svc2.sonar.projectName=SVC2
cli.sonar.language=py
cli.sonar.projectName=CLI
SONAR_RUNNER_OPTS='-Xmx2048m -XX:MaxPermSize=512m' sonar-runner-2.5-RC1/bin/sonar-runner
-e
-Dproject.settings=/workspace/build/workspace/sonar-runner.properties
-Dsonar.host.url=http://192.XXX.XXX.X -Dsonar.projectKey=TEST
-Dsonar.projectName=TEST-driver -Dsonar.branch=master
-Dsonar.projectVersion=2.0.0.0
-Dsonar.java.libraries=/workspace/build/workspace/jars/*.jar,/workspace/build/workspace/build/gradle/portal/compile/lib/*.jar,/usr/lib64/jvm/java/lib/*.jar'
Logs:
INFO: Runner configuration file: NONE
INFO: Project configuration file: /workspace/build/workspace/CH-coprhd-controller-master-sonar/coprhd-controller-sonar-runner.properties
INFO: SonarQube Runner 2.5-RC1
INFO: Java 1.7.0_71 Oracle Corporation (64-bit)
INFO: Linux 3.16.6-2-desktop amd64
INFO: SONAR_RUNNER_OPTS=-Xmx2048m -XX:MaxPermSize=512m
INFO: Error stacktraces are turned on.
INFO: User cache: /workspace/build/workspace/CH-coprhd-controller-master-sonar/.sonar/cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=166ms
INFO: User cache: /workspace/build/workspace/CH-coprhd-controller-master-sonar/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=3ms
INFO: Download sonar-issues-density-plugin-1.0.jar
INFO: Download sonar-javascript-plugin-2.8.jar
INFO: Download sonar-findbugs-plugin-3.3.jar
INFO: Download sonar-groovy-plugin-1.3.jar
INFO: Download sonar-build-stability-plugin-1.3.jar
INFO: Download sonar-xml-plugin-1.3.jar
INFO: Download sonar-web-plugin-2.4.jar
INFO: Download sonar-clover-plugin-3.0.jar
INFO: Download sonar-sonargraph-plugin-3.4.2.jar
INFO: Download sonar-python-plugin-1.5.jar
INFO: Download sonar-scm-git-plugin-1.1.jar
INFO: Download sonar-scm-svn-plugin-1.2.jar
INFO: Download sonar-checkstyle-plugin-2.4.jar
INFO: Download sonar-pmd-plugin-2.5.jar
INFO: Download sonar-java-plugin-3.7.1.jar
INFO: Download sonar-generic-coverage-plugin-1.1.jar
INFO: Download sonar-css-plugin-1.5.jar
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Process project properties
Exception in thread "main" java.lang.NoClassDefFoundError: org/picocontainer/Startable
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
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 org.sonar.classloader.ClassRealm.loadClassFromSelf(ClassRealm.java:125)
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:37)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
at org.sonar.plugins.issuesdensity.IssuesDensityPlugin.getExtensions(IssuesDensityPlugin.java:37)
at org.sonar.batch.bootstrap.ExtensionInstaller.install(ExtensionInstaller.java:51)
at org.sonar.batch.scan.ProjectScanContainer.addBatchExtensions(ProjectScanContainer.java:234)
at org.sonar.batch.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:119)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:98)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.runner.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:61)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:275)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:166)
at org.sonar.runner.api.EmbeddedRunner.runAnalysis(EmbeddedRunner.java:153)
at org.sonar.runner.cli.Main.runAnalysis(Main.java:118)
at org.sonar.runner.cli.Main.execute(Main.java:80)
at org.sonar.runner.cli.Main.main(Main.java:66)
Caused by: java.lang.ClassNotFoundException: org.picocontainer.Startable
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 34 more
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 9,469ms last 8 cycles average is 1,183ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 28,431ms last 8 cycles average is 3,553ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 33,431ms last 8 cycles average is 4,178ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 2,661ms last 8 cycles average is 332ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 10,554ms last 8 cycles average is 1,319ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 9,480ms last 8 cycles average is 1,185ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 8,480ms last 8 cycles average is 1,060ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 11,104ms last 8 cycles average is 1,388ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 39,183ms last 8 cycles average is 4,897ms
INFO: [JOURNAL_FLUSHER] WARNING Journal flush operation took 4,995ms last 8 cycles average is 624ms
Build timed out (after 180 minutes). Marking the build as aborted.
This Issues Density Plugin is not compatible with SQ 5.2 and is no more maintained. See http://docs.sonarqube.org/display/PLUG/Issues+Density+Plugin. Moreover I recommend to open the page Administration > System > Update Center before upgrading SonarQube. It displays the list of incompatible plugins.
The issue turned out to be that when SONAR_USER_HOME pointed to the same folder where sonar_runner was executed in, the SonarQube plugins were first downloaded to $SONAR_USER_HOME and then as the analysis started, that location was wiped out for the analysis files for each module to be placed in the same folder. Ensuring SONAR_USER_HOME was in a different location resolved the issue.

Read timed out on /batch/project (SonarQube 4.5)

I am struggling with the following problem.
Log of the executed when sonar-runner in Jenkins.
SonarQube Runner 2.4
Java 1.7.0_67 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
SONAR_RUNNER_OPTS=-Xms256m -Xmx512m
INFO: Runner configuration file: D:\CI_BUILD\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "ko_KR", source code encoding: "UTF-8"
INFO: Work directory: D:\CI_BUILD\jenkins_home\jobs\CAFE-CLIENT\workspace\.sonar
INFO: SonarQube Server 4.5
05:17:52.119 INFO - Load global referentials...
05:17:53.382 INFO - Load global referentials done: 1263 ms
05:17:53.414 INFO - User cache: C:\Users\pcms_build\.sonar\cache
05:17:53.445 INFO - Install plugins
05:17:54.225 INFO - Install JDBC driver
05:17:54.303 INFO - Create JDBC datasource for jdbc:jtds:sqlserver://10.240.232.145/sonardb;SelectMethod=Cursor
05:17:56.222 INFO - Initializing Hibernate
05:17:59.217 INFO - Load project referentials...
05:18:19.232 INFO - Load project referentials done: 20015 ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 34.757s
Final Memory: 21M/291M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to request: /batch/project?key=CAFE-CLIENT&preview=false
ERROR: Caused by: Read timed out
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
05:18:19.232 INFO - Load project referentials done: 20015 ms
When "Load project referentials done" value is larger than 20,000 ms,
Always "Read timed out" occurs.
Loading of project referentials is not expected to take more than a few seconds. It is very likely you have a performance issue on your SQ server (or with your DB). Here are some criteria that may increase duration of this web service:
you have installed a lot of language plugins or you have enabled a lot of rules in quality profiles
your project is a multi-module project with a lot of modules
Compare for example with:
http://nemo.sonarqube.org/batch/project?key=org.codehaus.sonar%3Asonar&preview=true
that returns more than 1000 rules and 33 modules. It takes less than 2 seconds to return data.
EDIT: it seems there was some SQL issues depending on your DB vendor. See http://jira.codehaus.org/browse/SONAR-5849 and http://jira.codehaus.org/browse/SONAR-6063. Should be fixed in upcoming 4.5.3

Unable to hookup Jprofiler on a WAS JVM

We are unable to instrument the jprofiler on the Webshpere App server JVM.
We are getting errors like below
java.lang.UnsatisfiedLinkError: com/jprofiler/agent/Agent.registerAnnotationMethods([[Ljava/lang/String;[I[II)V
at com.jprofiler.agent.Agent.registerInterceptions(ejt:579)
at com.jprofiler.agent.Agent.registerAllAnnotationMethods(ejt:513)
at com.jprofiler.agent.Agent.<clinit>(ejt:149)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
when i start the JVM, the JVM was able to communicate to the jprofiler client. and i was able to see some samples before the JVM starts. and after a few sec the JVM crashes and it is in stopped status.
Environment details
App server - WAS 6.1
java version "1.5.0_55"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_55-b10)
Java HotSpot(TM) Server VM (build 1.5.0_55-b10, mixed mode)
i see this in the log
JProfiler> Protocol version 37
JProfiler> Using JVMTI
JProfiler> Thread status info workaround enabled.
JProfiler> 32-bit library
JProfiler> Listening on port: 8849.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
java.lang.UnsatisfiedLinkError: com/jprofiler/agent/Agent.registerAnnotationMeth
ods([[Ljava/lang/String;[I[II)V
at com.jprofiler.agent.Agent.registerInterceptions(ejt:579)
at com.jprofiler.agent.Agent.registerAllAnnotationMethods(ejt:513)
at com.jprofiler.agent.Agent.<clinit>(ejt:149)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
JProfiler> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
and the JVM is in stopped status. If i remove the argument from "Generic JVM arguments" i'm able to start the JVM without jprofiler.
This happens when you have an agent.jar from a different
JProfiler version in your bootclasspath or classpath. Please check your system for
any different JProfiler version to avoid this.

Resources