Activator bundle throwing null pointer exception - eclipse-plugin

I am facing a unique problem - the following code block throws NPE only when my plugin is packaged and deployed not when I am launching it as an 'Eclipse Application'
inputStream = Activator.getDefault().getBundle().getEntry(templateFilePath).openStream();
I have tried other variations as well but nothing is working :
inputStream=Platform.getBundle("SuitACore").getEntry(templateFilePath).openStream();
Here templateFilePath is a file resource being read from a directory in plugin.

Thanks Nick , greg-449
I extracted the packaged jar - the template folder resource was not getting included. I changed this option from build.properties and now this works!

Related

Geb/Spock Error- No reports dir has been configured, you need to set in the config file or via the build adapter

I have trouble running my functional test from IntelliJ IDE. When I run the functional test, I got the following error message:
java.lang.IllegalStateException: No reports dir has been configured, you need to set in the config file or via the build adapter.
at geb.Browser.getReportGroupDir(Browser.groovy:899)
at geb.Browser.cleanReportGroupDir(Browser.groovy:932)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:56)
at geb.spock.GebReportingSpec.setupSpec(GebReportingSpec.groovy:37)
Based on my research, all I need to do is to add the following code in GebConfig.groovy:
reportsDir = new File("target/runtime_reports_dir")
I added the line to GebConfig.groovy and rebuild the project, but still running into the same issue. Is there any other fix to this error?
Adding reportsDir = 'target/geb-reports' to your GebConfig shoud fix this, can you show me your GebConfig file?
There is also another fix for it, your test class extends GebReportingSpec, you can chage it to GebSpec and it should also work.
I had this same issue, while having the reportsDir correctly configured in the GebConfig
Adding the resources folder (where my GebConfig is located) as "Test Sources Root" did the trick for me
To mark the folder as "Test Sources Root":
Right click in the folder
Mark Directory as
Test Sources Root
Happy testing!

Spring boot application.version is null

I'm using spring boot and was trying to retrieve the current application version. (basically the version in the pom.xml)
On the spring boot ref site I can see there is a ${application.version} that is meant to have the version present in the MANIFEST file. (I have checked in the jar, and the I indeed can see this line
Implementation-Version: 0.1.1-SNAPSHOT
but in the code when I try to retrieve ${application.version}
(using #Value throws an error saying the prop cannot be found) and using env.getProperty("application.version") returns null.
Is there anything I need to setup in order to be able to use this prop ?
I found the application.version property only works in banner.txt. I read the Implementation-Version from manifest file directly, see How to read my META-INF/MANIFEST.MF file in a Spring Boot app?
The application.version is only available when you are run the application as built jar file. java -jar springboot.jar
When running within a editor you will not have the version available.

Kotlin - Error: Could not find or load main class _DefaultPackage

I followed the Kotlin tutorial for eclipse here : Getting Started With Eclipse Luna
However, I'm running into this error:
Error: Could not find or load main class _DefaultPackage
Anyone who knows to get around this?
This was a severe bug (KT-10221) in automatic generation of Launch Configuration in plugin version 0.4.0. It was fixed in 0.5.0 so the recommendend way to workaround is to update plugin.
The source of the problem was that the plugin used an old pattern for generating name of the class for main function that had been abandoned by Kotlin compiler.
It's possible to workaround it by editing launch configuration (Eclipse Menu -> Run -> Run Configurations...) by hand and changing Main class field in Java Application group. If the file is named hello.kt with no package directive, as it is described in tutorial, than corrected string should be HelloKt.
If file has name other.kt with package my.tutorial than the Main Class should contain my.tutorial.HelloKt. You can read more about it in the section Package-Level Functions of Calling Kotlin From Java page.
I have been getting the same issue. And after putting the right compiler output path, it got resolved.
Go to Project -> Project Compiler output :
In the text box, fill this:
[Absolute Path]/{Project Name}/out
In my case I was having this problem while trying to run the program using the Application Gradle plugin. The problem was in the mainClassName property using single quotes instead of double ones
This didn't work:
mainClassName = 'demo.HelloWorldKt'
With double quotes, it works:
mainClassName = "demo.HelloWorldKt"
For me it worked after I installed the correct JDK. I first had JDK 11 but the tutorial I did was with JDK 8 so after I installed this and set it in the "installed JREs" options it found the main class without having any "mainClassName" or any other option in the build.gradle file.
For me, it worked in a fresh eclipse workspace. Possibly, the Kotlin eclipse plugin is not playing well with other plugins (in my case, PyDev).
I'm creating a Kotlin Application with JavaFX and I had this issue until I went to:
Run > Run Configurations > Java Application > Common
I unticked "Allocate console" and it fixed the issue.

Error after publishing .net web project

I am publishing a project in my local computer, I am getting an error because of the path of the files, in my project I am using relative path, but when i published the project I specified a Site/application so I put: localhost/myapp, but then, after the login the additional name myapp make it loses the path references, do you have any idea how to go through this?
I encountered the same problem with my web application this problem occurs because in your application you are hardcoding paths for ex :- /Home/Index or something which creates problems whenever you want to provide paths use helpers like #Url.Action(),#Html.Action(),#Url.Content() as shown below :-
#Url.Action("Index","Home",new{//specify route parameters here//})
If you are using areas in you application then specify it as :-
#Url.Action("Index","Home",new { area="myarea" })

BB Web Works giving error as "error feature cannot be found in any extension(blackberry. pin .memo)" while packaging the app

I am new to BlackBerry Web Works.I am following the instruction for development given on development site.While packaging the Application I am getting this error in command prompt : "[ERROR] feature cannot be found in any extension(blackberry. pin .memo)".
Before going to this step I have already created project folder with config.xml and index.html and also zip file of application components properly.And now trying to package the application.But I am getting error like:
Please help me to figure out this error.
Thanks
Finally I got the solution after a lot of searching and analogy.
This error occurs when either we have added some feature in config.xml which we are not using in our application or when we are using same feature but not defined in "feature" tag in config.xml. It is the same case with "spinner" ,"sms" etc.
In my case it was because of "memo" ,which I was defining in config.xml but didn't use any Contact feature in my Application.So it producing error like "feature cannot be found in any extension(blackberry. pin .memo)".