component is in satisfied state.

Avatar

Avatar

safiurr6781691

Avatar

safiurr6781691

safiurr6781691

12-03-2018

One of the component class is not getting active in OSGI.

I am using AEM6.2 version. (No hotfix/Service pack installed except acs commons package).

There is a service class which has 3 injections

@Reference

ResouceResolverFactory

@Reference

SlingSettingsService

@Reference

SlingRepository

Even if some components which are not having any injection are also in satisfied state.

Iam getting below error:

GlobalServiceImpl component is in satisfied state. While accessing a page, it calls TestService

12.03.2018 21:13:25.927 *ERROR* [0:0:0:0:0:0:0:1 [1520869404652] GET /content/sir/en/homepage.html HTTP/1.1] com.day.cq.wcm.core.impl.WCMDebugFilter Error during include of SlingRequestPathInfo: path='/content/test/en/homepage/jcr:content', selectorString='null', extension='html', suffix='null'

org.apache.sling.api.scripting.ScriptEvaluationException: javax.servlet.ServletException: java.lang.Error: Unresolved compilation problems:

Only a type can be imported. com.test.core.service.test.TestService resolves to a package

Only a type can be imported. com.test.core.service.test.Test_User_Profile resolves to a package

TestService cannot be resolved to a type

TestlService cannot be resolved to a type

Test_User_Profile cannot be resolved to a type

at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:416)

at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)

at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)

Tried restarting the instance, still same issue is there. All bundles are correctly deployed and are in active state. Why components are not active?

Can anyone help me to resolve this issue.

Replies

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

12-03-2018

When you open the Bundle in Felix console, are you seeing any red?

Avatar

Avatar

Rima_Mittal

Avatar

Rima_Mittal

Rima_Mittal

12-03-2018

Hi,

can you try immediate=true with the @component declaration and see if it helps?

@Component(service = GlobalService.class, immediate = true)

Avatar

Avatar

safiurr6781691

Avatar

safiurr6781691

safiurr6781691

12-03-2018

No. Nothing is in Red. Bundle is active

Avatar

Avatar

safiurr6781691

Avatar

safiurr6781691

safiurr6781691

12-03-2018

@Service(value = GlobalService.class)

@Component( immediate = true)

This is there. Still the class is in satisfied state.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

13-03-2018

How are you calling the Service - this is not an HTL component correct? Are you using JSP?

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

13-03-2018

Also - how did you build your project? Are you using Maven Acrhetype?

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

953

Correct Reply

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

953

Correct Reply

1.0K
Jörg_Hoh
Employee

13-03-2018

This part of the stack trace does not indicate that an OSGI component does not work, but rather that a scriptlet (JSP?) ist not compiled.

When you have a proper OSGI component as part of a bundle, it is typically compiled in a maven build, and not in AEM. Only scripts are compiled in AEM.

So we need information how your maven project looks like and how you compile and deploy it.

regards,

Jörg