Error in sonar startup, Unable to start JVM: No such file or directory (2) - sonarqube

I am facing strange issue with sonarqube 5.0.1 , one one of the machine it is not starting. Here is the error log - sonar.log -
--> Wrapper Started as Daemon
Launching a JVM...
Unable to start JVM: No such file or directory (2)
JVM exited while loading the application.
JVM Restarts disabled. Shutting down.
<-- Wrapper Stopped
Machine is x86_64 GNU/Linux - Centos 5.1.
this box has java installed -
$java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
The same sonarqube package works on another machine.
Any idea what could be the issue here?
Thanks.

Issue was in the wrapper.conf where the java wrapper command was not getting resolved. It worked if I give the absolute path - ‘wrapper.java.command=/path/to/my/jdk/bin/java’
This could be an issue with an environment on a host.. not sure.
Few things that helped me in troubleshooting this -
log level changed to DEBUG in wrapper.conf
comments given in the wrapper.conf!
Thanks all for chiming in! Appreciate your inputs.

1.Just close all running jvm from task manager
2. Change the port of the sonar runner from the properties

I had the same symptoms (wrapper starts then immediately stops).
I tried these steps and finally succeeded (on a windows 10 pc):
1) in wrapper.conf, specified the java command:
wrapper.java.command=C:\Program Files\Java\jdk1.7...\bin\java.exe
That did not help.
2) Finally this fixed the problem. In the windows Services, open the Sonar service and then open Log On tab.
Changed the Log On to myself as follows:

I was facing the same issue on sonar startup. After reading this post , i modified the JDK path in below file and it works.
Modify the JDK path in wrapper.conf
wrapper.java.command=%JAVA_HOME%/bin/java

Install jdk 11
sudo yum install java-11-openjdk -y
sudo alternatives --config java
Select the JDK 11 version
Set the JDK 11 version in wrapper.conf
vi /opt/sonar/conf/wrapper.conf
wrapper.java.command=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-3.el8_5.x86_64/bin/java

Could you verify the Java version on the machine starting?
Java 6 is no more supported http://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Prerequisite but from your error message, I don't know if this is the problem you meet.

Solution 1
Set java path globally
Solution 2
Go to sonarqube-{version}/conf directory
Edit wrapper.conf file
Replace wrapper.java.command=java with wrapper.java.command= {path-to-your-java-bin-directory}/java
eg: wrapper.java.command=/usr/java/bin/java

Try using a relative path, if your Sonar Folder is located in the same root folder as your jdk. For me my sonar and jdk are both under "Program Files", which has restrictive permission, hence the error.
E.g:
wrapper.java.command=../../../Java/jdk-11.0.4/bin/java

Related

Spark does't run in Windows anymore

I have Windows 10 and I followed this guide to install Spark and make it work on my OS, as long as using Jupyter Notebook tool. I used this command to instantiate the master and import the packages I needed for my job:
pyspark --packages graphframes:graphframes:0.8.1-spark3.0-s_2.12 --master local[2]
However, later, I figured out that any worker wasn't instantiated according to the aforementioned guide and my tasks were really slow. Therefore, taking inspiration from this, since I could not find any other way to connect workers to the Cluster manager due to the fact it was run by Docker, I tried to set up everything manually with the following commands:
bin\spark-class org.apache.spark.deploy.master.Master
The master was correctly instantiated, so I continued by the next command:
bin\spark-class org.apache.spark.deploy.worker.Worker spark://<master_ip>:<port> --host <IP_ADDR>
Which returned me the following error:
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
21/04/01 14:14:21 INFO Master: Started daemon with process name: 8168#DESKTOP-A7EPMQG
21/04/01 14:14:21 ERROR SparkUncaughtExceptionHandler: Uncaught exception in thread Thread[main,5,main]
java.lang.ExceptionInInitializerError
at org.apache.spark.unsafe.array.ByteArrayMethods.<clinit>(ByteArrayMethods.java:54)
at org.apache.spark.internal.config.package$.<init>(package.scala:1006)
at org.apache.spark.internal.config.package$.<clinit>(package.scala)
at org.apache.spark.deploy.master.MasterArguments.<init>(MasterArguments.scala:57)
at org.apache.spark.deploy.master.Master$.main(Master.scala:1123)
at org.apache.spark.deploy.master.Master.main(Master.scala)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to unnamed module #60015ef5
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:188)
at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:181)
at org.apache.spark.unsafe.Platform.<clinit>(Platform.java:56)
... 6 more
From that moment on, none of the commands I used to run before were working anymore, and they returned the message you can see. I guess I messed up some Java stuff, but I do not understand what and where, honestly.
My java version is:
java version "16" 2021-03-16
Java(TM) SE Runtime Environment (build 16+36-2231)
Java HotSpot(TM) 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)
I got the same error just now, the issue seems with Java version.
I installed java, python, spark etc. All latest versions... !
Followed steps mentioned in the below link..
https://phoenixnap.com/kb/install-spark-on-windows-10
Got the same error as you.. !
Downloaded Java SE 8 version from Oracle site..
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Downloaded jdk-8u281-windows-x64.exe
Reset the JAVA_HOME.
Started spark-shell - it opened perfectly without any issues.
FYI: I don't have neither java or spark experience, if anyone feels something is wrong please correct me. Just that it worked for me, so providing the same solution here.. :)
Thanks,
Karun
I got a similar error on MacOS. The problem was with Java (I was using JDK 17), had to downgrade or use a different version.
Ended up using this:
https://adoptium.net/releases.html?variant=openjdk11
Download and install. Might have to remove your JDK17 version.
Easiest solution :
Latest version of Java (JDK) is not supported by Spark.
Please try installing JDK version 8. This will solve the error.

Jmeter perfmon :EXCEPTION_ACCESS_VIOLATION

I am trying to run a performance test of my server using jmeter perfmon plugin. But I am getting an error as in the following image. I have searched a lot for a solution but couldn't find an answer. I tried setting JVM arguments but it didn't work. Link to error image.How can I get it worked?
INFO 2019-12-30 14:11:25.114 [kg.apc.p] (): Binding UDP to 4444
INFO 2019-12-30 14:11:25.155 [kg.apc.p] (): Binding TCP to 4444
INFO 2019-12-30 14:11:25.161 [kg.apc.p] (): JP#GC Agent v2.2.3 started
INFO 2019-12-30 14:11:37.974 [kg.apc.p] (): Accepting new TCP connection
INFO 2019-12-30 14:11:37.978 [kg.apc.p] (): Yep, we received the 'test' command
INFO 2019-12-30 14:11:37.979 [kg.apc.p] (): Starting measures: memory: cpu:
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000010014ed4, pid=12236, tid=6844
JRE version: Java(TM) SE Runtime Environment (11.0.4+10) (build 11.0.4+10-LTS)
Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0.4+10-LTS, mixed mode, tiered, compressed oops, g1
gc, windows-amd64)
Problematic frame:
C [sigar-amd64-winnt.dll+0x14ed4]
No core dump will be written. Minidumps are not enabled by default on client versions of Windows
An error report file with more information is saved as:
E:\\hs_err_pid12236.log
If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.
I downloaded another sigar 1.6.4 jar (1.6.4.129 (17.1.2016) release) from below link and replaced sigar jar with this in specific tool lib path (ServerAgent-2.2.3\lib).., then it worked for me.
https://javalibs.com/artifact/org.hyperic/sigar
Looking into JVM crashes occassionally with access violation when using Sigar.getProcMem with disabled Windows performance counters #77 issue it might be the case that Windows don't have performance counters enabled hence Sigar fails to query the CPU status from Windows PerfMon
Check if CPU (and other stats) are exposed in PerfMon
Try running Powershell and Server Agent as Administrator
Try using cmd.exe interpreter instead of powershell
Try running ServerAgent.bat --sysinfo to see if there are any errors there
Inspect e:\hs_err_pid12236.log file for any clues
If nothing helps be aware that you can use SSHMon plugin for server monitoring, it doesn't require server-side software installation
I faced the same issue. Error code as follows:
"JRE version: OpenJDK Runtime Environment (11.0+28) (build 11+28)
Java VM: OpenJDK 64-Bit Server VM (11+28, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
Problematic frame:
C [sigar-amd64-winnt.dll+0x14ed4]"
I downgraded the JDK and JRE to the version : 8u241
Go to the Oracle download page here and search for the below JRE & JDK and install it in the Windows server and then start the serverAgent.bat
jdk-8u241-windows-x64.exe
jre-8u241-windows-x64.exe
This should fix the issue 100% sure. It worked for me.
Follow the below step.
Disable firewall setting
if still having same issue
Download the below .dll file and replace it(lib folder)
https://github.com/cnstar9988/sigar/raw/master/sigar-amd64-winnt.dll
It was solved at my end using the below steps:
Download ‘jre 1.8’ from this link https://java.com/en/download/win10.jsp
Once the jre is installed, copy the folder named ‘jre1.8.0_261’.
Image
Visit the ServerAgent folder that was downloaded >> Paste the ‘jre1.8.0_261’ folder inside the ‘ServerAgent-2.2.1’ folder.
Open ‘startAgent.bat’ file in Notepad ++ >>Initially it would look like this
Image
Replace text ‘java’ with the path of java.exe that is within the jre folder placed inside the ServerAgent-2.2.1 folder
Open command prompt in the ServerAgent-2.2.1 folder path and enter ‘startAgent.bat’ file to run the file
Execute JMeter script and now error should not happen.

Changing the SDK in WebSphere Application Server 8.5

When I try to start the the deployment manager in WebSphere Application Server I'm getting the following error:
00000001 SDKUtils
A ADML0004E: An exception occurred when attempting to expand variable $(JAVA_HOME) com.ibm.wsspi.runtime.variable.
UndefinedVariableException: Undefined variable JAVA_HOME
at com.ibm.ws.runtime.component.VariableMapImpl.expand(VariableMapImpl.j
First of all you cannot set third party Java SDK for traditional WebSphere Application Server. For WAS 8.5.5.x you can only select from IBM Java 6 and IBM Java 7 which must be downloaded from IBM and installed via Installation Manager. So don't play with JAVA_HOME variable manually.
Once you install Java 7 for WAS, you can use managesdk command line tool to switch Java for given profile and server.
See also:
Java 7.1 in IBM Websphere
managesdk command
since we can not start the deployment manger or default server, there is a way to solve this problem that is add the JAVA_HOME into varibles.xml file which is under server folder. path : Installserver/profile/config/node/cell/server
Please give some more information like OS, windows, or linux, or what.
If I understand correctly you'll use the jdk of the WAS installation elsewhere?
Under Windows set JAVA_HOME accordingly within the System environment properties. logout / login after this may be a good idea.
Under linux use: export JAVA_HOME=/opt/ibm/pathtoWAS/java
I would do this within .profile and maybe it's helpful to set the PATH to the jdk too!

Apache Derby (JavaDB) fails silently at start from Windows command line

I'm trying to start database with:
C:\Program Files\Java\jdk1.8.0_60\db\bin>NetworkServerControl start
No error messages, prompt returns immediately.
And derby.log contains only old messages. As nothing happened.
WTF? How can I debug this?
UPD: I have added tracing from https://blogs.oracle.com/wittyman/entry/debug_tracing_in_apache_derby, but derby.log is still empty.
I'm using java.exe from the same JDK (1.8.0 x64)
The solution was to switch to x86 Java version. I've tried several x64 JDKs from 6 to 8, all had failed silently. I think it's Derby bug.
Try running
java -Dderby.debug.true=AssertFailureTrace -jar %DERBY_HOME%\lib\derby.jar server start
It may show some details.

How to install Tomcat 7 as a Windows service using command line install

I need to install Tomcat 7 as a Windows service and to start the service manually.
Referring to How to install Tomcat as a Windows service, I believe I would need to specify the following on the command line:
tomcat7 //IS//Tomcat7 --DisplayName="Apache Tomcat 7" --Install="C:\Tomcat7\bin\tomcat7.exe
Do I also need to specify all or some of the following on the command line like in the example? If only some, please specify which ones. If anything in the example is incorrect, please specify.
--Jvm=auto
--StartMode=jvm
--StopMode=jvm
--StartClass=org.apache.catalina.startup.Bootstrap
--StartParams=start
--StopClass=org.apache.catalina.startup.Bootstrap
--StopParams=stop
What I need for sure is to specify the following because I need to tell Tomcat to use a specific java home and not the java home set by the environment variable JAVA_HOME on the server where this will be installed.
--JavaHome="C:\Program Files\Java\jdk1.7.0_51
The reason: the server already has a different version of Tomcat (5.5) and it uses an older version of the JDK (1.5). I must not change JAVA_HOME on the server. I simply need to ensure Tomcat 7 uses JDK 1.7 and I have tried this line:
C:\tomcat7\bin>tomcat7 //IS//Tomcat7 --DisplayName="Apache Tomcat 7" --Install="C:\Tomcat7\bin\tomcat7.exe" --JavaHome="C:\Program Files\Java\jdk1.7.0_51"
When I attempt to Start the service, the following error message is displayed:
Windows could not start the Apache Tomcat 7 on Local Computer. For
more information, review the System Event Log. If this is a
non-Microsoft service, contact the service vendor, and refer to
service-specific error code 1.
I had a look at the System Event Viewer and it provides the following information:
The Apache Tomcat 7 service terminated with service-specific error Incorrect function..
I need to figure out these steps because I then need to provide the support team with the information to install this service on the production server. So any help would be greatly appreciated!
Use Chocolatey from Powershell command line:
first install Chocolatey
PS:\> iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
To install Tomcat
PS:\> choco install tomcat
To upgrade
PS:\> choco upgrade tomcat
Seems like a mismatch in your java JVM and tomcat version.
The tomcat7.exe wrapper program actually
"runs" the JVM, it must match the type of JVM that it runs, in terms
of 32bit/64bit version. If you try to start a 64-bit JVM with a 32-bit
tomcat7.exe, it won't work, and vice-versa.
Reference
This is because of shortage in physical RAM.
Check the Minimum System Requirements on Tomcat docs and try to close unnecessary programs if possible.
Use Chocolatey from Powershell command line:
PS> iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
To install Tomcat:
PS> choco install tomcat
To upgrade:
PS> choco upgrade tomcat

Resources