jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niu, Xuetao" <Xuetao....@fiserv.com>
Subject RE: "Bad Request" exception using DavEx
Date Thu, 18 Mar 2010 10:22:44 GMT
To supplement the way I remotely access JCR API:

 

I followed the jackrabbit wiki:
http://wiki.apache.org/jackrabbit/RemoteAccess#DavEx to use the
following code to create remote JCR API stub:
 
JcrUtils.getRepository("http://localhost:8080/jackrabbit-webapp-2.0.0/se
rver");

 

Regards,

Xuetao

 

From: Niu, Xuetao 
Sent: Thursday, March 18, 2010 10:25 AM
To: 'users@jackrabbit.apache.org'
Subject: RE: "Bad Request" exception using DavEx

 

Hello,

 

To explain what I did, I just called one method below and the 2nd
"save()" gives the exception I pasted beneath:

 

      public static synchronized void createRepositoryStructure(Session
s, boolean removeExisting) {

 

            try {

                  getRootNode(s).addMixin(MIXIN_LOCKABLE);

                  s.save();

            } catch (RepositoryException e) {

                  throw e;

            }

 

            try {

                  Node node = getRtdeRootNode(s);

                  if (node != null) {

                        if (removeExisting) {

                              node.remove();

                              s.save();

                        } else {

                              return;

                        }

                  }

                  Node root = getRootNode(s);

                  Node rtdeRoot = addNode(root, RTDE_ROOT_NAME);

                  addNode(rtdeRoot, TENANTS_ROOT_NAME);

 

                  // the following save action produced the exception

 

                  s.save();

 

            } catch (RepositoryException e) {

                  throw new e;

            }

 

      }

 

 

I am using DavEx to remotely connecting to a repository at
http://localhost:8080/jackrabbit-webapp-2.0.0/server which works in web
browser but not with JCR API

 

When I call Session.save(), I got the "Bad Request" exception, but if I
use a local repository impl, like TransientRepository, everything works
fine. Could you guys help me out?

 

Caused by: javax.jcr.RepositoryException: Bad Request

                at
org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConve
rter.java:113)

                at
org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConve
rter.java:49)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(Re
positoryServiceImpl.java:457)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$2
00(RepositoryServiceImpl.java:399)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryS
erviceImpl.java:304)

                at
org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.exec
ute(WorkspaceManager.java:830)

                at
org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.acce
ss$500(WorkspaceManager.java:797)

                at
org.apache.jackrabbit.jcr2spi.WorkspaceManager.execute(WorkspaceManager.
java:594)

                at
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.save(Session
ItemStateManager.java:139)

                at
org.apache.jackrabbit.jcr2spi.ItemImpl.save(ItemImpl.java:246)

                at
org.apache.jackrabbit.jcr2spi.SessionImpl.save(SessionImpl.java:328)

                at
com.fiserv.repository.jcr.JCRUtils.createRepositoryStructure(JCRUtils.ja
va:196)

                ... 51 more

Caused by: org.apache.jackrabbit.webdav.DavException: Bad Request

                at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseExc
eption(DavMethodBase.java:172)

                at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.checkSuccess(D
avMethodBase.java:181)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(Re
positoryServiceImpl.java:453)

                ... 60 more

 

Thanks in advance!

Xuetao

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message