jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: OCM exceptions: IncorrectPersistentClassException & RepositoryException caused by NoSuchItemStateException
Date Mon, 04 Aug 2008 13:46:23 GMT
Is it not related to this issue :
https://issues.apache.org/jira/browse/JCR-1426
Let me know if you need more help.

br,
Christophe

On Fri, Aug 1, 2008 at 17:04, H. Wilson <wilsonh@randdss.com> wrote:

> I am including both these errors in one post, because I have a hunch they
> are related. If it was a mistake to do so even if they were related, please
> let me know for future reference.
>
> I am working with OCM, I have a single class that is being stored and
> versioned in the repository (see below). My first error is when I try to get
> an instance of this class by version (it works fine if I do just a getObject
> (path) ). The error is the IncorrectPersistentClassException due to no
> descriptor for nt:unstructured, which I don't think I am using. If I do need
> this, why? And how should I define it?
>
> I also have an error when I try to checkin the object after updating
> (checkout, getObject, modify it, update, save appear to work fine.). The
> error is the RepositoryException caused by NoSuchItemStateException. I have
> included what I think is the relevant information below. Using Jackrabbit
> 1.4 with 1.4.2 core. I would certainly appreciate any input - on either
> error.
>
> H. Wilson
>
>
> ================= Class ========================
>
> @Node (jcrMixinTypes="mix:versionable")
>
> public class SomeClass {
>
>   @Field(path=true) private String path;
>   @Field private Date lastUpdate;
>   @Field private String someString;
>
>   @Field private byte[] document;
>   @Field private double value;
>   @Field private String fullName;
>   @Field private long updateInterval;
>   @Collection (elementClassName=java.lang.String.class,
> collectionConverter=MultiValueCollectionConverterImpl.class) private
> java.util.Collection keywords;
>
>   /**
>
>    * Default constructor.
>
>    */
>
>   public SomeClass() {}
>
> gets and sets...
>
>
>
> ================= CND File ========================
>
> <mix="http://www.jcp.org/jcr/mix/1.0">
>
> <nt="http://www.jcp.org/jcr/nt/1.0">
>
> <ocm="http://jackrabbit.apache.org/ocm">
>
> [ocm:discriminator]
>
> mixin
>
> - ocm:classname mandatory
>
>
>
> ================= Code Block - getObject (path, version)
>  ========================
>
>      SomeClass[] queryResults = null;
>
>       QueryManager queryManager = ocm.getQueryManager();
>
>       Filter filter = queryManager.createFilter (SomeClass.class);
>
>       filter.addLike ("fullName", fullNameString);
>
>       Query query = queryManager.createQuery (filter);
>
>       Collection<SomeClass> resultsCollection =
> (Collection<SomeClass>)ocm.getObjects(query);    //This works fine.
>
>       queryResults = resultsCollection.toArray (new
> SomeClass[resultsCollection.size()]);
>
>          for  (SomeClass result : queryResults ) {
>
>               VersionIterator versionIterator = null;
>
>               try {
>
>                   versionIterator = ocm.getAllVersions (result.getPath());
>
>                   String versionNumber = null;
>
>                   if ( versionIterator.getSize() > 0 ) {
>
>                       while ( versionIterator.hasNext() ) {
>
>                           Version version =
> (Version)versionIterator.next();
>
>                           SomeClass versionedParam =
> (SomeClass)ocm.getObject ( result.getPath(), version.getName());    //IT
> DIES HERE
>
> ........
>
>
> ================= Exception  ========================
> [java] [ INFO]:CollectionManager(296): Filter: jcr:like(@fullName,
> 'AFullName')
>    [java] [ INFO]:CollectionManager(302): num results = 1
>    [java] [ INFO]:CollectionManager(308): Result fullname: AFullName
>    [java] [DEBUG]:CollectionManager(324): num versions = 1
>    [java] [DEBUG]:CollectionManager(335): fetching path:
> /Path/To/SomeClass, version:jcr:rootVersion
>    [java] [ERROR]:CollectionManager(182): Node type: nt:unstructured has no
> descriptor.
>    [java]
> org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException: Node
> type: nt:unstructured has no descriptor.
>    [java]     at
> org.apache.jackrabbit.ocm.mapper.impl.AbstractMapperImpl.getClassDescriptorByNodeType(AbstractMapperImpl.java:188)
>    [java]     at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.getObject(ObjectConverterImpl.java:293)
>    [java]     at
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObject(ObjectContentManagerImpl.java:313)
>    [java]     at
> CollectionManager.getSomeClassItems(CollectionManager.java:336)
>    [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>    [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>    [java]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>    [java]     at java.lang.reflect.Method.invoke(Method.java:597)
>    [java]     at bsh.Reflect.invokeMethod(Unknown Source)
>    [java]     at bsh.Reflect.invokeObjectMethod(Unknown Source)
>    [java]     at bsh.Name.invokeMethod(Unknown Source)
>    [java]     at bsh.BSHMethodInvocation.eval(Unknown Source)
>    [java]     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>    [java]     at bsh.BSHPrimaryExpression.eval(Unknown Source)
>    [java]     at bsh.Interpreter.eval(Unknown Source)
>    [java]     at bsh.Interpreter.source(Unknown Source)
>    [java]     at bsh.Interpreter.source(Unknown Source)
>    [java]     at CollectionManager.initiateRepo(CollectionManager.java:490)
>    [java]     at CollectionManager.<init>(CollectionManager.java:88)
>    [java]     at
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>    [java]     at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>    [java]     at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>
>    [java]     .....
>
> ================= Code Block - checkin (path) ========================
>
> public void updateSomeClassItem ( SomeClass parameter ) {
>
>       try {
>
>           SomeClass temp = (SomeClass)ocm.getObject(parameter.getPath());
>
>           temp.setFullName ("NewName");
>
>           ocm.checkout ( temp.getPath());
>
>           ocm.update (temp);
>
>           ocm.save();
>
>           ocm.checkin (temp.getPath());    //DIES HERE
>
>       }
>
>       catch (Exception e ) {
>
>           logger.error ( "Error");
>
>       }
>
>   }
>
> ================= Exception  ========================
> [java] [DEBUG]:CollectionManager(266): Successfully checked out param:
> /Path/To/SomeClass
>    [java] [DEBUG]:CollectionManager(268): updated
>    [java] [DEBUG]:CollectionManager(270): saved
>    [java] exception:
> org.apache.jackrabbit.ocm.exception.RepositoryException: Impossible to
> checkin the object /Path/To/SomeClass ; nested exception is
> javax.jcr.RepositoryException: /Path/To/SomeClass: unable to update item.:
> 86bb7b36-0ed3-44b5-bae9-132baa428c7e
>    [java] org.apache.jackrabbit.ocm.exception.RepositoryException:
> Impossible to checkin the object /Path/To/SomeClass; nested exception is
> javax.jcr.RepositoryException: /Path/To/SomeClass: unable to update item.:
> 86bb7b36-0ed3-44b5-bae9-132baa428c7e
>    [java] javax.jcr.RepositoryException: /Path/To/SomeClass: unable to
> update item.: 86bb7b36-0ed3-44b5-bae9-132baa428c7e:
> 86bb7b36-0ed3-44b5-bae9-132baa428c7e
>    [java]     at
> org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1258)
>    [java]     at
> org.apache.jackrabbit.core.NodeImpl.checkin(NodeImpl.java:2961)
>    [java]     at
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.checkin(ObjectContentManagerImpl.java:670)
>    [java]     at
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.checkin(ObjectContentManagerImpl.java:655)
>    [java]     at
> CollectionManager.updateSomeClassItem(CollectionManager.java:271)
>    [java]     at RemoteManager.updateSomeClassItem(RemoteManager.java:280)
>    [java]     at Tests.main(Tests.java:91)
>    [java] Caused by:
> org.apache.jackrabbit.core.state.NoSuchItemStateException:
> 86bb7b36-0ed3-44b5-bae9-132baa428c7e
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.getNodeReferences(SharedItemStateManager.java:330)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.updateReferences(SharedItemStateManager.java:1288)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:551)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:843)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:873)
>    [java]     at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:324)
>    [java]     at
> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
>    [java]     at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:300)
>    [java]     at
> org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:317)
>    [java]     at
> org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1250)
>    [java]     ... 6 more
>    [java] org.apache.jackrabbit.core.state.NoSuchItemStateException:
> 86bb7b36-0ed3-44b5-bae9-132baa428c7e
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.getNodeReferences(SharedItemStateManager.java:330)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.updateReferences(SharedItemStateManager.java:1288)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:551)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:843)
>    [java]     at
> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:873)
>    [java]     at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:324)
>    [java]     at
> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
>    [java]     at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:300)
>    [java]     at
> org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:317)
>    [java]     at
> org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1250)
>    [java]     at
> org.apache.jackrabbit.core.NodeImpl.checkin(NodeImpl.java:2961)
>    [java]     at
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.checkin(ObjectContentManagerImpl.java:670)
>    [java]     at
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.checkin(ObjectContentManagerImpl.java:655)
>    [java]     at
> CollectionManager.updateSomeClassItem(CollectionManager.java:271)
>    [java]     at RemoteManager.updateSomeClassItem(RemoteManager.java:280)
>    [java]     at Tests.main(Tests.java:91)
>
>

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