my code throws error at ResourcerResolverFactory.SUBSERVICE - aem

My code throws error when trying to use ResourcerResolverFactory.SUBSERVICE, eclipse suggests some other keywords like USER, USERNAME, PASSWORD, instead of SUBSERVICE and getADministrativeResourceResolver instead of getService ResourceResolver, I want to know if there is any dependency i should add to make it work

You need to update the Maven Dependency which is used by ResourceResolver.Can you please check that which Maven dependency you are using.Mine is coming from Uber-jar and working fine.

Related

No Dependency Injection and missing EclispeContext in Plugin

I have written an eclipse product, based on Eclipse Neon, which contains a self written plugin. Now I changed the platform to Eclipse 2019-06. Since then I get an InjectionException at the integratetd plugin.
I've debugged the code and found out, that the injection of this Plugin doesn't work any more and the EclipseContext is always null. I also tried to create the Objects with the #Creatable Annotation.
Do I have to transport the context from one plugin to another? In my opinion this isn't necessesary. So, had someone else this problem and has solved it?

Get Jenkins plugin dependencies auto installed

I'm developing Jenkins' plugin which is dependent on another plugin (specifically MultiJob plugin, but it can be any other one of course).
Obviously, the dependency is found in POM, so I can actually use the classes of it.
The problem: if I'm trying to install my plugin in Jenkins that the dependency is not found in it Jenkins doesn't installs it automatically and upon first usage my plugin throws an exception NoClassDefFoundError, of course.
Question: can I make Jenkins to install my dependencies as prerequisites and if yes, how?
Note: I do see that other plugins somehow cause the dependencies to be installed (Git plugin for instance makes GitClient installed during its installation).
Thanks in advance.
It's been a while since i've raised the question, but if anybody will look for something similar, here is what i've finally came up with:
Since the dependency classes are only needed in case they are really there, i've decided to use Java's lazy linkage behavior and actually refer the relevant classes only on demand.
So practically, made a factory that has a list of class names of interest and every time i need to process some object i'm checking it's class against this list. If matched - the class is loaded and therefore it's okay to init the linking/initiation logic.
Last one, if you plan to use such a pattern do not forget to sign those dependency plugins as optional in your pom.xml.

AspectJ and Springboot not working together

In my project i want to use pure aspectj in combination with spring-boot
While configuring the project we ran into some issues.
Found another similar problem but that doesnt help us.
This is what we did:
got springboot project
defined 2 aspects, 1 simple spring main class
added aspectj plugin to gradle build
set applicationDefaultJvmArgs to use the javaagent for aspectjweaver
Here is a link to our repo at github. https://github.com/svenhornberg/MDSD
and here is the Travis-CI build log https://travis-ci.org/svenhornberg/MDSD/builds
But it's still not working like it should.
Think i need some help here.
You seem to be trying to mix compile-time weaving and load-time weaving of your classes. You should chose one approach and use it consistently.
If you want to go with compile-time weaving, remove #EnableLoadTimeWeaving from Application and update build.gradle to remove the configuration of applicationDefaultJvmArgs. There's other clean up that you could do, but these two changes should be sufficient to get your app up and running. With these changes in place, at startup I see it output:
1
Please use List instead of a concrete implementation for method: findByPrio.
[]
Please use List instead of a concrete implementation for method: returnTest.
You used a method with only one boolean parameter. Refactor it into 2 methods with True, False at the end.
true

iReport "org/primefaces/model/UploadedFile" error in hibernate connection testing

I'm trying to make a hibernate connection to create some reports, but every time I press Test it appears an error window that says org/primefaces/model/UploadedFile, only that.
My classpath already has a jar of my project and the only place where I have the library from the error is inside an entity on the project.
If switch to another's project jar the connection is successful.
I'm using iReport 5.0.4 and Spring 2.9.1.
I'll appreciate any idea of what could be wrong, thanks in advance.
I couldn't figure out what was the problem, so I commented all references to the library and generated the jar that way.
I did it only because there's no related data to the things I commented.

Use a java class from a referenced project on the server-side?

I have a GWT project, and I want to use some classes server-side from another project:
MyServerProject
com.me.myserverproject.server.Horse
SomeSupportProject
com.me.somesupportproject.server.Animal
and MyServerProject Horse.java looks like:
class Horse extends Animal {
}
In eclipse, I have MyServerProject referencing the SomeSupportProject project. All compiles fine, and GWT Compile runs fine too, no errors.
When I deploy MyServerProject to a local instance, it immediately throws a NoClassDefFoundError error on "Animal.java":
java.lang.NoClassDefFoundError: com/me/somesupportproject/server/Animal
at java.lang.ClassLoader.defineClass1(Native Method)
I marked SomeSupportProject as exported in the eclipse project properties. But it seems like the class file for Animal.java is not getting exported upon deploy. Do we need to do something special here to get that to work?
I must be missing something really obvious since this is pretty basic stuff. I have clientside java files being referenced just fine, which I think is the trickier case. But these are all server-side classes, thought it would be simpler,
Thanks
------- Update: Project Setup ---------------
Some notes on my environment:
Using eclipse, and the two projects are side by side. I'm not using Ant or Maven. I have eclipse set to build automatically, so not getting any compiler errors there. To actually compile for a deploy, I tried right clicking "MyServerProject", choose Google -> GWT Compile. I set output to "all". I don't get any compile errors. The output does not mention any warnings.
After GWT Compile is complete, I right-click the project again, choose Run As -> Web Application. This is what throws the java.lang.NoClassDefFoundError for the class found in the SomeSupportProject project.
If there any specifics that would help just let me know.
--------- Final Update: Solved -----------------
After working on this some more, it seems we just can't add a project reference and get server-side classes to come across in the deployed top-level project. Instead, I linked to the "src" folder in SomeSupportProject. This allows things to still compile as normal, but when you deploy your project, all the classes are found without issue.
So this was really an app-engine issue, should have tagged it under there instead.
Thanks!
After working on this some more, it seems we just can't add a project reference and get server-side classes to come across in the deployed top-level project. Instead, I linked to the "src" folder in SomeSupportProject. This allows things to still compile as normal, but when you deploy your project, all the classes are found without issue.
So this was really an app-engine issue, should have tagged it under there instead.
Thanks!