AEM 6.4 - Java sling servlet does not work with uber 6.4 jar, but does with uber 6.3 | Community
Skip to main content
brendanf9753525
Level 4
May 10, 2018
Solved

AEM 6.4 - Java sling servlet does not work with uber 6.4 jar, but does with uber 6.3

  • May 10, 2018
  • 14 replies
  • 10882 views

Hey all,

I am seeing a really weird issue with a fresh install of AEM 6.4. I have a Java sling servlet registered at a path of /bin/feed. This servlet crashes and does not load everytime I try to visit it.

Observing the logs gives me this error.

10.05.2018 14:59:24.876 *ERROR* [FelixDispatchQueue] org.apache.sling.servlets.resolver FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: com.amsurg.core.servlets.RSSXMLServlet (3142)))

org.osgi.framework.ServiceException: Service factory returned null. (Component: com.amsurg.core.servlets.RSSXMLServlet (3142))

It's pretty vague and I've seen some fixes for it with previous versions of AEM, but nothing concrete for 6.4 yet. The weird thing is, if I build and upload my package with the 6.4 uber-jar, I see the error 10/10 times. However when I compile it with the 6.3 uber-jar, it doesn't have any issues. That doesn't seem to be correct to me since I am using AEM 6.4.

Does anyone have any ideas or other things I can check for as to why this would not work? I have several other servlets registering in the same way and they are loaded just fine, so its a problem with this one + the uber 6.4 jar.

Thanks

Brendan

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Do you use the "new" OSGI annotations and have you updated your imports accordingly? On Using OSGi annotations (>= AEM6.2) - Experience Delivers  Feike has done a good job and listed all relevant things to consider.

Jörg

14 replies

joerghoh
Adobe Employee
Adobe Employee
May 14, 2018

Then you should check in the target/classes/OSGI-INF if there are xml files generated for these servlets in question.

Jörg

brendanf9753525
Level 4
May 14, 2018

I checked and it is not generated in there. All the rest of the servlets have them but that one is missing. So it looks like it is not being added to the package.

What do you think the cause of this could be? It does not seem to like my new annotations.

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
May 14, 2018

Do you use the "new" OSGI annotations and have you updated your imports accordingly? On Using OSGi annotations (>= AEM6.2) - Experience Delivers  Feike has done a good job and listed all relevant things to consider.

Jörg

brendanf9753525
Level 4
May 15, 2018

Thank you Jorg! That was it, I needed to add those OSGI dependencies and update my bundles.

It is loading and looks good now.