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|http://www.caucho.com/quercus/bugtrack/view.xtp?bugreport_id=1647] 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 2 lines. |
---- |
__Update (1/12/2003):__ Most of the issues described in this document have been fixed by the Resin team, or in AppFuse's code. The two major bugs in AppFuse were related to the CompressionFilter (fixed by using new Filter) and password-encryption. Password encryption was broke because I had [the wrong password|http://www.caucho.com/quercus/bugtrack/view.xtp?bugreport_id=1649]. The only outstanding issue is [exposing a struts-forward as a pageContext variable|http://www.caucho.com/quercus/bugtrack/view.xtp?bugreport_id=1650]. |
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 <listener> and <filter-mapping> in web.xml. |
At line 6 changed 218 lines. |
__Update (1/20/2003):__ As of Resin 3.0.5, there are no outstanding issues that I know of. |
|
---- |
|
!Table of Contents |
* [1] Configuration and installation |
* [2] Issues and Workarounds |
* [3] Quick Setup |
|
!!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' |
document-directory="webapps/appfuse"> |
|
<database> |
<jndi-name>jdbc/appfuse</jndi-name> |
<driver type="com.mysql.jdbc.Driver"> |
<url>jdbc:mysql://localhost:3306/appfuse</url> |
<user>test</user> |
<password>test</password> |
</driver> |
</database> |
|
<resource jndi-name="mail/Session" type="javax.mail.Session"> |
<init> |
<mail.transport.protocol>smtp</mail.transport.protocol> |
<mail.host>localhost</mail.host> |
</init> |
</resource> |
|
<!-- Resin-specific JdbcAuthenticator --> |
<authenticator type="com.caucho.server.security.JdbcAuthenticator"> |
<init> |
<data-source>jdbc/appfuse</data-source> |
<password-query> |
SELECT password FROM app_user WHERE username=? |
</password-query> |
<role-query> |
SELECT role_name FROM user_role r, app_user u |
WHERE r.username=? and r.user_id = u.id |
</role-query> |
<password-digest>none</password-digest> |
</init> |
</authenticator> |
|
</web-app> |
}}} |
|
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 </web-app> 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=''> |
<document-directory>doc</document-directory> |
|
<!-- configures the root web-app --> |
<web-app id='/'> |
<!-- adds xsl to the search path --> |
<class-loader> |
<simple-loader path="$host-root/xsl"/> |
</class-loader> |
|
<servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/> |
</web-app> |
<resin:include href='appfuse.conf'/> |
</host> |
}}} |
|
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 <description> element following <user-data-constraint>: |
|
__THIS [BUG IS FIXED|http://www.caucho.com/quercus/bugtrack/view.xtp?bugreport_id=1647] ACCORDING TO THE RESIN TEAM__ |
|
{{{ |
<user-data-constraint> |
<!--description> |
Encryption is not required for the application in general. |
</description--> |
<transport-guarantee>NONE</transport-guarantee> |
</user-data-constraint> |
</security-constraint> |
}}} |
|
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> |
</fmt:message> |
}}} |
|
__Workaround #2:__ (''Fixed in CVS'') Change the code block above to use a Struts <bean-el> tag instead: |
|
__THIS [BUG IS FIXED|http://www.caucho.com/quercus/bugtrack/view.xtp?bugreport_id=1647] ACCORDING TO THE RESIN TEAM__ |
|
{{{ |
<bean-el:message key="login.signup" |
arg0="${pageContext.request.contextPath}/signup.jsp"/> |
}}} |
|
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 |
seStream.java:411) |
[08:12:18.161] at com.caucho.server.connection.ResponseStream.flushBuffer(Respo |
nseStream.java:359) |
[08:12:18.161] at com.caucho.server.connection.ResponseStream.finish(ResponseSt |
ream.java:284) |
[08:12:18.161] at com.caucho.server.connection.AbstractHttpResponse.finish(Abst |
ractHttpResponse.java:1697) |
[08:12:18.161] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFil |
terChain.java:188) |
}}} |
|
I saw this same ArrayIndexOutOfBoundsException on Roller, maybe it's an issue with the Compression Filter. |
|
__Workaround #3:__ (''Fixed in CVS'') 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 the following after the last </web-app> closing tag. |
<pre style="margin-left: 40px"> |
<resin:include href='appfuse.conf'/> |
</pre> |
* 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 the <filter-mapping> for CompressionFilter. (''Fixed in CVS'') |
* To enable the "Remember Me" feature, uncomment the <dispatcher> elements in web.xml, or just hit invoke the /appfuse/security/ URL to initialize the LoginFilter, which sets the "rememberMeEnabled" variable. (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. |