[MAGNOLIA-554] exception in Config/modules/templating/Templates Created: 22/Sep/05  Updated: 23/Jan/13  Resolved: 17/May/06

Status: Closed
Project: Magnolia
Component/s: admininterface
Affects Version/s: 2.1 Final
Fix Version/s: 3.0 RC1

Type: Bug Priority: Major
Reporter: Alexandru Popescu Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia 2.1 with Tomcat bundle
JDK 1.5.0_04(5)
Win XP SP2
Firefox 1.0.6


Attachments: Text File patch.txt    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Trying to understand how I can create a new template (and more deeper how I can bind info to
different types) I have reached the following exception (see below).

Scenario:

1/ login as superuser
2/ go to Config/modules/templating/Templates
3/ create a new Content node
4/ create a new node data

My env:
Magnolia 2.1 with Tomcat bundle
JDK 1.5.0_04(5)
Win XP SP2
Firefox 1.0.6

Exception stacktrace:

INFO info.magnolia.cms.beans.config.Template Template.java(update:95) 19.09.20
05 12:07:21 Config : loading Template info - modules/templating
WARN org.apache.jackrabbit.core.observation.ObservationManagerFactory Observat
ionManagerFactory.java(run:162) 19.09.2005 12:07:21 EventConsumer threw excepti
on: java.lang.NullPointerException
ERROR info.magnolia.cms.exchange.simple.Syndicator Syndicator.java(deActivate:2
62) 19.09.2005 12:07:45 Failed to remove [ /modules/templating/Templates/sample
Template/untitled ] from [ localhost:8081/magnoliaPublic ]
ERROR info.magnolia.cms.exchange.simple.Syndicator Syndicator.java(deActivate:2
63) 19.09.2005 12:07:45 modules/templating/Templates/sampleTemplate/untitled
javax.jcr.PathNotFoundException: modules/templating/Templates/sampleTemplate/unt
itled
at org.apache.jackrabbit.core.NodeImpl.getNode(NodeImpl.java:2212)
at info.magnolia.cms.core.Content.<init>(Content.java:110)
at info.magnolia.cms.core.HierarchyManager.getContent(HierarchyManager.java:258)
at info.magnolia.cms.exchange.simple.Syndicator.updateDeActivationDetails(Syndicator.java:363)
at info.magnolia.cms.exchange.simple.Syndicator.deActivate(Syndicator.java:280)
at info.magnolia.cms.exchange.simple.Syndicator.deActivate(Syndicator.java:259)
at info.magnolia.cms.exchange.simple.Syndicator.deActivate(Syndicator.java:220)
at info.magnolia.cms.gui.control.Tree.deActivateNode(Tree.java:918)
at info.magnolia.cms.gui.control.Tree.renameNode(Tree.java:827)
at info.magnolia.module.admininterface.AdminTreeMVCHandler.rename(AdminTreeMVCHandler.java:302)
at
info.magnolia.module.admininterface.AdminTreeMVCHandler.saveValue(AdminTreeMVCHandler.java:272)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at info.magnolia.cms.servlets.MVCServletHandlerImpl.execute(MVCServletHa
ndlerImpl.java:70)
at info.magnolia.cms.servlets.MVCServlet.doGet(MVCServlet.java:108)
at info.magnolia.cms.servlets.MVCServlet.doPost(MVCServlet.java:48)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applica
tionDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:312)
at info.magnolia.cms.servlets.EntryServlet.redirect(EntryServlet.java:21
4)
at info.magnolia.cms.servlets.EntryServlet.doGet(EntryServlet.java:126)
at info.magnolia.cms.servlets.EntryServlet.doPost(EntryServlet.java:182)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
at info.magnolia.cms.filters.SecurityFilter.doFilter(SecurityFilter.java
:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
at info.magnolia.cms.filters.MultipartRequestFilter.doFilter(MultipartRe
questFilter.java:80)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilte
r.java:65)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16
0)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:683)
at java.lang.Thread.run(Thread.java:595)
INFO info.magnolia.cms.gui.control.Tree Tree.java(renameNode:830) 19.09.2005 1
2:07:45 Moving node from /modules/templating/Templates/sampleTemplate/untitled
to /modules/templating/Templates/sampleTemplate/name
INFO info.magnolia.cms.beans.config.Template Template.java(reload:113) 19.09.2
005 12:07:46 Config : re-initializing Template info
INFO info.magnolia.cms.beans.config.Template Template.java(init:87) 19.09.2005
12:07:46 Config : initializing Template info
INFO info.magnolia.cms.beans.config.Template Template.java(update:95) 19.09.20
05 12:07:46 Config : loading Template info - modules/templating
WARN org.apache.jackrabbit.core.observation.ObservationManagerFactory Observat
ionManagerFactory.java(run:162) 19.09.2005 12:07:46 EventConsumer threw excepti
on: java.lang.NullPointerException

By looking at the trace it seems like it has tryied to push the modification to the public instance,
which obvisouly doesn't have any of the above nodes.



 Comments   
Comment by Alexandru Popescu [ 22/Sep/05 ]

More details can be found on the thread: http://thread.gmane.org/gmane.comp.cms.magnolia.devel/3889

Comment by Alexandru Popescu [ 02/Oct/05 ]

It seems that the correct behavior/implementation is done for "folders" created under /Config/modules/templating/dialogs. The above scenario repeated here doesn't result in an exception. From the log it seems that here the operation is "move" node from untitled to new_name; while in the exception case the operation is "remove" untitled node.

Comment by Alexandru Popescu [ 02/Oct/05 ]

Same as above is true for Content Nodes. So the only failing scenario is the New Node Data + set Node Data name (an additional remove operation is done for the */untitled Node Data).

Comment by Alexandru Popescu [ 04/Oct/05 ]

This patch is solving the issue and also is changing the behavior according to the previous mentioned discussion:

1/ a new "untitled" node is not immediately saved; it will be saved only when he is named (so on renameNode)
2/ desactivation is not trigger for innexistent nodes

Comment by Alexandru Popescu [ 05/Oct/05 ]

I was asked how the patch is behaving in the following scenario:

1/ a new page is created (=> page is "untitled")
2/ the author starts editing and saving content
3/ close author session

Considering that a save triggers a Session.save() any nodes in transient state are saved, the same happens to the untitle page. The author will not loose his work.

In fact considering the above Session.save() any other action that will trigger the mentioned Session.save() will save also the "untitled" node.

Comment by Sameer Charles [ 05/Oct/05 ]

updated on current trunk

Comment by Philipp Bracher [ 06/Oct/05 ]

Warning: Is this realy the wanted solution for this problem. We discussed it here once and my favorite solutions was:

  • creation of a page, user, role opens a create dialog (like in all other applications in the world)
  • There you pass all the required informations
  • After a validation the node gets created (or canceled if the user closes the dialog)

I think we should not start to add temporary nodes to the session. From where should a user know that this node will magically disappear after opening a new browser? This is confusing.

If there are no other strong pros I would like to remove the patch.

Comment by Sameer Charles [ 06/Oct/05 ]

When we will move to different gui this will change anyways, I prefer if we can have a separate dialog to create a page and persist it when
all properties are set.
So you can revert these changes!

for another issue where it raised an exception on rename - I overlooked the path because it did not really solve the problem
we moved this.deActivateNode(this.getPath()); [line 845] to if (hm.isExist(dest)) {} construct which simply checks if the destination exist
on "this" instance of a workspace. But this exception was raised by the subscriber while trying to deactivate.
So the sollution would be to de-activate only if this node was ever activated before.

Comment by Alexandru Popescu [ 06/Oct/05 ]

Philipp as described in the previous comments the patch is solving one problem and as an addition creates this behavior. I would strongly recommend at least the preservation of the part solving the issue.

./alex

.w( the_mindstorm )p.

Comment by Alexandru Popescu [ 06/Oct/05 ]

About Sameer comment: indeed should check about the previous/source path (if the source path was ever activated). But it looks like there is no way to have this information.

./alex

.w( the_mindstorm )p.

Comment by Alexandru Popescu [ 06/Oct/05 ]

What would probably solve this is my enhancement request for adding state (and maybe more) to ContentHandler. (see http://webmail.magnolia.info/Lists/dev-list/Message/4544.html)

./alex

.w( the_mindstorm )p.

Comment by Sameer Charles [ 06/Oct/05 ]

This is a problem the way GUI handles creation of new nodes, we sould not try patch it in core

The patch from Alex solved this problem by keeping a node in transient state upless something added to it or renamed.
I dont think there will be any confusion because of that.
I still prefer having a separate dialog as philipp said, so the best sollution would be to have a dialog which lets you create and set properties before persisting a node.

If we can do it that's perfect, if not. Lets keep the way it is at the moment.

  • Sameer
Comment by Alexandru Popescu [ 06/Oct/05 ]

Sameer maybe you can change its state from Resolved to something else, just to be assured that we will revisit it later.

my 2c,

./alex

.w( the_mindstorm )p.

Comment by Philipp Bracher [ 06/Oct/05 ]

reopened

Comment by Philipp Bracher [ 20/Oct/05 ]

I removed the patch since the patch for 582 solves this too.

Still we have the following exceptions.

WARN org.apache.jackrabbit.core.observation.ObservationManagerFactory Observat
ionManagerFactory.java(run:162) 19.09.2005 12:07:21 EventConsumer threw excepti
on: java.lang.NullPointerException

This is thrown because the reloading of the Templates fails

Comment by Philipp Bracher [ 17/May/06 ]

The reloading in the ObservedManager should take care about missing (moved) nodes.

Generated at Mon Feb 12 03:18:34 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.