If you encounter this error when trying to enter license information:
java.lang.RuntimeException: javax.jcr.PathNotFoundException: modules/enterprise/license info.magnolia.enterprise.registration.RegistrationFilter.doFilter(RegistrationFilter.java:61) |
- Stop Magnolia CMS.
Copy the following JSP script and save it to your
docroot
folder, for example<apache-tomcat>/webapps/magnoliaAuthor/docroot/license-script.jsp
.<%@ page contentType="text/plain" %>
<%@ page import="info.magnolia.importexport.BootstrapUtil"%>
<%@ page import="info.magnolia.context.*"%>
<%@ page import="info.magnolia.cms.util.ContentUtil"%>
<%@ page import="info.magnolia.cms.core.HierarchyManager"%>
<%@ page import="javax.jcr.Node"%>
<%@ page import="javax.jcr.ImportUUIDBehavior"%>
<%
info.magnolia.context.MgnlContext.setInstance(new info.magnolia.context.SingleJCRSessionSystemContext());
try{
BootstrapUtil.bootstrap(new String[]{"
/mgnl-bootstrap/enterprise/config.modules.enterprise.license.xml
"},ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW);
HierarchyManager hm = MgnlContext.getHierarchyManager("config");
hm.save();
} catch (Exception e) {
System.out.println(e);
}
System.out.println("finished");
%>
Open
<apache-tomcat>/webapps/magnoliaAuthor/WEB-INF/web.xml
in a text editor.Comment out the
<filter>
and<filter-mapping>
sections.<!-- filter>
<display-name>Magnolia global filters</display-name>
<filter-name>magnoliaFilterChain</filter-name>
<filter-class>info.magnolia.cms.filters.MgnlMainFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>magnoliaFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping -->
This will also disable the URI security filter, making your system vulnerable. Use a firewall or Apache Web Server in front of your application server to prevent unauthorized access while you do this.
- Save the
web.xml
file. - Start Magnolia CMS.
Request the JSP script at http://localhost:8080/magnoliaAuthor/docroot/license-script.jsp.
- Stop Magnolia CMS.
- Uncomment the
<filter>
and<filter-mapping>
sections in theweb.xml
. (Undo step 4). - Start Magnolia CMS.
- That should have recreated the node. Try and enter the license information again.