Openemm on tomcat anyone?
Moderator: moderator
Openemm on tomcat anyone?
I was wandering if anyone managed to make openemm work on tomcat and if so i would ask him to write a short howto
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
Tomcat vs. Resin
We are working on this. Problem is that servlet engine Resin and Tomcat do interpret some custom tags used in JSP pages slightly differently so that we would have to recode the tag classes (which could cause problems with Resin). Any insights welcome!
OpenEMM Maintainer
Any more info?
Any more information on getting OpenEMM running on Tomcat?
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
To use Tomcat 5.5 or 6.0 instead of Resin, first you have to modify web.xml:
- DTD = http://java.sun.com/dtd/web-app_2.3.dtd
- change "/*do" to "*.do"
- remove JSPServlet definition and mapping (this is already done in the global web.xml of Tomcat)
- change the order of the elements to context-param, filter, filter-mapping, listener, servlet, servlet-mapping, session-config, mime-mapping, welcome-file-list, error-page, taglib (because Tomcat is a little bit picky when interpreting the web.xml file)
Secondly you have to remove all Resin libraries from the classpath and add the Tomcat libraries like jsp-api.jar and servlet-api.jar as well as jta*.jar for transaction management.
Important: If you use Tomcat 5.5 and have problems with launching OpenEMM, you have to remove log4j.ja, because otherwise the log manager of Tomcat does not write all log entries (because of its singleton architecture). But to get OpenEMM finally running you have to add log4j.jar again (otherwise you will get an OpenSessionInViewFilter related error message).
- DTD = http://java.sun.com/dtd/web-app_2.3.dtd
- change "/*do" to "*.do"
- remove JSPServlet definition and mapping (this is already done in the global web.xml of Tomcat)
- change the order of the elements to context-param, filter, filter-mapping, listener, servlet, servlet-mapping, session-config, mime-mapping, welcome-file-list, error-page, taglib (because Tomcat is a little bit picky when interpreting the web.xml file)
Secondly you have to remove all Resin libraries from the classpath and add the Tomcat libraries like jsp-api.jar and servlet-api.jar as well as jta*.jar for transaction management.
Important: If you use Tomcat 5.5 and have problems with launching OpenEMM, you have to remove log4j.ja, because otherwise the log manager of Tomcat does not write all log entries (because of its singleton architecture). But to get OpenEMM finally running you have to add log4j.jar again (otherwise you will get an OpenSessionInViewFilter related error message).
OpenEMM Maintainer
Adding and Removing
I'm a little confused... how do you add log4j and remove it at the same time?
Do you have an example web.xml you could post?
Do you have an example web.xml you could post?
-
- Site Admin
- Posts: 2628
- Joined: Thu Aug 03, 2006 10:20 am
- Location: Munich, Germany
- Contact:
you only have to remove log4j.jar in case OpenEMM does not launch properly and you have to check the log. This is my web.xml file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2.3.dtd">
<web-app character-encoding="utf-8">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml /WEB-INF/dataAccessContext.xml /WEB-INF/cronContext.xml</param-value>
<description>spring context</description>
</context-param>
<filter>
<filter-name>CharacterEncoding</filter-name>
<filter-class>org.agnitas.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter>
<filter-name>OpenSessionInView</filter-name>
<filter-class>org.agnitas.dao.impl.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSessionInView</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSessionInView</filter-name>
<url-pattern>/r</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSessionInView</filter-name>
<url-pattern>/r.html</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSessionInView</filter-name>
<url-pattern>/g</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSessionInView</filter-name>
<url-pattern>/g.html</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSessionInView</filter-name>
<url-pattern>/emm_webservice</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>ButtonServlet</servlet-name>
<servlet-class>org.agnitas.web.ButtonRender</servlet-class>
</servlet>
<servlet>
<servlet-name>ShowComponent</servlet-name>
<servlet-class>org.agnitas.web.ShowComponent</servlet-class>
</servlet>
<servlet>
<servlet-name>ShowImage</servlet-name>
<servlet-class>org.agnitas.web.ShowImage</servlet-class>
</servlet>
<servlet>
<servlet-name>RedirectServlet</servlet-name>
<servlet-class>org.agnitas.web.rdir</servlet-class>
</servlet>
<servlet>
<servlet-name>TextFileDownload</servlet-name>
<servlet-class>org.agnitas.web.TextFileDownload</servlet-class>
</servlet>
<servlet>
<servlet-name>OpenrateServlet</servlet-name>
<servlet-class>org.agnitas.web.OnePixelCount</servlet-class>
</servlet>
<servlet>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ButtonServlet</servlet-name>
<url-pattern>/button</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ShowComponent</servlet-name>
<url-pattern>/sc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ShowImage</servlet-name>
<url-pattern>/image</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RedirectServlet</servlet-name>
<url-pattern>/r</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>RedirectServlet</servlet-name>
<url-pattern>/r.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TextFileDownload</servlet-name>
<url-pattern>/file_download</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>OpenrateServlet</servlet-name>
<url-pattern>/g</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>OpenrateServlet</servlet-name>
<url-pattern>/g.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/emm_webservice</url-pattern>
</servlet-mapping>
<session-config>
<file-store>WEB-INF/sessions</file-store>
<enable-cookies>false</enable-cookies>
<enable-url-rewriting>true</enable-url-rewriting>
</session-config>
<mime-mapping>
<extension>xsd</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<welcome-file-list>
<welcome-file>/login.jsp</welcome-file>
</welcome-file-list>
<error-page exception-type="javax.servlet.ServletException" location="/error.jsp"/>
<error-page exception-type="java.lang.Exception" location="/error.jsp"/>
<taglib>
<taglib-uri>
WEB-INF/agnitas-taglib.tld
</taglib-uri>
<taglib-location>
/WEB-INF/agnitas-taglib.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
</web-app>
Last edited by maschoff on Wed Jan 09, 2008 5:22 pm, edited 1 time in total.
OpenEMM Maintainer