The Artima Developer Community
Sponsored Link

Java Buzz Forum
Deploying Pebble on Resin 2.1.x

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Simon Brown

Posts: 636
Nickname: simonbrown
Registered: Jun, 2003

Simon Brown is a Java developer, architect and author.
Deploying Pebble on Resin 2.1.x Posted: Nov 5, 2003 3:57 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Simon Brown.
Original Post: Deploying Pebble on Resin 2.1.x
Feed Title: Simon Brown's weblog
Feed URL: http://www.simongbrown.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on Java, software development and technology.
Latest Java Buzz Posts
Latest Java Buzz Posts by Simon Brown
Latest Posts From Simon Brown's weblog

Advertisement

I've had a few questions about deploying Pebble on Resin over the past couple of weeks so I thought that I would write a short blog entry describing the process. I've tested this on Mac OS X (Panther), J2SE 1.4.1, Resin 2.1.11 and the latest development version of Pebble. However, I'm sure that these instructions will work for slightly earlier versions.

  1. Grab Resin from here and extract to a directory of your choice.
  2. Grab Pebble from here and extract to a directory of your choice. As with Tomcat, you can either extract it underneath the $RESIN_HOME/webapps directory, or anywhere on your disk.
  3. Assuming that you've extracted Pebble somewhere other than the webapps directory, open up the $RESIN_HOME/conf/resin.conf file and insert the following XML before the closing host tag, changing the id and app-dir attributes as necessary. In addition to this, you can set up the users that you need for your blog. In the example below I have a single user that is both a blog-owner and blog-contributor.
        <web-app id='blog' app-dir='/Users/simon/sandbox/pebble/pebble-web'>
      <login-config auth-method='basic'>
        <authenticator>
          <class-name>com.caucho.http.security.XmlAuthenticator</class-name>
          <init-param user='simon:password:blog-owner,blog-contributor'/>
        </authenticator>
      </login-config>
    </web-app>
  4. For backwards compatibility and ease of development, Resin ships with a default invoker for all requests starting /servlet. As the comments say, this is is a major security hole and it should be disabled. In fact, Pebble won't work with this enabled. Simply find the block (shown below) in the $RESIN_HOME/conf/resin.conf file and remove it/comment it out.
      <!--
     - The "invoker" servlet invokes servlet classes from the URL.
     - /examples/basic/servlet/HelloServlet will start the HelloServlet
     - class.  In general, the invoker should only be used
     - for development, not on a deployment server, because it might
     - leave open security holes.
    -->
  <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>

While everything seems to work, there does seem to be a small issue with the formatting of dates - sometimes the blog timestamps show the incorrect time. I've seen this myself where a blog entry posted on one day will be reported to have been posted the previous day. The underlying dates and permalinks work okay, it's just the JSTL formatting that doesn't. I think I've fixed this, by modifying the line that sets the timezone of the view components (JSPs) in the header.jspf file as follows.

  <fmt:setTimeZone value="${rootBlog.timeZoneId}" scope="request" />
I still don't understand why the formatting doesn't work in Resin, but this seems to do the trick for me, while still working on other containers such as Tomcat.

I'll put this in the Pebble user guide, but I hope it's useful to somebody in the short term. Oh, and thanks to Matt Read for some info on the Resin config.

Read: Deploying Pebble on Resin 2.1.x

Topic: The Poll is over, Eclipse won Previous Topic   Next Topic Topic: Wiki + Blog = PIM

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use