Issue in jmeter with adopopenjdk 8 - jmeter

I am trying to execute one jar having few parameter as well in apache-jmeter-5.1.1. I am running Thread Plan -> OS Process Sampler. But getting below error always :
Response message: Exception occurred whilst executing system call: java.io.IOException: Cannot run program "java -jar /User/wasim/Desktop/My_Jar/RunTask.jar " (in directory "/User/wasim/Desktop/jMeter/apache-jmeter-5.1.1/bin"): error=2, No such file or directory
I tried to run jar directly and with full path.
I have passed java_home as parameter as well.
This is the request in jmeter interface :
Working Directory: /User/wasim/Desktop/jMeter/apache-jmeter-5.1.1/bin
Environment: {JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home}
Executing: java -jar /User/wasim/Desktop/My_Jar/RunTask.jar update 20180401

i solved the issue after doing below changes :
In command section put only "java"
then put all your command after java into Command parameter section like below :
-jar
RunTask.jar
update
20180401
Make sure all remaining command should be in separate line without any space in the end.
Happy learning.

Related

How do I bypass this incompatible gradle init script?

I'm running an installer built with install4j that uses an embedded version 2.3 of gradle which is pretty much outdated. The service account that runs the installer on Windows Server has a gradle init script in its home directory that uses functions that are not supported in Gradle 2.3. The error is :
FAILURE: Build failed with an exception.
* Where
Initialization script 'C:\Users\***\.gradle\init.gradle' line: 6
* What went wrong
Could not find method pluginManagement() for arguments
The installer doesn't need this gradle init script. However, it can't be deleted as it is required to build other projects.
I tried to bypass this gradle init script by running the installer as SYSTEM user with psexec using the following command :
psexec -s installer.exe
It works fine in a cmd prompt when I have a remote desktop session opened with the service account, but it doesn't run inside Jenkins. The error is :
The handle is invalid
I read in this answer that it could be due to some security restriction on Windows:
PSEXEC - "The Handle is invalid" When running the command as System User
Also it doesn't seem to be possible to bypass a gradle init script:
How to skip Initialization Scripts when executing gradle build

Jenkins container: Groovy script fails with jbdc exception

I have a job in Jenkins (Jenkins is running from a container) which uses a groovy script with the line:
import groovy.sql.Sql;
def driver = "oracle.jdbc.pool.OracleDataSource"
when running it, I'm getting the exception:
java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource
I know what is the root cause, but don't know how to fix it.
The root cause is that all our Jenkins containers are installed without Oracle, and ojdbc7.jar can be found in the java classpath under Oracle:
classpath /oravl01/oracle/12.1.0.1/jdbc/lib/ojdbc7.jar
in regular Jenkins server, it runs without any issues.
any idea how to fix it?
I did 2 things:
1. copied the file ojdbc7.jar to the path mentioned in java.ext.dirs (in illinXXX:XXX/systemInfo)
2. Ran the docker run command with --env classpath=[path of ojdbc7-12.1.0.2.jar]

Cassandra - "The system cannot find the file specified"

I have installed Cassandra on Windows 10, and now when I try to run it using "cassandra", I get the following error:
Any ideas?
After looking at the file it seems, powershell script cassandra-env.ps1 executes following function:
if (Test-Path Env:\JAVA_HOME)
{
$env:JAVA_BIN = "$env:JAVA_HOME\bin\java.exe"
}
elseif (Get-Command "java.exe")
{
$env:JAVA_BIN = "java.exe"
}
else
{
echo "ERROR! No JAVA_HOME set and could not find java.exe in the path."
exit
}
I'm not an expert on Cassandra stuff, but if I were you I would run this script and make sure $env:JAVA_BIN is set correctly, and from there I would follow its trail and check
ParseJVMInfo function in the conf\cassandra-env.ps1 file which is throwing error in your setup.
Update:
Check JAVA_HOME environment variable and see if it is setup such that [JAVA_HOME]\bin\java.exe exists.
Don't install Cassandra into directory where the name has space in it. Startup script for Windows has problems with such names.
Update after an additional investigation:
Looking more precisely into the code, it looks like it can't start Java with the given command-line switches: -d64 -version - either Java executable isn't in the PATH, or the -d64 switch isn't supported for your version of Java - for example, if you installed 32-bit version of Java. Please try to run the java -d64 -version from the command line to check that it works
In my case I updated my java version and added latest version in system environment and run this command as administrator in cassandra specieid path(C:\Program Files\apache-cassandra-3.11.6\bin).
cassandra.bat -f
its running perfactly!!
and also make sure You must allow the execution of PowerShell Scripts. for this check out this one
https://www.howtogeek.com/106273/how-to-allow-the-execution-of-powershell-scripts-on-windows-7/
actually , its not about the path ...
its about giving the proper access / privilege to the path you are trying to access , that's something have to do with UAC setting on windows , try minimize it and make sure you have the right access through clicking on folder properties and giving permission to your user or everyone to access this path read / change or full control .
so u don't have to uninstall anything :)

"Unable to access jarfile jenkins.war" getting this error while run the cmd "java -jar jenkins.war" in OS- windows 7

"Unable to access jarfile jenkins.war" getting this error while run the cmd "java -jar jenkins.war" in OS- windows 7
How can I solve?
i did installation as per what showed in youtube
Command java -jar jenkins.war in Win7 command line require administrator permission.
Right click on the cmd icon and choose the Run as administrator option.
It worked for Windows 8 too.
I also faced this issue after I updated the jenkins version.
The error message was found in <jenkins_dir>/jenkins.error.log
Resolved Step:
Download your jenkins.war at https://updates.jenkins-ci.org/download/war/
Put jenkins.war to your jenkins work directory
Go Jenkins Service and restart it
Enjoy it!
Ref: Cannot start Jenkins
Make sure you are executing that command in the folder where jenkins.war is actually installed.
Also check if the file is readable, and not preempted by another process (you can check that with Process Explorer)
Finally, double-check the size of jenkins.war, to see if the download was complete, and the file is not corrupted (incomplete or small size): see the list of jenkins.war released.
Open Command Prompt as Administrator in Windows . Go to the directory where Jenkins is installed. and stop the Jenkins service first, using jenkins.exe stop
type the command to change the port using, java -jar jenkins.war
You will be able to access the .war file of Jenkins.
I had the same issue. What worked for me was adding .jar to the file name, like
java -jar jenkins.war.jar
in case that you face an error that says, "Failed to listen on port 8080"
There is an answer here that worked for me, by pasting the following on cmd,
java -jar jenkins.war.jar --ajp13Port=-1 --httpPort=9090
do not create a folder for jenkins.war file
store it right inside downloads direction
then go to your terminal go to downloads direction not to jenkins.war file direction
then type java -jar jenkins.war
it will work

CreateProcess() failed when specifying service restart command in puppet

Running puppet on 64bit windows 2008 i have a service which looks like the following:
service{'Tomcat7':
ensure => running,
restart => 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file C:\tomcat7\bin\RestartService.ps1',
}
Running the command after restart in command prompt works
However:
When puppet triggers the refresh i get the following:
Debug: Executing 'c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file c:\tomcat7\bin\RestartService.ps1'
Error: /Stage[main]/Dep7transcription/Service[Tomcat7]: Failed to call refresh: CreateProcess() failed: The system cannot find the file specified.
Error: /Stage[main]/Dep7transcription/Service[Tomcat7]: CreateProcess() failed: The system cannot find the file specified.
Any help would be appreciated
Try changing the backslahses in forward slashes. Ruby internally uses the forward slash as path separator on all platforms.
If this comes up again this is related to inconsistent treatment of whitespace - arguments cannot be passed to the service restart command as of the puppet version up to date at time of asking

Resources