You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by bilobag <bi...@hotmail.com> on 2007/07/11 16:05:34 UTC

Node remove. Removing reference property problem.

Hi have defined the following custom node:

[ng:file] > ng:content,  mix:versionable
	orderable
 -	ng:filename	(string)		mandatory
 - 	ng:filesize	(long)
 + 	jcr:content		(nt:resource)	primary mandatory
 + * (ng:comment) = ng:comment multiple version 


I have successfully added a ng:file node with a jcr:content file as a
reference property.  However, when call the following code:


Node jcrNode = getJcrDAO().getNodeByUUID(uuid);
jcrNode.remove();
getJcrDAO().save();


I get the following exception on the save:


org.apache.jackrabbit.core.state.NoSuchItemStateException:
09d25013-044a-47bd-95bf-98b722a33dc6
	at
org.apache.jackrabbit.core.state.SharedItemStateManager.getNodeReferences(SharedItemStateManager.java:332)
	at
org.apache.jackrabbit.core.state.SharedItemStateManager.updateReferences(SharedItemStateManager.java:1317)
	at
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:550)
	at
org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:825)
	at
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:855)
	at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:326)
	at
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
	at
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:302)
	at
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:306)
	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1214)
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849)
	at org.springmodules.jcr.JcrTemplate$23.doInJcr(JcrTemplate.java:461)
	at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
	at org.springmodules.jcr.JcrTemplate.save(JcrTemplate.java:456)
	at org.bmpcoe.cwe5.dao.impl.JcrBaseDAO.save(JcrBaseDAO.java:138)
	at
org.bmpcoe.cwe5.service.impl.NodeServiceImpl.removeNode(NodeServiceImpl.java:87)
	at
org.bmpcoe.cwe5.webapp.action.TestPageBean.getTestGetFile(TestPageBean.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
	at
com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
	at
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
	at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
	at javax.faces.component.UICommand.broadcast(UICommand.java:109)
	at
org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
	at
org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
	at
org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
	at
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
	at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:61)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
	at
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.springmodules.jcr.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:93)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
	at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
	at java.lang.Thread.run(Unknown Source)


Now, i assumed that when i remove the ng:file node, that the jcr:content
reference property would also be removed.  Is this correct?  Do I need to
remove the reference property first?  If so, what is the reasoning behind
this?  The exception i get points to a process that checks the state of the
repository, but for some reason it can't find the jcr:content reference node
property.  Is this because I just removed it?  If so, why is it trying to
get a reference to it.  Any help is appreciated.  Thanks.


-- 
View this message in context: http://www.nabble.com/Node-remove.--Removing-reference-property-problem.-tf4062111.html#a11540955
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.


Re: Node remove. Removing reference property problem.

Posted by Marcel Reutegger <ma...@gmx.net>.
bilobag wrote:
> Right now i have the schemaObjectPrefix for my workspace and versioning set
> to the same value.

this will definitively not work. each persistence manager needs its own unique 
schemaObjectPrefix.

> I am about to try having different prefixes, however, i
> assumed that the persistenceManagers would  use different table names even if
> the prefixes are set to be the same.

that's unfortunately a wrong assumption.

> Do both persistenceManagers use the
> same table names?

if the schemaObjectPrefix is the same then the resulting table names will be the 
same.

please start with this example configuration and only change what is necessary 
for your setup:

http://svn.apache.org/repos/asf/jackrabbit/tags/1.3/jackrabbit-core/src/main/config/repository.xml

Information on how to configure the OraclePersistenceManager can be found here:
http://jackrabbit.apache.org/api/1.3/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.html

regards
  marcel

Re: Node remove. Removing reference property problem.

Posted by bilobag <bi...@hotmail.com>.
I think you are on the right track.  After extensively looking through source
code it looks like jackrabbit has references to my ng:file node along with
the jcr:versionHistory and jcr:baseVersion etc...  My question is: Where is
my app storing this version information if I potentially have the versioning
persistence manager set up incorrectly?  Right now i have the
schemaObjectPrefix for my workspace and versioning set to the same value.  I
am about to try having different prefixes, however, i assumed that the
persistenceManagers would  use different table names even if the prefixes
are set to be the same.  Do both persistenceManagers use the same table
names?  The following is my repository.xml config.  Please advise.  Thanks!


<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD
Jackrabbit 1.2//EN"
                           
"http://jackrabbit.apache.org/dtd/repository-1.2.dtd">
<!-- Example Repository Configuration File -->
<Repository>
	
    <!--
        virtual file system where the repository stores global state
        (e.g. registered namespaces, custom node types, etc.)
    -->
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        
    </FileSystem>

    <!--
        security configuration
    -->
    <Security appName="testApp">
        <!--
            access manager:
            class: FQN of class implementing the AccessManager interface
        -->
        <AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager">
            <!--  -->
        </AccessManager>

        <LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule">
           <!-- anonymous user name ('anonymous' is the default value) -->
           
           <!--
              default user name to be used instead of the anonymous user
              when no login credentials are provided (unset by default)
           -->
           <!--  -->
        </LoginModule>
    </Security>

    <!--
        location of workspaces root directory and name of default workspace
    -->
    <Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default"/>
    <!--
        workspace configuration template:
        used to create the initial workspace if there's no workspace yet
    -->
    <Workspace name="@wsp.name@">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            
        </FileSystem>

		<!--     PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager">
          
          
        </PersistenceManager  -->
        
        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
            
            
            
            
            
            
        </PersistenceManager>
        
        <!-- Causes an exception.  need to figure out why.
        <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            
        </SearchIndex>
        -->
    </Workspace>

    <!--
        Configures the versioning
    -->
    <Versioning rootPath="${rep.home}/version">
        <FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            
        </FileSystem>

        <PersistenceManager
class="org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager">
            
            
            
            
            
            
        </PersistenceManager>
    </Versioning>

	<!-- Causes an exception.  need to figure out why.
    <SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        
    </SearchIndex>
    -->
</Repository>




Marcel Reutegger wrote:
> 
> just a wild guess, but can you please check if the persistence manager for 
> versioning is configured properly. e.g. the schemaObjectPrefix should be 
> something like:
> 
> 
> 
> regards
>   marcel
> 
> bilobag wrote:
>> So after some more research I realized that it is throwing an exception
>> because for some reason jackrabbit is calling
>> SharedItemStateManager.getNodeReferences() to find a reference to one of
>> the
>> version history nodes.  Now it looks like it checks the persistent
>> manager
>> first and then checks the virtual providers for a reference to this
>> version
>> node.  Now, I am using an oracle db for my persistent mgr and when I
>> check
>> the REFS table, there are no rows in there.  I know versionable nodes
>> contains reference properties, but it seems like they aren't stored in
>> the
>> database REFS table.  Is this correct?  So this error occurs when i try
>> to
>> remove my ng:file node which is versionable and contains an nt:resource
>> property.  To me, it looks like either my repository isn't storing the
>> node
>> references in the db or virtual providers when i add the node, or when i
>> remove the ng:file node, the references get deleted and for some reason
>> jackrabbit tries to access them after they are deleted and can not save. 
>> Please advise, i have been looking at this for days now.  Thanks.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Node-remove.--Removing-reference-property-problem.-tf4062111.html#a11579709
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.


Re: Node remove. Removing reference property problem.

Posted by Marcel Reutegger <ma...@gmx.net>.
just a wild guess, but can you please check if the persistence manager for 
versioning is configured properly. e.g. the schemaObjectPrefix should be 
something like:

<param name="schemaObjectPrefix" value="version_"/>

regards
  marcel

bilobag wrote:
> So after some more research I realized that it is throwing an exception
> because for some reason jackrabbit is calling
> SharedItemStateManager.getNodeReferences() to find a reference to one of the
> version history nodes.  Now it looks like it checks the persistent manager
> first and then checks the virtual providers for a reference to this version
> node.  Now, I am using an oracle db for my persistent mgr and when I check
> the REFS table, there are no rows in there.  I know versionable nodes
> contains reference properties, but it seems like they aren't stored in the
> database REFS table.  Is this correct?  So this error occurs when i try to
> remove my ng:file node which is versionable and contains an nt:resource
> property.  To me, it looks like either my repository isn't storing the node
> references in the db or virtual providers when i add the node, or when i
> remove the ng:file node, the references get deleted and for some reason
> jackrabbit tries to access them after they are deleted and can not save. 
> Please advise, i have been looking at this for days now.  Thanks.


Re: Node remove. Removing reference property problem.

Posted by bilobag <bi...@hotmail.com>.
So after some more research I realized that it is throwing an exception
because for some reason jackrabbit is calling
SharedItemStateManager.getNodeReferences() to find a reference to one of the
version history nodes.  Now it looks like it checks the persistent manager
first and then checks the virtual providers for a reference to this version
node.  Now, I am using an oracle db for my persistent mgr and when I check
the REFS table, there are no rows in there.  I know versionable nodes
contains reference properties, but it seems like they aren't stored in the
database REFS table.  Is this correct?  So this error occurs when i try to
remove my ng:file node which is versionable and contains an nt:resource
property.  To me, it looks like either my repository isn't storing the node
references in the db or virtual providers when i add the node, or when i
remove the ng:file node, the references get deleted and for some reason
jackrabbit tries to access them after they are deleted and can not save. 
Please advise, i have been looking at this for days now.  Thanks.



bilobag wrote:
> 
> Hi have defined the following custom node:
> 
> [ng:file] > ng:content,  mix:versionable
> 	orderable
>  -	ng:filename	(string)		mandatory
>  - 	ng:filesize	(long)
>  + 	jcr:content		(nt:resource)	primary mandatory
>  + * (ng:comment) = ng:comment multiple version 
> 
> 
> I have successfully added a ng:file node with a jcr:content file as a
> reference property.  However, when call the following code:
> 
> 
> Node jcrNode = getJcrDAO().getNodeByUUID(uuid);
> jcrNode.remove();
> getJcrDAO().save();
> 
> 
> I get the following exception on the save:
> 
> 
> org.apache.jackrabbit.core.state.NoSuchItemStateException:
> 09d25013-044a-47bd-95bf-98b722a33dc6
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.getNodeReferences(SharedItemStateManager.java:332)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.updateReferences(SharedItemStateManager.java:1317)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:550)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:825)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:855)
> 	at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:326)
> 	at
> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
> 	at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:302)
> 	at
> org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:306)
> 	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1214)
> 	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849)
> 	at org.springmodules.jcr.JcrTemplate$23.doInJcr(JcrTemplate.java:461)
> 	at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
> 	at org.springmodules.jcr.JcrTemplate.save(JcrTemplate.java:456)
> 	at org.bmpcoe.cwe5.dao.impl.JcrBaseDAO.save(JcrBaseDAO.java:138)
> 	at
> org.bmpcoe.cwe5.service.impl.NodeServiceImpl.removeNode(NodeServiceImpl.java:87)
> 	at
> org.bmpcoe.cwe5.webapp.action.TestPageBean.getTestGetFile(TestPageBean.java:243)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
> 	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
> 	at
> com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
> 	at
> com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
> 	at
> org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
> 	at javax.faces.component.UICommand.broadcast(UICommand.java:109)
> 	at
> org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
> 	at
> org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
> 	at
> org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
> 	at
> org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
> 	at
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
> 	at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:61)
> 	at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
> 	at
> org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> 	at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.springmodules.jcr.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:93)
> 	at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 
> Now, i assumed that when i remove the ng:file node, that the jcr:content
> reference property would also be removed.  Is this correct?  Do I need to
> remove the reference property first?  If so, what is the reasoning behind
> this?  The exception i get points to a process that checks the state of
> the repository, but for some reason it can't find the jcr:content
> reference node property.  Is this because I just removed it?  If so, why
> is it trying to get a reference to it.  Any help is appreciated.  Thanks.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Node-remove.--Removing-reference-property-problem.-tf4062111.html#a11562103
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.


Re: Node remove. Removing reference property problem.

Posted by bilobag <bi...@hotmail.com>.
Thanks a lot of the help....i've been working on this for days now.  That
seemed to be the issue.  however it looks like my repository is corrupted
now because of my original configuration.  Is there a good way to clean out
my repository?  Or do I just delete all of my db tables?



bilobag wrote:
> 
> Hi have defined the following custom node:
> 
> [ng:file] > ng:content,  mix:versionable
> 	orderable
>  -	ng:filename	(string)		mandatory
>  - 	ng:filesize	(long)
>  + 	jcr:content		(nt:resource)	primary mandatory
>  + * (ng:comment) = ng:comment multiple version 
> 
> 
> I have successfully added a ng:file node with a jcr:content file as a
> reference property.  However, when call the following code:
> 
> 
> Node jcrNode = getJcrDAO().getNodeByUUID(uuid);
> jcrNode.remove();
> getJcrDAO().save();
> 
> 
> I get the following exception on the save:
> 
> 
> org.apache.jackrabbit.core.state.NoSuchItemStateException:
> 09d25013-044a-47bd-95bf-98b722a33dc6
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.getNodeReferences(SharedItemStateManager.java:332)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.updateReferences(SharedItemStateManager.java:1317)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager$Update.begin(SharedItemStateManager.java:550)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.beginUpdate(SharedItemStateManager.java:825)
> 	at
> org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:855)
> 	at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:326)
> 	at
> org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:313)
> 	at
> org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:302)
> 	at
> org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:306)
> 	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1214)
> 	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849)
> 	at org.springmodules.jcr.JcrTemplate$23.doInJcr(JcrTemplate.java:461)
> 	at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
> 	at org.springmodules.jcr.JcrTemplate.save(JcrTemplate.java:456)
> 	at org.bmpcoe.cwe5.dao.impl.JcrBaseDAO.save(JcrBaseDAO.java:138)
> 	at
> org.bmpcoe.cwe5.service.impl.NodeServiceImpl.removeNode(NodeServiceImpl.java:87)
> 	at
> org.bmpcoe.cwe5.webapp.action.TestPageBean.getTestGetFile(TestPageBean.java:243)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
> 	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
> 	at
> com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
> 	at
> com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
> 	at
> org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
> 	at javax.faces.component.UICommand.broadcast(UICommand.java:109)
> 	at
> org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
> 	at
> org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
> 	at
> org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
> 	at
> org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
> 	at
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
> 	at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:61)
> 	at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
> 	at
> org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> 	at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.springmodules.jcr.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:93)
> 	at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Unknown Source)
> 
> 
> Now, i assumed that when i remove the ng:file node, that the jcr:content
> reference property would also be removed.  Is this correct?  Do I need to
> remove the reference property first?  If so, what is the reasoning behind
> this?  The exception i get points to a process that checks the state of
> the repository, but for some reason it can't find the jcr:content
> reference node property.  Is this because I just removed it?  If so, why
> is it trying to get a reference to it.  Any help is appreciated.  Thanks.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Node-remove.--Removing-reference-property-problem.-tf4062111.html#a11580846
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.