Here’s how to configure the JCR-Explorer tool under Tomcat, to use it with Sling.
Tested with Tomcat 6.0.18, JDK 1.5 and the Sling launchpad/webapp from revision 731934.
Starting with a fresh Tomcat install, add this to conf/server.xml
, inside <GlobalNamingResources>
:
<Resource name="jcr/globalRepository" auth="Container" type="javax.jcr.Repository" factory="org.apache.jackrabbit.rmi.client.ClientRepositoryFactory" url="rmi://127.0.0.1:1099/jackrabbit"/>
Add this to conf/context.xml
, inside <Context>
:
<ResourceLink name="jcr/repository" global="jcr/globalRepository" type="javax.jcr.Repository"/>
Copy the jcr-explorer.war
file to the tomcat webapps folder, start tomcat,
stop it (so that the webapp is expanded) and add this at the end of webapps/jcr-explorer/WEB-INF/web.xml
, inside <web-app>
:
<ResourceLink name="jcr/repository" global="jcr/globalRepository" type="javax.jcr.Repository"/>
Copy these two jar files to the lib
folder (or common/lib
for Tomcat 5):
jackrabbit-jcr-rmi-1.5.0.jar and jcr-1.0.jar.
Start Sling with the RMI export of the repository enabled. That’s standard if you start the Sling launchpad/webapp
module with mvn jetty:run
, for example. Sling can either run inside Tomcat, or standalone, as the connection is made via RMI.
On the jcr-explorer login page (http://localhost:8080/jcr-explorer/login.jsf
), use java:comp/env/jcr/repository
as the JNDI URL, and admin/admin
for login and password.
You should now see the JCR-Explorer page, as in our screenshot, displaying the contents of the Sling repository in the left pane (index.html, sling-logo.png, etc.).
This JCR-Explorer setup can be used to access any Jackrabbit repository accessible via rmi://127.0.0.1:1099/jackrabbit, that should work with plain Jackrabbit setups as well, of course.
See the JCR-Explorer website for more info about how to use that tool.
thanks Bertrand, works well!
Good work!!
Can you get this working on JBoss portal embedded repository?
Does the web app conf jcr-explorer change?
I’m not familiar with the JBoss portal embedded repository, that would rather be a question for the jcr-explorer developers.
Hi, Bertrand! How do you run repository to make it available through RMI ? If as a standalone repository server – i can only configure http port (for jackrabbit 1.5.6 http://jackrabbit.apache.org/jackrabbit-standalone.html)…
There are 2 default urls
* RMI registry: //localhost/jackrabbit.repository
* HTTP download: http://localhost:8081/rmi
I’ve tried first one – but can not connect ‘connection refused’ (it is ok with my firewall). If make it like this
//localhost:1099/jackrabbit.repository (connection refused)
//localhost:8081/jackrabbit.repository (A ‘org.apache.jackrabbit.rmi.client.RemoteRepositoryException’ has occured. Reason: non-JRMP server at remote endpoint).
Help please or give me a hint where to look for
Hi, Bertrand! How do you run repository to make it available through RMI ? If as a standalone repository server – i can only configure http port (for jackrabbit 1.5.6 http://jackrabbit.apache.org/jackrabbit-standalone.html)…
There are 2 default urls
* RMI registry: //localhost/jackrabbit.repository
* HTTP download: http://localhost:8081/rmi
I’ve tried first one – but can not connect ‘connection refused’ (it is ok with my firewall). If make it like this.
Thanks
//localhost:1099/jackrabbit.repository (connection refused)
//localhost:8081/jackrabbit.repository (A ‘org.apache.jackrabbit.rmi.client.RemoteRepositoryException’ has occured. Reason: non-JRMP server at remote endpoint).
Help please or give me a hint where to look for
Best would be to ask on the Jackrabbit users mailing list (or check the archives if the question has already been asked). See http://jackrabbit.apache.org/mailing-lists.html and http://jackrabbit.markmail.org/
Ok, but how did YOU run it ? Your experience is interested in this situation.
I used the Sling launchpad/webapp from revision 731934, which has RMI enabled by default. You can download a newer version of that from http://incubator.apache.org/sling/site/downloads.cgi, not sure if that one also has RMI on by default.
There are 2 default urls
* RMI registry: //localhost/jackrabbit.repository
* HTTP download: http://localhost:8081/rmi
I’ve tried first one – but can not connect ‘connection refused’ (it is ok with my firewall). If make it like this
//localhost:1099/jackrabbit.repository (connection refused)
//localhost:8081/jackrabbit.repository (A ‘org.apache.jackrabbit.rmi.client.RemoteRepositoryException’ has occured. Reason: non-JRMP server at remote endpoint).
Help please or give me a hint where to look for
Hi Bertrand,
I realize that what I am asking is not related to jcr-explorer. It has to do with the sling provided jquery explorer bundled with the latest sling version. I did not know where to ask the question, and hence I am asking it here.
If I should be raising this in a different forum or mailing list please point me there, and I will do so.
I downloaded and deployed sling launchpad 6 in apache tomcat 6.0.32 (OS: windows xp). My sling URL is http://localhost:8080/sling-launchpad-6/
I am able to successfully create content with the curl command:
curl -u admin:admin -F”sling:resourceType=foo/bar” -F”title=Foo Bar” http://localhost:8080/sling-launchpad-6/content/foonode
and view it via http://localhost:8080/sling-launchpad-6/content/foonode.json or foonode.html
However when I navigate to explorer URL http://localhost:8080/sling-launchpad-6/.explorer.html as per the sling documentation, while I get the basic interface, I also get a “HTTP Status 404 – /.explorer.item.html” error.
I am however able to manually navigate to http://localhost:8080/sling-launchpad-6/.explorer.item.html it displays the a set of resource links.
I must have missed something in the configuration or setup, but I cant figure out what!
These are the links displayed, although clicking on them does not do anything. They are HREFed to “#”
jcr:system
rep:policy
var
apps
index.html
signup.html
sling-logo.png
sling-test
sling.css
content
libs
system
Thanks
Santosh
Such questions are best asked on the Sling users mailing lists, see http://sling.apache.org/site/project-information.html#ProjectInformation-lists
In continuation of the previous post, the URL http://localhost:8080/sling-launchpad-6/content/.explorer.item.html displays foonode which was the content I create via the curl command.
And yet, I am not able to navigate to this using the explorer.
Thanks
Santosh