jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woonsan Ko <woon...@apache.org>
Subject Re: How Set Primary Type while creating repository
Date Tue, 14 Jun 2016 19:30:18 GMT
Hi Shafique,

Based on the exception message, I think you tried to change the
primary type of the *root* node. That's not allowed in JCR.
You can add a new node of a specific primary type underneath using
javax.jcr.Node#addNode(String relPath, String primaryNodeTypeName).
See the javadoc for detail.

Regards,

Woonsan


On Tue, Jun 14, 2016 at 3:12 AM, Shafique Rehman
<shafique.rehman@avanzasolutions.com> wrote:
> Hello,
>
> My name is Shafique, iam using jackrabbit API 2.2.1. I am facing "primary
> type" problem while creating repository below are lines of code
>
> protected Repository createRepository(InputSource is, File homedir)  throws
> RepositoryException {
>     RepositoryConfig config = RepositoryConfig.create(is,
> homedir.getAbsolutePath());
>              return RepositoryImpl.create(config);
>          }
>
>
> Face below exception while calling RepositoryImpl.create(config);
>
>
> javax.jcr.nodetype.ConstraintViolationException: /: mandatory property {
> http://www.jcp.org/jcr/1.0}primaryType does not exist.
>
> Could you please help me how i set primary type?
>
> --
> Regards,
>
>
> *Shafique Rehman Dhuyo *
>
> *Software Engineer*
>
>
>
>
>
> <http://www.avanzasolutions.com/>
>
>
> *Avanza Solutions (Pvt.) Ltd.*
>
> 201, 2nd Floor, Beaumont Plaza, Beaumont Road, Karachi-75530, Pakistan.
> *U* + 92 21 111-AVANZA (282-692) (XYZ)
> *M* + 92 3342619847
> *F* + 92 21 35675244
> *E* shafique.rehman@avanzasolutions.com
> *W*
>
> www.avanzasolutions.com
>
>
>
>
> <http://www.facebook.com/avanzasolutionsme>
> <https://twitter.com/avanzasolutions>
> <http://www.linkedin.com/company/avanza-solutions>
> ------------------------------
> *This email and its attachments may be confidential and are intended and
> solely for the use of the individual to whom it is addressed. Any views or
> opinions expressed are solely those of the author and do not necessarily
> represent those of Avanza Solutions. If you are not the intended recipient
> of this email and its attachments, you must take no action based upon them.
> Nor must you copy or show them to anyone. Please contact the sender if you
> believe you have received this email in error.*

Mime
View raw message