Skip to main content
Level 3
Oct 16, 2015 2:29 AM UTC
Solved

problem instantiating osgi bundle sightly helper java class

Earlier I was able to instantiate sightly helper java class(extends wcmuse) of osgi bundle in SlingAllMethodsServlet context and even able to access all the getter methods in that class.But in our project we started working with spring mvc and now I am unable to instantiate the sightly helper class.I have even mentioned all the package info in pom.xml(import and export packages).

Error Message:

org.apache.sling.scripting.sightly.SightlyException: Identifier com.test.sightly.TestSightly cannot be correctly instantiated by the Use API
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
swathiv54399501Accepted solution
Level 3
Oct 16, 2015 2:29 AM UTC

Issue resolved.I imported custom packages in pom.xml but forgot to import java use api related packages.Now I am able to instantiate the sightly helper class(OSGI bundle based) after importing com.adobe.cq.sightly package.

12 replies

Level 2
May 6, 2016 1:23 PM UTC

Hi Swati,

I am also getting the same error.
Have added custom packages in pom.xml, but still the error persists.
Kindly guide me in this.

Regards,
Maria Anto

Translate
mohammadm377380
Level 2
Jan 18, 2018 11:18 AM UTC

Hi,

To solve this, you can change the WCMUse to WCMUsePojo

import com.adobe.cq.sightly.WCMUse;

to

import com.adobe.cq.sightly.WCMUsePojo;

Cheers!

Translate