From users-return-10030-apmail-jackrabbit-users-archive=jackrabbit.apache.org@jackrabbit.apache.org Fri Jan 02 23:22:58 2009 Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 56713 invoked from network); 2 Jan 2009 23:22:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2009 23:22:58 -0000 Received: (qmail 72061 invoked by uid 500); 2 Jan 2009 23:22:57 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 72047 invoked by uid 500); 2 Jan 2009 23:22:57 -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 72036 invoked by uid 99); 2 Jan 2009 23:22:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2009 15:22:56 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [68.142.201.120] (HELO web82603.mail.mud.yahoo.com) (68.142.201.120) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 Jan 2009 23:22:47 +0000 Received: (qmail 49811 invoked by uid 60001); 2 Jan 2009 23:22:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=TWbfZObNzmIa6Kgf3J1JAUIWJHpVRdOC4F1Fd8zs+QhPiSv5a1ZPq1KkzmeKsfa282WnSIgjCgCGcXMZc4+3NC29X1+xMvtBbM3o0nFi0HzquAeH45ORrA7OjHByvZDrdLOD4HWPjEo24t3df0r4D9ve7+OVlCFlhudXb2FbrvI=; X-YMail-OSG: 85shxwUVM1nLuMCQNto0eF7RYjjAp38hQ7vWyQWb3lCbc9ShQHkVc.2OT7mO5wl3xzrpWDwNcckoAJf95qBxauacUv_dw_.R3vlswga3IOdZQ9HhhrThFOdQyMSNFcMrGmbioWm2.5bhqsf2IfaR8nm2S0_zqN_0wOgvYaZ31HFDqAoVBYONgbtsf0ncxlVtUPXRR3J2w_9KQ3QeXKYENiZfN6Ze5A-- Received: from [209.131.62.113] by web82603.mail.mud.yahoo.com via HTTP; Fri, 02 Jan 2009 15:22:25 PST X-Mailer: YahooMailRC/1155.45 YahooMailWebService/0.7.218.2 Date: Fri, 2 Jan 2009 15:22:25 -0800 (PST) From: Cheng Zhang Subject: Re: ocm: is not a registered namespace prefix. To: users@jackrabbit.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <72215.48570.qm@web82603.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks, Todd. You're right. I called more than one time. -Kevin ----- Original Message ---- From: Todd Seiber To: users@jackrabbit.apache.org Sent: Friday, January 2, 2009 11:09:01 AM Subject: Re: ocm: is not a registered namespace prefix. You only have to register the namespace once. Perhaps this exception was thrown on a second run? On Fri, Jan 2, 2009 at 1:57 PM, Cheng Zhang wrote: > Hi Todd, > > I added your code but got exception > > javax.jcr.NamespaceException: failed to register namespace ocm -> > http://jackrabbit.apache.org/ocm: mapping already exists > > Any idea? > > Thanks a lot, > Kevin > > > ----- Original Message ---- > From: Todd Seiber > To: users@jackrabbit.apache.org > Sent: Friday, January 2, 2009 5:36:19 AM > Subject: Re: ocm: is not a registered namespace prefix. > > Try > > workspace.getNamespaceRegistry().registerNamespace("ocm", " > http://jackrabbit.apache.org/ocm"); > > On Fri, Jan 2, 2009 at 12:21 AM, Cheng Zhang >wrote: > > > Hi, > > > > I started to use OCM to save object to repository today and got an > > exception below. It seems that I need to register a namespace ocm. Can > > anybody please tell me how to fix it? > > > > org.apache.jackrabbit.ocm.exception.ObjectContentManagerException: Cannot > > create new node of type nt:folder from mapped class class > > com.openandgreen.service.system.Folder; nested exception is > > javax.jcr.NamespaceException: ocm: is not a registered namespace prefix. > > javax.jcr.NamespaceException: ocm: is not a registered namespace prefix. > > > > Thanks a lot, > > Kevin > > > > > > > -- > Todd Seiber > 830 Fishing Creek Rd. > New Cumberland, PA 17070 > > h. 717-938-5778 > c. 717-497-1742 > e. todd.seiber@gmail.com > > -- Todd Seiber 830 Fishing Creek Rd. New Cumberland, PA 17070 h. 717-938-5778 c. 717-497-1742 e. todd.seiber@gmail.com