Angela Schreiber
Thu, 18 Mar 2010 04:19:27 -0700
hi
not sure if properly understood what your problem is.
from your description i created a simple test-case as follows
and run it on my jackrabbit trunk (jcr2dav -> conformancetest)...
that worked...
public void testSimple() throws Exception {
Session s = getHelper().getRepository().login(new
SimpleCredentials("", new char[0]), null);
try {
Node n = s.getRootNode();
n.addMixin("mix:lockable");
s.save();
n.addNode("test");
s.save();
} finally {
s.logout();
}
Session ss = getHelper().getReadOnlySession();
try {
assertTrue(ss.nodeExists("/test"));
} finally {
ss.logout();
}
}
do you use specific node types to create your nodes?
are your nodes referenceable? (there were bugs with ref.
nodes that i fixed just recently)...
how is the server side config of your davex repo? specially
the security config... do you use the trivial configuration
that allow any non-anonymous user to write?
did you check the log files? any entry that would allow to
get some more information?
regards
angela
Niu, Xuetao wrote:
Hi Angela, - The getRootNode() returns "/" of the default workspace - The getRtdeRootNode() returns "/rtde:root" of the default workspace - The addNode(root, RTDE_ROOT_NAME) adds "rtde:root" under the "/" node of the default workspace. To get a node from the default workspace, I used this: Session.getNode(path) To acquire a session, I used this: return JcrUtils.getRepository("http://localhost:8080/jackrabbit-webapp-2.0.0/se rver").login(new SimpleCredentials("", new char[0]), null); Let me know if you need more info. Many Thanks! Xuetao hi xuetao and what exactly does getRtdeRootNode(s) and getRootNode(s) and addNode(root, RTDE_ROOT_NAME)? please try to narrow down the problem so we can see what you are doing... otherwise it's not possible to help you. at least not for me. thanks angelaTo explain what I did, I just called one method below and the 2nd "save()" gives the exception I pasted beneath:public static synchronized voidcreateRepositoryStructure(Sessions, 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 exceptions.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 inwebbrowser but not with JCR APIWhen I call Session.save(), I got the "Bad Request" exception, but ifIuse a local repository impl, like TransientRepository, everythingworksfine. Could you guys help me out?Caused by: javax.jcr.RepositoryException: Bad Request atorg.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:113) atorg.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:49) atorg.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:457) atorg.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$200(RepositoryServiceImpl.java:399) atorg.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServiceImpl.java:304) atorg.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(WorkspaceManager.java:830) atorg.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$500(WorkspaceManager.java:797) atorg.apache.jackrabbit.jcr2spi.WorkspaceManager.execute(WorkspaceManager.java:594) atorg.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.save(SessionItemStateManager.java:139) at org.apache.jackrabbit.jcr2spi.ItemImpl.save(ItemImpl.java:246) at org.apache.jackrabbit.jcr2spi.SessionImpl.save(SessionImpl.java:328) atcom.fiserv.repository.jcr.JCRUtils.createRepositoryStructure(JCRUtils.java:196) ... 51 more Caused by: org.apache.jackrabbit.webdav.DavException: Bad Request atorg.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseException(DavMethodBase.java:172) atorg.apache.jackrabbit.webdav.client.methods.DavMethodBase.checkSuccess(DavMethodBase.java:181) atorg.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(RepositoryServiceImpl.java:453) ... 60 moreThanks in advance! Xuetao