Relative path is not working in soring-boot application.yml - spring-boot

#I am working on windows machine. I have file under test folder and accessing it in application.yml file but it's not working.
FYI: Absolute path for the same is working.
application.yml
jwk-path: ..\test\resources\xyz.json
error:
Caused by: java.io.FileNotFoundException: ..\test\resources\xyz.json (The system cannot find the path specified)

Normally when you run tests from IDE, it will try to load from the "root project". Can you try src/test/resources/xyz.json instead?

Related

TeamCity doesn't see geckodriver path

I got my set of robot framework tests, that works correctly on my localhost.
The geckodriver is located in project folder as
Project_name/webdrivers/geckodriver.exe
Then I have this keyword set as Test Setup:
Set Environment Variable webdriver.gecko.driver Project_name/webdrivers/geckodriver.exe
This however doesn't work when run tests via Team City, and I got this message:
WebDriverException: Message: 'geckodriver' executable needs to be in
PATH
This should be easily solved by a google search for "add program to path"
export PATH=$PATH:/path/to/geckodriver
You can expand the path for a build agent by adding a build parameter named "env.PATH" with the following value on Mac OS and Linux.
%env.PATH%:/my/path
On Windows use ";" instead of ":" as the path delimiter.
You can also add the following to conf/buildAgent.properties in your build agent installation directory.
env.PATH=%env.PATH%:/my/path

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

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 !!

How to give the uri in windows for Spring Cloud Config with Local Git repo?

I am trying to set up Spring Cloud Config Server. How to give the spring.cloud.config.server.git.uri in application.properties for Windows?
The uri is this one
D:\MicroservicesProject\git-localconfig-repo\test-service.properties
I tried this
spring.cloud.config.server.git.uri=D:\\MicroservicesProject\\git-localconfig-repo\\limits-service.properties
But I am getting this error
Caused by: org.eclipse.jgit.errors.TransportException: D:\MicroservicesProject\git-localconfig-repo\limits-service.properties: not a bundle
Try updating config line as follows:
spring.cloud.config.server.git.uri=file:///C:/Users/win10/Desktop/git-localconfig-repo/
I found the solution by making the path to the directory without specifying the name of the file.
D:\\MicroservicesProject\\git-localconfig-repo

How to connect eclipse IDE to apache Ignite?

I have written Ignite hello world program in Eclipse and want to connect it to localhost(127.0.0.1). But it is giving me error for example "ignite.xml file path is invalid"
I am starting ignition as follows,
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {}
But I got error like:
Spring XML configuration path is invalid: examples/config/example-ignite.xml.
How do I fix it?
You have the following options:
Provide the absolute file path.
Set IGNITE_HOME system property or environment variable, put the file in this folder and provide the path relative to the home.
Add the configuration file on classpath under META-INF and provide the path relative to it.
The last option is usually the most convenient for the applications with an embedded Ignite node.

Robot framework doesn't see environment variable selenium_jar

i'm using mac
while using a pybot test.txt command i get an error msg: No executable path given, please add one to Environment Variable 'SELENIUM_SERVER_JAR'
but
i downloaded this jar from selenium site and did such things, nothing worked out:
added this folder path to /etc/paths;
added variable to etc/launchd.conf;
setenv SELENIUM_SERVER_JAR /Users/User/Downloads/SeleniumServer/selenium-server-standalone.jar
export PATH=$PATH:/Users/User/Downloads/SeleniumServer/;
after all of this i tried i run pybot test.txt and receiving the same error message.
Please, help, i just don't know how to configure robot framework to work with safari.
Based on the response to comments, it appears you set SELENIUM_JAR_FILE to the wrong value. It needs to be set to the full path of the jar file, not just the folder that contains the jar file.

Resources