Menu

How to check registered sling models classes in AEM?

Sling Models are annotation driven Java "POJO's" (Plain Old Java Objects) that facilitate the mapping of data from the JCR to Java variables and provide a number of other refinements when developing in the context of AEM (Adobe Experience Manager).

Sling Models Bound to Resource Types and can be explored and view in Felix console using the below path. And can be accessed on Felix console > Status > Sling Models

/system/console/status-slingmodels

Sling Models Inject Annotation Processor Factories


  • com.day.cq.wcm.models.impl.injectors.StyleValueInjector
  • com.day.cq.wcm.models.impl.injectors.StyleOrValueMapValueInjector
  • com.adobe.acs.commons.models.injectors.annotation.impl.JsonValueMapValueAnnotationProcessorFactory
  • com.adobe.acs.commons.models.injectors.annotation.impl.I18NAnnotationProcessorFactory
  • com.adobe.acs.commons.models.injectors.annotation.impl.HierarchicalPagePropertyAnnotationProcessorFactory
  • com.adobe.acs.commons.models.injectors.annotation.impl.ChildResourceFromRequestAnnotationProcessorFactory
  • com.adobe.acs.commons.models.injectors.annotation.impl.SharedValueMapValueAnnotationProcessorFactory
  • com.adobe.acs.commons.models.injectors.annotation.impl.AemObjectAnnotationProcessorFactory
  • org.apache.sling.models.impl.injectors.BindingsInjector
  • org.apache.sling.models.impl.injectors.ResourcePathInjector
  • org.apache.sling.models.impl.injectors.RequestAttributeInjector
  • org.apache.sling.models.impl.injectors.OSGiServiceInjector
  • org.apache.sling.models.impl.injectors.SlingObjectInjector
  • org.apache.sling.models.impl.injectors.SelfInjector
  • org.apache.sling.models.impl.injectors.ChildResourceInjector
  • org.apache.sling.models.impl.injectors.ValueMapInjector 

Sling Models Implementation Pickers 


  • org.apache.sling.models.impl.ResourceTypeBasedResourcePicker
  • org.apache.sling.models.impl.FirstImplementationPicker


Sling Models Injectors

  • i18n - com.adobe.acs.commons.models.injectors.impl.I18nInjector 
  • style - com.day.cq.wcm.models.impl.injectors.StyleValueInjector 
  • stylevaluemap - com.day.cq.wcm.models.impl.injectors.StyleOrValueMapValueInjector 
  • json-valuemap-value - com.adobe.acs.commons.models.injectors.impl.JsonValueMapValueInjector 
  • hierarchical-page-property - com.adobe.acs.commons.models.injectors.impl.HierarchicalPagePropertyInjector 
  • child-resources-from-request - com.adobe.acs.commons.models.injectors.impl.ChildResourceFromRequestInjector 
  • script-bindings - org.apache.sling.models.impl.injectors.BindingsInjector 
  • valuemap - org.apache.sling.models.impl.injectors.ValueMapInjector 
  • resource-path - org.apache.sling.models.impl.injectors.ResourcePathInjector 
  • child-resources - org.apache.sling.models.impl.injectors.ChildResourceInjector 
  • request-attributes - org.apache.sling.models.impl.injectors.RequestAttributeInjector 
  • define-objects - com.adobe.acs.commons.models.injectors.impl.AemObjectInjector 
  • osgi-services - org.apache.sling.models.impl.injectors.OSGiServiceInjector 
  • sling-object - org.apache.sling.models.impl.injectors.SlingObjectInjector 
  • self - org.apache.sling.models.impl.injectors.SelfInjector

Could not find or load main class MainClass

Error: Could not find or load main class MainClass

While running the Java program user see this compilation error. There are two ways to fix this.

1. Go to package where file is located and run the java compiler javac filename.java

2. Provide full directory path to Java compiler like; javac C:/desktop/jorvee/javasample/javapackage/javafile.java

Why Java doesn't support multiple inheritance?

Java doesn't support multiple inheritance because of deadlock and ambiguity situation.

A class cannot extend two classes, but a class can implement multiple interfaces. So, we use interfaces to achieve multiple inheritance in Java programming.

e.g. Class C extends A, B { //statements }

The above class declaration is invalid in Java programming. but possible in various other programming languages.

e.g. Class C extends A implements D, F { //codes }

The above class declaration is valid in Java. In the above class declaration, we have inherited class A and implementing two interfaces D and F. This way we can implement multiple interfaces in Java.

Example Class C extends Class A and Class B and both classes A and B have evaluate() method. When class C tries to inherit evaluate method then the compiler will get confused and unable to decide which evaluate method to inherit, either from class A or B. So to remove this ambiguity from the program Java doesn't support multiple inheritance.