Raible's Wiki

Raible Designs
Wiki Home
Recent Changes


  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in

Referenced by
...and 2 more

JSPWiki v2.2.33


Hide Menu


Difference between version 12 and version 1:

At line 1 changed 1 line.
This page describes my attempt to get [AppFuse] working on [Resin 3.0.4|http://www.caucho.com/download/index.xtp]. By documenting my procedures, and communicating with the [Caucho|http://www.caucho.com/] team, I hope to be able to find workarounds to all the issues.
This page describes my attempt to get [AppFuse] 1.6 working on [Resin|http://www.caucho.com/download/index.xtp]. In general, I found that there were a fair amount of bugs with Resin 3.0.9. The major one being that <a href="http://www.caucho.com/quercus/bugtrack/view.xtp?bugreport_id=2285">SiteMesh can't decorate forwards</a> if you have a FORWARD dispatch on its filter-mapping in web.xml. I also had to hack the displaytag to make the non-EL version work. My experience can be found <a href="http://raibledesigns.com/page/rd?anchor=resin_slower_than_tomcat_fails">here</a>.
At line 3 changed 4 lines.
!Table of Contents
* [1] Configuration and installation
* [2] Issues and Workarounds
* [3] Quick Setup
The good news is I discovered that AppFuse runs on Resin 2.1.14 pretty good. The only modification you need to make is to comment-out or delete the entries for Clickstream's &lt;listener> and &lt;filter-mapping&gt; in web.xml.
At line 8 changed 214 lines.
!!Configuration and installation [#1]
1. The first step to installing AppFuse on Resin is to create an appfuse.conf file with the following contents:
<web-app id='/appfuse'
<driver type="com.mysql.jdbc.Driver">
<resource jndi-name="mail/Session" type="javax.mail.Session">
<!-- Resin-specific JdbcAuthenticator -->
<authenticator type="com.caucho.server.security.JdbcAuthenticator">
SELECT username FROM app_user WHERE username=?
SELECT role_name FROM user_role r, app_user u
WHERE r.username=? and r.user_id = u.id
2. Put this file in $RESIN_HOME/conf.
3. Notify Resin that this file exists by adding the following to resin.conf, just after the last &lt;/web-app&gt; in the file:
<resin:include href='appfuse.conf'/>
To further illustrate, here is where it goes within the default host config:
<!-- configures the default host, matching any host name -->
<host id=''>
<!-- configures the root web-app -->
<web-app id='/'>
<!-- adds xsl to the search path -->
<simple-loader path="$host-root/xsl"/>
<servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
<resin:include href='appfuse.conf'/>
4. Install AppFuse by running "ant package-web" and dropping the resulting .war file in $RESIN_HOME/webapps/. You will need to rename it from __appfuse-''version''.war__ to __appfuse.war__.
5. Copy activation.jar, mail.jar and your JDBC Driver (i.e. mysql-connector-java-3.0.9-stable-bin.jar) to $RESIN_HOME/lib. The two JavaMail jars can be located in $J2EE_HOME/lib if you're using J2EE 1.4 Final.
6. At this point, you will will likely see the following error when starting Resin:
[appfuse] DEBUG [main] StartupListener.contextDestroyed(79) | contextDestroyed...
This is where the issues start...
!!Issues and Workarounds [#2]
The first step in tracking down the problems is to configure Resin to log more informative messages. Stop Resin and open $RESIN_HOME/conf/resin.conf. Change the logging level by changing the following line from this:
<log name='' level='info' path='stdout:' timestamp='[%H:%M:%S.%s] '/>
To this:
<log name='' level='all' path='stdout:' timestamp='[%H:%M:%S.%s] '/>
Restart Resin. Now Resin will tell you it's problem:
[07:10:34.302] com.caucho.config.ConfigException: `description' is an unknown pr
operty of `com.caucho.server.security.UserDataConstraint'.
Here, my friends, is where we have our first bug in Resin. According to the [Servlet 2.3 DTD|http://java.sun.com/dtd/web-app_2_3.dtd], "description" is certainly a valid property of user-data-constraint:
<!ELEMENT user-data-constraint (description?, transport-guarantee)>
Oh well, we can let it slide and comment out this property in web.xml.
__Workaround #1:__ (''Fixed in CVS'') Search for "user-data-constraint" in $RESIN_HOME/webapps/appfuse/WEB-INF/web.xml and delete (or comment out) the &lt;description&gt; element following &lt;user-data-constraint&gt;:
Encryption is not required for the application in general.
Stop and Restart Resin. You should now be able to the login page by going to [http://localhost:8080/appfuse]. BTW, if it seems to take a while, you might want to change your logging in $RESIN_HOME/conf/resin.conf back to "info"[logging options|4].
When navigating to http://localhost:8080/appfuse, you will likely see the following stacktrace:
java.lang.IllegalStateException: forward() not allowed after buffer has committed.
at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:144)
at com.caucho.server.webapp.RequestDispatcherImpl.error(RequestDispatcherImpl.java:118)
at com.caucho.jsp.PageContextImpl.handlePageException(PageContextImpl.java:868)
at _layouts._baselayout__jsp._jspService(_baselayout__jsp.java:409)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.pageservice(Page.java:553)
This seems to be caused by the following JSTL code block in appfuse/WEB-INF/pages/loginForm.jsp.
<fmt:message key="login.signup">
<fmt:param><c:url value="/signup.jsp"/></fmt:param>
__Workaround #2:__ (''Fixed in CVS'') Change the code block above to use a Struts &lt;bean-el&gt; tag instead:
<bean-el:message key="login.signup"
Now you can try logging in with tomcat/tomcat, but it won't work. It seems that Resin has a problem with using an encrypted password (even though it's just a text string that matches the user's password in the database).
__Workaround #3:__ Change the "encrypt-password" &lt;init-param&gt; (in web.xml) to be ''false''. This is on the Login Servlet (just search for "encrypt-password"). Then change the app_user.password column in the ''appfuse'' database to be "tomcat" instead of the encrypted version.
mysql -u test -p appfuse
update app_user set password = 'tomcat';
Now it looks like I can login (in IE), Mozilla just takes me back to the login page. Unfortunately, I end up with a blank page and the following error in the log files:
[08:12:18.005] _web_22dinf._pages._mainmenu__jsp init
[08:12:18.161] [inc] chunk: 388
[08:12:18.161] [2] chunk: 455
[08:12:18.161] [inc] chunk: 856
[08:12:18.161] java.lang.ArrayIndexOutOfBoundsException: -3741
[08:12:18.161] at com.caucho.server.connection.ResponseStream.writeChunk(Respon
[08:12:18.161] at com.caucho.server.connection.ResponseStream.flushBuffer(Respo
[08:12:18.161] at com.caucho.server.connection.ResponseStream.finish(ResponseSt
[08:12:18.161] at com.caucho.server.connection.AbstractHttpResponse.finish(Abst
[08:12:18.161] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFil
I saw this same ArrayIndexOutOfBoundsException on Roller, maybe it's an issue with the Compression Filter.
__Workaround #5:__ Disable the compressionFilter by removing its mapping from web.xml.
HEY - that __fricken worked__! Damn Compression Filter - I think it causes more problems than it solves.
!! Quick Setup [#3]
I've taken my learnings from this exercise and enhanced AppFuse (in CVS) to run easier on Resin. If you can figure out an easier way to setup AppFuse on Resin (or offer any additional tips), please do so.
Here's the basic steps:
* Edit $RESIN_HOME/conf/resin.conf and add after the last &lt;/web-app&gt; closing tag.
<pre style="margin-left: 40px">
&lt;resin:include href='appfuse.conf'/&gt;
* Download [appfuse.conf] and put it in the $RESIN_HOME/conf directory.
* Put activation.jar, mail.jar and mysql-connector-java-3.0.9-stable-bin.jar in $RESIN_HOME/lib.
* Remove password encryption. You can do this in the build process by changing "encrypt.password" to ''false'' in app-settings.xml. You could also do it from the command line using -Dencrypt.password=false. For testing, you will need to change a number of files that have the encrypted password. Search for "536c0b339345616c1b33caf454454d8b8a190d6c" and change it to "tomcat".
* Remove the &lt;filter-mapping&gt; for CompressionFilter.
* To enable the "Remember Me" feature, remove the &lt;c:if test="${rememberMeEnabled}"&gt; check in loginForm.jsp. (AppFuse 1.3-dev)
__DISCLAIMER:__ I did not thoroughly test that ''everything'' works, I just ran through a couple of pages.
[#4] Logging options are:
off - disable logging
severe - severe errors only
warning - warnings
info - information
config - configuration
fine - fine debugging
finer - finer debugging
finest - finest debugging
all - all debugging
To install AppFuse on either version of Resin, you will need to copy your JBDC Driver, jta.jar, mail.jar and activation.jar to $RESIN_HOME/lib. Then include metadata/conf/resin-web-2.1.xml in appfuse.war's WEB-INF directory, or in the expanded WEB-INF directory. Rename it to resin-web.xml after you copy it. For Resin 3.0.x, use metadata/conf/resin-web.xml. You will need to fill in the database driver, connection and username/password information in these files.

Back to AppFuseOnResin, or to the Page History.