Getting null TagManager in AEM 6.1 - aem

Trying to fetch the list of all the resources tagged with the specific tag. Following is the line used to fetch the TagManager from ResourceResolver
TagManager tagManager = resourceResolver.adaptTo(TagManager.class);
But getting null TagManager.
Also, when I am trying to bind JcrTagManagerFactory, the service is failing as the JcrTagManagerFactory could not be bind. I could see JcrTagManagerFactory service running in console.
#Reference
JcrTagManagerFactory jcrTagManagerFactory;
Any suggestions? Am I missing anything?

Related

Apache Meecrowave OAuth2 JPA

I succeedeed in creating my own OAuth2 server using JCache as token store but I'm facing an issue when moving to JPA.
My configuration is :
"--users","test=test",
"--roles","test=test",
"--oauth2-provider","jpa",
"--oauth2-jpa-database-driver","org.h2.Driver",
"--oauth2-jpa-database-url","jdbc:h2:mem:oauth",
"--oauth2-jpa-database-username","sa",
"--oauth2-jpa-database-password",""
But I got exception below during OpenJPA bootstrap :
here was an error while setting up the configuration plugin option "MetaDataFactory".
The plugin was of type "org.apache.openjpa.persistence.jdbc.PersistenceMappingFactory".
Setter methods for the following plugin properties were not available in that type: [
org.apache.cxf.rs.security.oauth2.tokens.bearer.BearerAccessToken,
org.apache.cxf.rs.security.oauth2.common.OAuthPermission,
org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken,
org.apache.cxf.rs.security.oauth2.grants.code.ServerAuthorizationCodeGrant,
org.apache.cxf.rs.security.oauth2.common.UserSubject].
Possible plugin properties are:
[AnnotationParser, ClasspathScan, FieldOverride, Files, JAR_FILE_URLS, MAPPING_FILE_NAMES, MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY, PERSISTENCE_UNIT_ROOT_URL, Repository, Resources, STORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSE, StoreDirectory, StoreMode, Strict, Types, URLs, XMLAnnotationParser, XMLParser].
Ensure that your plugin configuration string uses key values that correspond to setter methods in the plugin class.
I suppose I missed something in configuration...
Any help would be appreciated.
Tx
Using --oauth2-jpa-properties you can set any persistence unit properties you want, I guess you will have to override openjpa.MetaDataFactory default value which is set to jpa(Types=org.apache.cxf.rs.security.oauth2.common.Client,org.apache.cxf.rs.security.oauth2.common.OAuthPermission,org.apache.cxf.rs.security.oauth2.common.UserSubject,org.apache.cxf.rs.security.oauth2.grants.code.ServerAuthorizationCodeGrant,org.apache.cxf.rs.security.oauth2.tokens.bearer.BearerAccessToken,org.apache.cxf.rs.security.oauth2.tokens.refresh.RefreshToken).
You can also check if your configuration is properly propagated and if there is no classpath conflict (another persistence.xml with an oauth2 unit?) because I just retested and your configuration seems to work.
Romain

Allow jasper server users to create a domain

I would like that some users could create domains on my JasperReports Server (users with role X),
I found a documentation were everything is explaind (doc), it worked in a demo enterprise version of JasperReports
but when I tried the same process on the production JasperReports (LDAP configured), I got this error :
Error creating bean with name 'remoteServiceConfiguration' -> Error creating bean with name 'authenticationAuthoirizationFilterChainProxy' ->
Cannot resolve reference to bean 'filterInvocationInterceptor' while setting constructor argument with key [6] ->
java.lang.IllegalArgumentException: Unsupported configuration attributes: [L4_IT_DEVS] (my role)
Screen :
Has someone already had this kind of error when configuring domain creation for users ?
I had this problem before and solved by using roles with the prefix "ROLE_" in their names, like "ROLE_L4_IT_DEVS" for example.
Hope that could help !

Jenkins CORS Filter plugin not adding Access-Control-Allow-Origins header

I am trying to add CORS support to my Jenkins server so I could access the REST API from the browser. From looking around, the recommended approach is to use the CORS Filter plugin.
I have installed it, enable it, and add http://localhost to the Access-Control-Allow-Origins field, as well as GET to Access-Control-Allow-Methods field. However, these headers are not showing up in my requests.
This plugin has not been updated in a few years, so I'm not sure if it's compatible with the latest version of Jenkins. I'm running version 2.172.
In the Jenkins system log, I see these errors, not sure if it's related/ relevant
Caught exception evaluating: descriptor.getPropertyType(instance,field).itemTypeDescriptorOrDie in /configure. Reason: java.lang.reflect.InvocationTargetException
java.lang.AssertionError: class hudson.ivy.IvyBuildTrigger$IvyConfiguration is missing its descriptor in public hudson.ivy.IvyBuildTrigger$IvyConfiguration[] hudson.ivy.IvyBuildTrigger$DescriptorImpl.getConfigurations(). See https://jenkins.io/redirect/developer/class-is-missing-descriptor
Caught exception evaluating: h.filterDescriptors(it,attrs.descriptors) in /configure. Reason: java.lang.NullPointerException: Descriptor list is null for context 'class hudson.model.Hudson' in thread 'Handling GET /configure from 100.71.26.18 : qtp589873731-14 Jenkins/configure.jelly GlobalLibraries/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
java.lang.NullPointerException: Descriptor list is null for context 'class hudson.model.Hudson' in thread 'Handling GET /configure from 100.71.26.18 : qtp589873731-14 Jenkins/configure.jelly GlobalLibraries/config.jelly LibraryConfiguration/config.jelly SCMRetriever/DescriptorImpl/config.jelly MultiSCM/DescriptorImpl/config.jelly'
These errors have at org.jenkinsci.plugins.corsfilter.AccessControlsFilter.doFilter(AccessControlsFilter.java:79) in their stack trace.
Does anyone know of a good way to enable CORS support for Jenkins REST API?
Jenkins version 2.303 and I struggle with the same issue. I would recommend to add the port number on the localhost URI you defined in the plugin settings, even though I'm pretty sure that won't change anything.
It actually seems the plugin is having no effect at all.
Probably the best solution is to set up your own proxy which would take care of CORS. Here is a good and well document example Build a Node.js Proxy Server in Under 10 minutes!

How can I find out what is causing a certain URL to be resolved to a synthetic resources?

On my Adobe CQ 5 (CQ 5.6) installation, for some reason, there's a URL (http://localhost:4503/services) that is getting resolved to a synthetic resource:
This is causing CQ to show the following page, rather than a 404 Page Not Found page:
What is causing this behavior?
You get Forbidden error not because of the strange type of the /services, but because you didn't add any extension (you'll get the same result requesting /content/geometrixx). Let's try to add some extension: .html doesn't really work, but .infinity.tidy.json results in interesting discovery:
{
"tagfilter": {
"sling:resourceType": "/services/tagfilter.servlet",
"servletClass": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet",
"sling:resourceSuperType": "sling/bundle/resource",
"servletName": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet"
},
"tagfilter.servlet": {
"sling:resourceType": "/services/tagfilter.servlet",
"servletClass": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet",
"sling:resourceSuperType": "sling/bundle/resource",
"servletName": "com.adobe.cq.social.commons.impl.servlets.TagFilterServlet"
},
...
It seems that /services is a virtual (or, well, synthetic) path, a parent for servlets. In fact, you can't bind servlet to any path, the most popular choice is /bin prefix, however /services is possible as well. You'll find a list of all such paths in Apache Sling Servlet/Script Resolver and Error Handler OSGi configuration.

Getting Error from Service

I am new to GWT and I am trying to call the service I created but I am getting the following error
Casing? you url-pattern contains TimeSheetTrack in a different case as the url shown in your error message.