[MGNLDMS-8] "Context Not Set, defaulting to System Context" Exception In Document Management System - Any specific configuration need to be made? Created: 26/Oct/06  Updated: 17/Mar/09  Resolved: 26/Oct/06

Status: Closed
Project: Document Management System (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1

Type: Bug Priority: Critical
Reporter: david hickman Assignee: Philipp Bärfuss
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows XP, JDK 1.5.0


Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

We upgraded our magnolia application instance from "Magnolia 3.0-rc2-SNAPSHOT" to "Magnolia-3.0-rc3". In the "Magnolia 3.0-rc2-SNAPSHOT" version, we customized the Document List Tree module by extending the classes in the magnolia API.

The documents list is shown properly in the "3.0-rc2-SNAPSHOT" version but in the new version an exception is thrown saying "Context is not set, defaulting to System Context". Should we make any specific configuration specifying the Context?

Here are the details related to the classes:

  • class AzulTree extends info.magnolia.cms.gui.control.Tree
  • class AzulTreeConfig extends info.magnolia.module.dms.DMSAdminTreeConfig
  • class AzulTreeHandler extends info.magnolia.module.dms.DMSAdminTree
  • class AzulTreeControl extends AzulTree

EXCEPTION DETAILS:

WARN info.magnolia.context.MgnlContext MgnlContext.java(getInstance:293) 26.10.2006 07:20:57 Context is not set, defaulting to System Context

java.lang.Exception
at info.magnolia.context.MgnlContext.getInstance(MgnlContext.java:293)
at info.magnolia.cms.util.AlertUtil.isMessageSet(AlertUtil.java:78)
at info.magnolia.cms.util.FreeMarkerUtil.process(FreeMarkerUtil.java:119)
at info.magnolia.cms.util.FreeMarkerUtil.process(FreeMarkerUtil.java:61)
at com.xumak.handler.tree.AzulTree.getHtmlFooter(AzulTree.java:594)
at com.xumak.handler.tree.AzulTree.getHtml(AzulTree.java:567)
at info.magnolia.module.admininterface.AdminTreeMVCHandler.renderTree(AdminTreeMVCHandler.java:769)

at info.magnolia.module.admininterface.AdminTreeMVCHandler.rend_erhtml(AdminTreeMVCHandler.java:721)

at c om .xumak.handler.tree.AzulTreeHandler.getHtml(AzulTreeHandler.java:35)

at org.apache.jsp.templates.ascs.templates.documentList.documentListC om ponent_jsp._jspService(documentListC om ponent_jsp.java:76)



 Comments   
Comment by Sameer Charles [ 26/Oct/06 ]

Its not a Bug!

Its a bug in your templates or application which does not set context properly. with next release it wont default to system context and simply break the request.
You must set MgnlContext properly if you are using custom servlets or direct jsp calls.

Comment by Philipp Bracher [ 26/Oct/06 ]

If you are calling a jsp directly as you do here: ponent.jsp you need to set the context. In this case just use MgnlContext.initWebContext(request)

Comment by david hickman [ 26/Oct/06 ]

Thanks for the feedback. The issue is, it was working fine with version Magnolia 3.0-rc2-SNAPSHOT. This issue came up when we are ugrading to Magnolia-3.0-rc3. When you say set Context properly, you mean this has to be set in MgnlContext.java file or do I set in the JSP page ? While debugging the error, I observed after calling setInstance function in MgnlContext, the context is becoming null. I am not sure whats causing this. Please let me know if I am missing anything.

Comment by Sameer Charles [ 26/Oct/06 ]

It should be something like if you are creating a new mgnl context instance

WebContext ctx = (WebContext) FactoryUtil.newInstance(WebContext.class);
ctx.init(request);
MgnlContext.setInstance(ctx);

Comment by david hickman [ 27/Oct/06 ]

Thanks for the code.

We added the below specified code in the jsp page and now the application is not throwing the "Context not set - defaulting to System Context" exception. But the Document Tree is only displaying the parent directory folders which are created under the dms (document management system). It's not showing the end child nodes (documents) when click on a particular parent folder. In fact, it is showing multiple copies of parent folders when we click on a particular parent folder

WebContext webContext = (WebContext) FactoryUtil.getInstance(WebContext.class);
webContext.init(request);
MgnlContext.setInstance(webContext);

Do we need to make any other configurations or set other some values?

Comment by Boris Kraft [ 27/Oct/06 ]

No bug of ours.

Comment by david hickman [ 27/Oct/06 ]

This was working fine in the version - Magnolia 3.0-rc2-SNAPSHOT. But does not work with the version - Magnolia-3.0-rc3, where its showing the parent folders again when I try to expand a folder. Do we need any different setting for the Magnolia-3.0-rc3 to display the documents properly.

Comment by david hickman [ 27/Oct/06 ]

One more thing I observed while debugging the code is, the path settings are completely ignored when the document tree is displayed. I am passing in parameter "path=documents" to display matching URL folders. But this completely ignored and it shows all the folders in the document tree. Am I missing anything or anything has to be configured?

Comment by david hickman [ 27/Oct/06 ]

Is there any support contact number I can call to get the issue resolved? This issue is delaying the production rollout of the new Magnolia version.

Generated at Mon Feb 12 00:47:33 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.