Cannot find bean: "emm.layout" in scope
Posted: Mon Feb 04, 2008 9:53 am
We have installed OpenEMM 5.3.1 on the following environment:
- AMD64
- Debian GNU/Linux 4.0
- Linux 2.6.18
- MySQL 4.1.22
- OpenEMM 5.3.1 und 5.3.2
- Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
- JDK Arch for 32 as well as 64bit testet
After that, we opened the user interface URL:
www.meinedomain.de:8080/logon.do?action=0
The following HTML output appeared:
An error occurred
Cause: javax.servlet.ServletException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "emm.layout" in scope: "request"
Info from the error log:
[17:43:27.706]javax.servlet.ServletException:
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot
find bean: "emm.layout" in scope: "request"
[17:43:27.706] at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
The UI redirects to logon.jsp regarding the action mapping of struts-config.xml
In the JSP file the following code ist placed before the <head> tag:
request.setAttribute("emm.layout", aLayout) does set the "baseURL" property of the following bean within the <head>:
<link rel="stylesheet" href="<bean:write name="emm.layout" property="baseUrl" scope="request"/>stylesheet.css">
The bean needs the image path "images/emm" (See openemm.sql dump) from the MySQL database. The query log shows the following query statement (we have formatted it for better reading):
Why does the query filters to Layout ID 196864 ? Isn´t that strange?
After we "hardcoded" the stylesheet directory "images/emm/" calling logon.jsp works. Now the standard username (admin) and passwort (openemm) does not work.
The problem was mentioned already in the following posts, but never resolved:
http://www.openemm.org/forums/viewtopic ... light=bean
http://www.openemm.org/forums/ftopic135.html
http://www.openemm.org/forums/ftopic133.html
Does somebody has an idea why the beans does not work?
- AMD64
- Debian GNU/Linux 4.0
- Linux 2.6.18
- MySQL 4.1.22
- OpenEMM 5.3.1 und 5.3.2
- Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
- JDK Arch for 32 as well as 64bit testet
After that, we opened the user interface URL:
www.meinedomain.de:8080/logon.do?action=0
The following HTML output appeared:
An error occurred
Cause: javax.servlet.ServletException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: "emm.layout" in scope: "request"
Info from the error log:
[17:43:27.706]javax.servlet.ServletException:
javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot
find bean: "emm.layout" in scope: "request"
[17:43:27.706] at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
The UI redirects to logon.jsp regarding the action mapping of struts-config.xml
In the JSP file the following code ist placed before the <head> tag:
Code: Select all
<%@ page language="java" import="java.util.*, [color=red]org.agnitas.beans.EmmLayout[/color], org.agnitas.web.*, org.apache.struts.action.*, org.agnitas.util.*, org.springframework.context.*, org.springframework.orm.hibernate3.*, org.springframework.web.context.support.WebApplicationContextUtils" pageEncoding="UTF-8"%>
<jsp:directive.page import="org.agnitas.beans.VersionObject"/>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<%
LogonForm aForm=(LogonForm)request.getAttribute("logonForm");
ApplicationContext aContext=WebApplicationContextUtils.getWebApplicationContext(application);
HibernateTemplate aTemplate=new HibernateTemplate((org.hibernate.SessionFactory)aContext.getBean("sessionFactory"));
[color=red]EmmLayout aLayout=(EmmLayout)AgnUtils.getFirstResult(aTemplate.find("from EmmLayout where companyID=0 and layoutID=?", new Integer(aForm.getLayout())));
request.setAttribute("emm.layout", aLayout);[/color]
VersionObject latestVersion = ( VersionObject )request.getAttribute( "latestVersion" );
boolean isLatestVersion = true;
if ( latestVersion != null && !latestVersion.isLatestVersion() ) {
isLatestVersion = false;
}
%>
<link rel="stylesheet" href="<bean:write name="emm.layout" property="baseUrl" scope="request"/>stylesheet.css">
The bean needs the image path "images/emm" (See openemm.sql dump) from the MySQL database. The query log shows the following query statement (we have formatted it for better reading):
Code: Select all
SELECT
emmlayout0_.layout_id AS layout1_6_,
emmlayout0_.company_id AS company2_6_,
emmlayout0_.header_url AS header3_6_,
emmlayout0_.footer_url AS footer4_6_,
emmlayout0_.base_url AS base5_6_,
emmlayout0_.normal_color AS normal6_6_,
emmlayout0_.highlight_color AS highlight7_6_
FROM
emm_layout_tbl emmlayout0_
WHERE
emmlayout0_.company_id=0
AND emmlayout0_.layout_id=196864
After we "hardcoded" the stylesheet directory "images/emm/" calling logon.jsp works. Now the standard username (admin) and passwort (openemm) does not work.
The problem was mentioned already in the following posts, but never resolved:
http://www.openemm.org/forums/viewtopic ... light=bean
http://www.openemm.org/forums/ftopic135.html
http://www.openemm.org/forums/ftopic133.html
Does somebody has an idea why the beans does not work?