See the community article that gets at the local JCR from a component.
http://helpx.adobe.com/experience-manager/using/creating-custom-cq-tree.html
It populates the front end component with data from the JCR.
Also - from an OSGi component (or JSP) never use:
//Create a connection to the Adobe Day CQ repository running on local host
Repository repository = JcrUtils.getRepository("http://localhost:4502/crx/server");
This code is used when you want to get at the JCR from an external Java app - like a console app or a Swing app. For details about how to write a Java Swing app that that pull up data from an AEM JCR -- see:
http://helpx.adobe.com/experience-manager/using/java-swing-applications.html
To properly get at the JCR from within an OSGi component - use:
resourceResolver.adaptTo(Session.class);
To learn how to write an OSGi component that uses this code to retrieve JCR Data:
http://helpx.adobe.com/experience-manager/using/querying-experience-manager-data-using1.html
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.