Connect to JCR from Java via JcrUtils without WebDAV


hi,

 

i'm trying connect jcr java application, cq5 instance has apache sling simple webdav access repositories , apache sling davex access repositories turned off in osgi console.  if these turned on, can use following code:

 

repository = jcrutils.getrepository( "http://123.123.123.123:4502/crx/server" );

session = repository.login( new simplecredentials( "admn", "admin".tochararray( ) ) );

 

all lovely, , valid session returned.  in production, when webdav turned off, following warnings when trying jcrutils.getrepository:

 

[main] info org.apache.commons.httpclient.auth.authchallengeprocessor - basic authentication scheme selected

[main] info org.apache.commons.httpclient.httpmethoddirector - no credentials available basic 'sling (development)'@123.123.123.123:4502

[main] warn org.apache.jackrabbit.spi2dav.repositoryserviceimpl - authentication required access repository descriptors

 

and exception when trying session:

 

javax.jcr.nodetype.constraintviolationexception: method not allowed

          at org.apache.jackrabbit.spi2dav.exceptionconverter.generate(exceptionconverter.java:105)

          at org.apache.jackrabbit.spi2dav.exceptionconverter.generate(exceptionconverter.java:51)

          at org.apache.jackrabbit.spi2dav.exceptionconverter.generate(exceptionconverter.java:45)

          at org.apache.jackrabbit.spi2dav.repositoryserviceimpl.obtain(repositoryserviceimpl.java:782 )

          at org.apache.jackrabbit.spi2dav.repositoryserviceimpl.obtain(repositoryserviceimpl.java:726 )

          at org.apache.jackrabbit.spi2davex.repositoryserviceimpl.obtain(repositoryserviceimpl.java:3 01)

          at org.apache.jackrabbit.jcr2spi.repositoryimpl.login(repositoryimpl.java:151)

          at org.apache.jackrabbit.commons.abstractrepository.login(abstractrepository.java:123)

          at au.com.btes.cq.cqserver.connecttorepository(cqserver.java:746)

          at au.com.btes.cq.cqserver.updateosgiconfiguration(cqserver.java:543)

          at au.com.btes.cq.cqserver.updateosgiconfigurations(cqserver.java:521)

          at au.com.btes.cq.deployer.cqdeployer.configureosgi(cqdeployer.java:494)

          at au.com.btes.cq.deployer.cqdeployer.startdeployment(cqdeployer.java:186)

          at au.com.btes.cq.deployer.main.main(main.java:13)

caused by: org.apache.jackrabbit.webdav.davexception: method not allowed

          at org.apache.jackrabbit.webdav.client.methods.davmethodbase.getresponseexception(davmethodb ase.java:165)

          at org.apache.jackrabbit.webdav.client.methods.davmethodbase.getresponsebodyasmultistatus(da vmethodbase.java:91)

          at org.apache.jackrabbit.spi2dav.repositoryserviceimpl.obtain(repositoryserviceimpl.java:754 )

          ... 10 more

 

 

webdev not enabled, fair enough.  based on documentation @ http://dev.day.com/docs/en/crx/current/developing/accessing_the_crx.html, tried rmi connection following:

 

repository = jcrutils.getrepository( "rmi://123.123.123.123:4502/crx" );

session = repository.login( new simplecredentials( "admn", "admin".tochararray( ) ) );

 

when hits line getting repo, waits 30 seconds, returns with:

 

javax.jcr.repositoryexception: unable access repository following settings:

    org.apache.jackrabbit.repository.uri: rmi://123.123.123.123:4502/crx

the following repositoryfactory classes consulted:

    org.apache.jackrabbit.commons.jndirepositoryfactory: declined

    org.apache.jackrabbit.jcr2dav.jcr2davrepositoryfactory: declined

    org.apache.jackrabbit.jcr2spi.jcr2spirepositoryfactory: declined

    org.apache.jackrabbit.rmi.repository.rmirepositoryfactory: failed

        because of repositoryexception: failed rmi resource //123.123.123.123:4502/crx

        because of connectioexception: error during jrmp connection establishment; nested exception is:

          java.io.eofexception

        because of eofexception: null

perhaps repository trying access not available @ moment.

 

it not try , session, failed on retreiving of repository.

 

is there setting on cq5/crx needs applied enable rmi connections?  if so, security (or other) ramifications of turning on?  if there's no setting, can see i'm going wrong here?

 

thanks help,

k



More discussions in Archived Spaces


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account