Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 71217 invoked from network); 4 Jun 2008 14:31:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jun 2008 14:31:16 -0000 Received: (qmail 16277 invoked by uid 500); 4 Jun 2008 14:31:09 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 16216 invoked by uid 500); 4 Jun 2008 14:31:09 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 16172 invoked by uid 99); 4 Jun 2008 14:31:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jun 2008 07:31:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [213.239.215.103] (HELO tux17.hoststar.ch) (213.239.215.103) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jun 2008 14:30:18 +0000 Received: from [127.0.0.1] (adsl-84-226-27-129.adslplus.ch [84.226.27.129]) (authenticated bits=0) by tux17.hoststar.ch (8.13.6/8.12.11) with ESMTP id m54EUbA8029908 for ; Wed, 4 Jun 2008 16:30:37 +0200 Date: Wed, 04 Jun 2008 16:32:18 +0200 From: Jeremias Maerki To: users@jackrabbit.apache.org Subject: Re: Namespaces and Session.getImportContentHandler() In-Reply-To: <90a8d1c00806040718x3d9ed08eo911ebc08cb4ac22e@mail.gmail.com> References: <20080604155145.8A46.DEV@jeremias-maerki.ch> <90a8d1c00806040718x3d9ed08eo911ebc08cb4ac22e@mail.gmail.com> Message-Id: <20080604162843.8A4C.DEV@jeremias-maerki.ch> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Mailer: Becky! ver. 2.28.01 [en] X-Antivirus: avast! (VPS 080604-1, 04.06.2008), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the feedback, Stefan. In that case, I'll first have to make sure the problem is not on my side. ATM, the XML content is generated by Java code (XML Graphics Commons' XMP package) as SAX events. I'll see if the same happens if I load from an XML file to rule out any SAXish side-effects. On 04.06.2008 16:18:26 Stefan Guggisberg wrote: > On Wed, Jun 4, 2008 at 4:09 PM, Jeremias Maerki = wrote: > > I'm trying to import arbitrary XML content through > > Session.getImportContentHandler(). It works fine if I have XML content > > that is fully in the default namespace. But if there's mixed-namespace = content > > I get the following error when calling Session.save(): > > > > ERROR - failed to write bundle: 1b773746-508f-4176-ab3f-6bbf3d1b6bd9 > > java.lang.IllegalStateException: URI not valid? javax.jcr.NamespaceExce= ption: URI http://www.w3.org/1999/02/22-rdf-syntax-ns# is not registered. > > at org.apache.jackrabbit.core.persistence.bundle.util.NamespaceI= ndex.stringToIndex(NamespaceIndex.java:55) > > at org.apache.jackrabbit.core.persistence.bundle.util.ItemStateB= inding.writeQName(ItemStateBinding.java:391) > > at org.apache.jackrabbit.core.persistence.bundle.util.BundleBind= ing.writeBundle(BundleBinding.java:286) > > at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersist= enceManager.storeBundle(BundleDbPersistenceManager.java:1262) > > at org.apache.jackrabbit.core.persistence.bundle.AbstractBundleP= ersistenceManager.putBundle(AbstractBundlePersistenceManager.java:703) > > at org.apache.jackrabbit.core.persistence.bundle.AbstractBundleP= ersistenceManager.store(AbstractBundlePersistenceManager.java:643) > > at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersist= enceManager.store(BundleDbPersistenceManager.java:526) > > at org.apache.jackrabbit.core.state.SharedItemStateManager$Updat= e.end(SharedItemStateManager.java:704) > > at org.apache.jackrabbit.core.state.SharedItemStateManager.updat= e(SharedItemStateManager.java:873) > > at org.apache.jackrabbit.core.state.LocalItemStateManager.update= (LocalItemStateManager.java:324) > > at org.apache.jackrabbit.core.state.XAItemStateManager.update(XA= ItemStateManager.java:306) > > at org.apache.jackrabbit.core.state.LocalItemStateManager.update= (LocalItemStateManager.java:300) > > at org.apache.jackrabbit.core.state.SessionItemStateManager.upda= te(SessionItemStateManager.java:317) > > at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1247) > > at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:= 897) > > > > > > It seems like I have to preregister all used namespaces myself with the > > NamespaceRegistry. And I possibly have to do some namespace prefix > > normalization to avoid collisions if I don't have control over what > > namespace prefixes are used because there's only one NamespaceRegistry > > per workspace. Did I get that about right? >=20 > no, that shouldn't be necessary, all references namespaces in your xml do= cument > should automatically be registered. seems to be a bug, could you perhaps > provide a sample xml document that fails on import? >=20 > cheers > stefan >=20 >=20 > > > > Thanks for your input, > > Jeremias Maerki > > > > Jeremias Maerki