jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Herman" <MHer...@NBME.org>
Subject Error setting binary property twice (through webdav)
Date Mon, 17 Oct 2011 17:36:56 GMT
I was unable to find a JIRA ticket so I figured I'd run it by the mailing
list.  I'm using JcrUtils.getRepository() to connect to my webdav url. When I
set a property on a node with a binary twice within a save operation, I get a
bad request exception (below). For example:

 

Session s  = getSession();

Node n = s.getRootNode().addNode("test");

Binary b = s.getValueFactory().createValue(true).getBinary();    

n.setProperty("a", b);

n.setProperty("a", b);

s.save();

 

Fails every time.

 

It works if I:

- remove one of the n.setProperty()

- pass in another type besides binary

- switch to the RMI url, but then I lose other functionality that only webdav
supports

- add a s.save() between the two setProperty()

 

It seems to happen no matter how I create the binary, or if I use a different
binary the 2nd time.  I recognize that this isn't a typical use case, but it
is possible so I'd like to prevent the error.  Is this a known issue? Is
there any alternate way that might prevent this error?  

 

I'm using CRX 2.2 developer instance on the same machine with no clustering. 

 

Thanks.

 

javax.jcr.RepositoryException: Bad Request

                at
org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.
java:120)

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

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(Reposit
oryServiceImpl.java:475)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.access$200(Re
positoryServiceImpl.java:411)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl.submit(RepositoryServic
eImpl.java:316)

                at
org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.execute(W
orkspaceManager.java:826)

                at
org.apache.jackrabbit.jcr2spi.WorkspaceManager$OperationVisitorImpl.access$50
0(WorkspaceManager.java:793)

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

                at
org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.save(SessionItemS
tateManager.java:139)

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

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

                at
<company>.cms.integration.CmsTransactionTest.testSimpleTransaction(CmsTransac
tionTest.java:44)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

                at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:25)

                at java.lang.reflect.Method.invoke(Method.java:585)

                at junit.framework.TestCase.runTest(TestCase.java:164)

                at junit.framework.TestCase.runBare(TestCase.java:130)

                at junit.framework.TestResult$1.protect(TestResult.java:106)

                at
junit.framework.TestResult.runProtected(TestResult.java:124)

                at junit.framework.TestResult.run(TestResult.java:109)

                at junit.framework.TestCase.run(TestCase.java:120)

                at junit.framework.TestSuite.runTest(TestSuite.java:230)

                at junit.framework.TestSuite.run(TestSuite.java:225)

                at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3Te
stReference.java:130)

                at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38
)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRun
ner.java:467)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRun
ner.java:683)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.j
ava:390)

                at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.
java:197)

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

                at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.getResponseExceptio
n(DavMethodBase.java:162)

                at
org.apache.jackrabbit.webdav.client.methods.DavMethodBase.checkSuccess(DavMet
hodBase.java:174)

                at
org.apache.jackrabbit.spi2davex.RepositoryServiceImpl$BatchImpl.start(Reposit
oryServiceImpl.java:468)

                ... 27 more

 

 

 


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