Unable to locate jenkins.xml file within executable directory or any parents - windows

I've installed jenkins on windows, and I wanted to use jenkins command to start and stop the program from anywhere in the system.
It turns out that after configuring jenkins and creating the environment variable I get the error below everytime I execute "jenkins start" from outside C:\Program Files (x86)\Jenkins.
Is there any configuration missing?
ERROR
System.IO.FileNotFoundException: Unable to locate jenkins.xml file within executable directory or any parents
at winsw.ServiceDescriptor..ctor()
at winsw.WrapperService.Run(String[] _args, ServiceDescriptor descriptor)
at winsw.WrapperService.Main(String[] args)
SYSTEM ENVIRONMENT VARIABLES
JENKINS_HOME:
C:\Program Files (x86)\jenkins
Path:
%JENKINS_HOME%

You need to run your jenkins install jenkins.xml at the place where is your jenkins.xml
1 rename winsw.exe to jenkins.exe
2 cd c:/...where is your jenkins.exe
3 run jenkins.exe install jenkins.xml (both files must be in the same directory)

In Windows 10, the path of the configuration file (config.xml) is:
C:\ProgramData\Jenkins.jenkins
The Folder ProgramData is hidden, so go to the address bar and type or use the CLI.

Solution: Save your jenkins-agent file as xml format. not just jenkins-agent.xml
we can use notepad++ to save the xml type. similarly remove .exe at end of jenkins-agent.exe
Hope its useful.... cheers !!

Related

CLI Go Config.toml file location

I am attempting to test a Golang application hauser locally on via -bash CLI before deploying on a VM.
Per the documentation, I compiled locally and copied the example-config.toml file. I then mapped to the GOPATH and opened hauser.exe to open config.toml file. However, when I execute, it returns open config.toml: no such file or directory
C02Z30ANLVDV:~ pmcgin2$ $GOPATH/bin/hauser -c Documents/go/bin/config.toml
2020/08/14 18:05:23 Cannot find folder , make sure it exists
C02Z30ANLVDV:~ pmcgin2$ open Documents/go/bin/config.toml
No application knows how to open /Users/pmcgin2/Documents/go/bin/config.toml.
Is there an alternative command I can execute to override the default config.toml location for an application like this?
There are two possibilities to solve your issue:
give an absolute path as argument:
$GOPATH/bin/hauser -c /Users/pmcgin2/Documents/go/bin/config.toml
give a relative path from the binary location:
$GOPATH/bin/hauser -c config.toml
Generally, it is easier to use absolute paths.

AWS Codedeploy access a file within BeforeInstall script

I'm bundling a file to be accessed by BeforeInstall shell script file. But shell script file cannot locate the file. I tried bundling in the same folder as script file. Still not working. It gives No such file or directory
bundle
scripts
beforeInstall.sh
file.properties
May I know if this is possible...
The files are not placed in the locations you have specified yet during the BeforeInstall step. At that point the zip has only been downloaded to a default location, so the file path in your script probably doesn't exist yet.
What do you want your script to do? Would running it during the AfterInstall step work?

system cannot find path specified / file specified grafana

I've been trying to build grafana from its source code on windows by following the instructions here
I am stuck and am failing to set the GOPATH path properly.
I set it to the default go directory in C:\myname but whenever I try to change to that directory using the command "cd $GOPATH/src/github.com/grafana/grafana" it says the system cannot find the specified path.
And even if I put the path manually and in the directory try to run "go run build.go setup" the system cannot find the file specified.
If someone could help me that'd be great!
Try to create a new empty folder:
mkdir C:\myFolder
cd C:\myFolder
set GOPATH=C:\myFolder
go get github.com/grafana/grafana
That should create a src\github.com\grafana\grafana folder, with the sources inside.

Error installing WebLogic server using Console mode in windows 8.1

Hi i have been trying to install the server weblogic of oracle on windows 8.1 but I obtain the follow when I run the configure.cmd file:
ERROR: You must set MW_HOME and it must point to a directory where an
installation of WebLogic exists. Ensure you point this variable to the
extract location of the zip distribution.
How do I correct this error?
There's a readme file linked from the product download page http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html although your experience would suggest that defining MW_HOME isn't optional! ...
1. Extract the contents of the zip to a directory (eg: /home/myhome/mywls)
This will create a base directory named wls12130 under /home/myhome/mywls
MW_HOME will be the entire directory including the base directory.
(eg: MW_HOME will be /home/myhome/mywls/wls12130).
2. Setup JAVA_HOME and optionally, MW_HOME variables in the current shell as required
for the target platform.
Windows
> set JAVA_HOME=C:\home\myhome\myjavahome
> set MW_HOME=C:\home\myhome\mywls\wls12130
3. Run the installation configuration script in the MW_HOME directory.
This step is required to be run only once. If you move the installation to
another location/machine, you need to rerun this step.
Windows
> configure.cmd
Environment variables are not set properly.
1.- Create product directory
mkdir E:\weblogic\wls << I'm sure you did it and Weblogic binaries are already installed.
2.- set environment variables properly
set JAVA_HOME=_path_to_\jdk1.7.0
set MW_HOME=E:\weblogic\wls
(change above settings according to your installation)
3.- Run configure.cmd

Correct InstallUtil Path To File Syntax?

I'm trying to install a Windows Service using a batch file, let's call it "installservice.bat". Inside the file I have the following commands:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -i ".\MyService.exe"
pause
When I excute the batch file (running as administrator on Vista) I get this:
Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Win
dows\system32\MyService.exe' or one of its dependencies. The system cannot f
ind the file specified..
The actual service is located at C:\Services\MyService.exe. What should the ".\MyService.exe" part be for it to function properly?
Just in case someone else comes here for this error... when you run InstallUtil.exe, if the path to your service contains spaces, surround it with quotes. Yes this is obvious, but the error it gives you if you don't is not.
wrong...
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe C:\Users\joeblow\Documents\Visual Studio 2010\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe
right...
C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe "C:\Users\joeblow\Documents\Visual Studio 2010\Projects\WindowsService1\WindowsService1\bin\Debug\WindowsService1.exe"
Why not just feed InstallUtil the full path?
copy the bat file MyService.exe folder and execute, you wont get any error.

Resources