im not sure if its a jira problem or me not doing it properly, the latter more likely!
I have a file properties file called rootcause it is in a directory sturcture net/mycompany/rootcauseanalysis
in my jira atlassian-plugin.xml file I have
<resource type="i18n" name="i18n" location="net.mycompany.rootcauseanalysis.rootcause"/>
in my properties file I have properties defined like
rootcause.name=My plugin
in my java file which extends JiraWebActionSupport i use
String str=getText("rootcause.name");
when I print this out I get rootcause.name instead of the My plugin value I was expecting to get.
I have tried troubleshooting this problem by changing directory structure, file names, property names, using " and ' running out of ideas now!
done it :D
This is a hack I found on the forums solved my problem
http://forums.atlassian.com/thread.jspa?messageID=257351842�
Related
I am using IntelliJ Idea and trying to read a json file from the resources folder in the project structure. I read the json file and return the contents using jackson.
return mapper.readValue(File("src/main/resources/file.json"), Map::class.java)
As soon i build the project and make a jar it throws me an error it cannot find the file. I looked here a bit and found that i should use ClassLoader to read files from the resources folder. So i do this now -
mapper.readValue(File( ClassLoader.getSystemClassLoader().getResource("src/main/resources/file.json").toURI()), Map::class.java)
Now I get a NullPointerException. I am a bit lost now. Any help is deeply appreciated.
Assuming your build follows the default convention, whatever under src/main/resource will be available on the root of the classpath, so you just need to change the code to:
mapper.readValue(ClassLoader.getSystemClassLoader().getResourceAsStream("file.json"), Map::class.java)
I've got a working simple jmeter jmx with the plugin, reading the docs I've found how to override .properties files but right now my problem is that I have a folder with .csv files input data that I want to use in my test. The folder with the csv files is specified in an user.properties file as inputDataFolder=path/to/folder and referenced in the jmx like ${inputDataFolder}file.csv. It works really fine without maven but when I run it with the verify goal it doesn't works and throws:
Error in NonGUIDriver org.apache.jorphan.util.JMeterStopTestException: ModuleController:Register Fixed Customer has no selected Controller (did you rename some element in the path to target controller?), test was shutdown as a consequence
The error suggests me a mistake defining the path to the csv folder, but I don't know how to do it correctly with the plugin. Any help is really appreciated.
PS: This is the structure that I have under src/test/jmeter
jmeter/
├── foldercsv/
├── test.jmx
├── user.properties
I got myself the answer. I digged into many post and I found that indeed it was a path issue, got it right reading this:
https://groups.google.com/forum/#!topic/maven-jmeter-plugin-users/8pTwRmMCi9I
https://bz.apache.org/bugzilla/show_bug.cgi?id=59169
Thanks!.
I have maven project and configuration as:
src/test/jmeter/myFile.jmx
src/test/resources/testDataFiles/csv1.csv, csv2.csv etc
to specify csv file path in CSV Data Set Config I had to use
../../../src/test/resources/testDataFiles/csv1.csv
I tried
../resources/testDataFiles/csv1.csv -- didn't work
../../resources/testDataFiles/csv1.csv -- didn't work
../../test/resources/testDataFiles/csv1.csv -- didn't work
The path worked for me is:
../../../src/test/resources/testDataFiles/csv1.csv
Note:
When I run jmeter script in JMeter UI it works fine with csv file path: ../resources/testDataFiles/csv1.csv but surprisingly this didn't work while executing the same script with Maven command.
I was trying to have log4j roll log files on daily basis with a maxBackUpIndex.
This as per many blogs and documentation is not available.
So from some blog, I figured out that we can update the DailyRollingFileAppender class file itself to have maxBackupIndex property and its implementation.
I was able to add the new implementation and replace the original DailyRollingFileAppender file with new updated one.
But the updated log4j.jar does not reflect my change, it says "log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender"
Please suggest, if anyone has encountered something similar to this.
Figured it out, the class file was not getting complied - copied in the jar properly.
Created the jar from jar - cvf command and it worked fine.
I am trying to install Java jre 1.8u31 from the command line. I am using system level install configuration by using the deployment.config file and deployment.properties.
I have tried the following:
deployment.system.config=file\:C\:/WINDOWS/Sun/Java/Deployment/deployment.properties
deployment.system.config.mandatory=true
I have also tried the following
deployment.system.config=file:///C:/Windows/Sun/Java/Deployment/deployment.properties
deployment.system.config.mandatory=true
I have swapped the entries around in hopes of getting a better error describing what I am doing wrong. I have also made the first line blank in the deployment.config file. I have googled and tried all examples I could find online. In all the cases, I am being presented a dialog box with an error that states the deployment.config file's line 1 is malformed.
Any suggestions would be greatly appreciated.
Russ
I have tried all of these formats:
The path you have given should be in below format
deployment.system.config=file:/C:/Windows/Sun/Java/Deployment/deployment.properties
I got the install to work correctly. What I did was put the deployment.config file in the C:\Windows\Sun\Java\Deployment directory. The property in the file was setup as so:
deployment.system.config=file\:C\:\\Sup\\Java\\UPGRADE\\Deployment\\deployment.properties
The exceptionlist file was in the same directory as the deployment.properties file.
This is a very simple question for many of you reading this, but it's quite new for me.
Here is a screenshot for my eclipse
When i run this program i get java.io.FileNotFoundException: queries.xml (The system cannot find the file specified) i tried ../../../queries.xml but that is also not working. I really don't understand when to use ../ because it means go 1 step back in dir, and in some cases it works, can anyone explain this? Also how can I refer to queries.xml here. Thanks
Note: I might even use this code on a linux box
I assume it is compiling your code into a build or classes folder, and running it from there...
Have you tried the traditional Java way for doing this:
def query = new XmlSlurper().parse( GroovySlurping.class.getResourceAsStream( '/queries.xml' ) )
Assuming the build step is copying the xml into the build folder, I believe that should work
I don't use Eclipse though, so can't be 100% sure...
Try
file = new File("src/org/ars/groovy/queries.xml");
To check the actual working directory of eclipse you can use
File f = new File(".");
System.out.println(f.getAbsolutePath());
You could try using a property file to store the path of the xml files.
This way you can place the xml files in any location, and simply change the property file.
This will not require a change/recompilation of code.
This would mean you will only need to hardcode the path of the property file.
If you prefer not hardcoding the path of the property file, then you could pass it as an argument during startup in your server setup file. (in tomcat web.xml). Every server will have an equivalent setup file where you could specify the path of the property file.
Alternatively you could specify the path of the xml in this same file, if you don't want to use property files.
This link will show you an example of reading from property files.
http://www.zparacha.com/how-to-read-properties-file-in-java/