The Source for Java Technology Collaboration
User: Password:



Manveen Kaur's Blog

May 2007 Archives


Why should I look at GlassFish?

Posted by manveen on May 21, 2007 at 12:00 PM | Permalink | Comments (1)

In case you missed going to the GlassFish PoD during this year's JavaOne, and have some questions left unanswered, Nazrul has written an excellent blog answering the most popular questions asked.
Take a look.

Installing Roller 3.1.0 on Tomcat

Posted by manveen on May 18, 2007 at 12:33 PM | Permalink | Comments (0)

What do I need to install Roller 3.0.1 on Tomcat?
Here is a link to the installation guide for your reference.

Stay tuned for my follow up blog on installation on my favorite application server glassFish.

  1. BEFORE INSTALLATION. THE SETUP. First things first. I need the following installed on my system:
  2. UNPACK THE ROLLER DISTRIBUTION. Download the appropriate roller distribution and unpack the ZIP or TAR file.

    Set the ROLLER environment variable to the location of the roller webapps directory. For example, for Windows (if you installed Roller in c:), you would set
    set %ROLLER% = c:\apache-roller-3.1/webapp/roller

  3. INSTALL REQUIRED THIRD PARTY JARS

    If you're curious why, these are not shipped in Roller due to licensing restrictions. You need-

    • Download Hibernate 3.1.2 from SourceForge

      You'll need to copy the following files from Hibernate into the Roller WEB-INF/lib directory:

      hibernate3.jar, asm-attrs.jar, asm.jar, cglib-2.1.3.jar, dom4j.1.6.1.jar , ehcache-1.1.jar, jdbc2_0-stdext.jar, jta.jar


      You'll also need to change the Hibernate configuration file to use the MySQL5 dialect.
    • Install JDBC Driver Jars.

      Download the J/Connector JDBC driver from mysql.com and place it in the Tomcat common/lib directory.

    • Install JavaMail and activation Jars

      Copy activation.jar and mail.jar to Tomcat common/lib.

  4. CREATE ROLLER TABLES IN YOUR DATABASE.

    In this step you use an SQL script to create a new database within your MySQL installation, create a user with all privileges within that database and the tables required to run Roller.

    Execute the script in %ROLLER%/WEB-INF/dbscripts/mysql

    C> cd %ROLLER%\WEB-INF\dbscripts\mysql
    C> mysql -u root -p
    password: *****
    mysql> create database roller;
    mysql> grant all on roller.* to scott@'%' identified by 'tiger';
    mysql> grant all on roller.* to scott@'localhost' identified by 'tiger';
    mysql> use roller;
    mysql> source createdb.sql
    mysql> quit
    

  5. DEPLOY ROLLER TO YOUR APPLICATION SERVER

    To deploy Roller you will need to inform Tomcat where to find the Roller installation directory, how to configure the Roller database data-source under the JNDI name jdbc/rollerdb, and how to configure the Roller email session under the JNDI name mail/Session.

    For Tomcat you can do this by creating a context configuration file named roller.xml and placing that file in the %CATALINA_HOME%/conf/Catalina/localhost directory.

    This is what roller.xml looks like. Edit the values for docBase and Resource attributes to point to the ones you're using.

    
    <Context path="/roller"
    docBase="c:/apache-roller-3.1/webapp/roller" debug="0">
    <Resource name="jdbc/rollerdb" auth="Container"
    type="javax.sql.DataSource"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/roller?autoReconnect=true&
    useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8"
    username="scott"
    password="tiger"
    maxActive="20"
    maxIdle="3"
    removeAbandoned="true"
    maxWait="3000" />
    <!-- If you want e-mail features, un-comment the section below -->
    <Resource name="mail/Session" auth="Container"
    type="javax.mail.Session" mail.smtp.host="mailhost.example.com" /> 
    </Context>
    
    
  6. Check your internationalization settings

    Configure your application server and your web server to use UTF-8 encoding because Roller's does I18N by using UTF-8 encoding for everything. Also Check your application server's URI encoding setting!

    Make sure that your web application server uses UTF-8 to encode URI's. In Tomcat the URI encoding is specified in the connectors that are configured in the Tomcat configuration file conf/server.xml. Here's a connector with the URI encoding attribute set properly:

    <Connector port="8080" maxThreads="150" minSpareThreads="25" .....
    URIEncoding="UTF-8" />
    

  7. Setup Roller data directories

    Roller stores file uploads, search index files, cache files and log files on disk. Make sure the following directories that Roller expects exist and are writable by the Tomcat process.

    • Uploads directory: ${user.home}/roller_data/uploads Where ${user.home}is the Java system property that normally evaluates to the home directory of the user identity executing the server's JVM process.
    • Search-index directory: ${user.home}/roller_data/search-index
    • Logs directory: ${catalina.base}/logs/roller.log


  8. Review Roller configuration

    • Review the WEB-INF/classes/roller.properties file To override the properties, define a roller-custom.properties file and place it in $CATALINA_HOME/common/classes/roller-custom.properties

      uploads.dir=/app/roller/roller_data/uploads
      search.index.dir=/app/roller/roller_data/search-index
      passwds.encryption.enabled=true
      # other values you may want to override
      

    • Edit %ROLLER%/WEB-INF/security.xml file For the beans with ids "anonymousAuthenticationProvider" and "anonymousProcessingFilter" change the value field of the property with name="key" to any string value of your choosing. Use the same key value in these two beans; they must match.
      For the beans with ids "rememberMeServices" and "rememberMeAuthenticationProvider" change the value field of the property with name="key" to be different from the default value of "rollerlovesacegi". You can use any string value of your choosing. It should be a secret specific to your site. Use the same key value in these two beans. Again, they must match.

  9. Start your Servlet Container and your database

    Start your Servlet Container, open your web browser, browse to the Roller start page and start using Roller.

        C> cd %CATALINA_HOME/%bin
        C> startup
    
  10. Point your browser to the URL: http://localhost:8080/roller. You're all set!



    Sun's training offering on developing secure Java Web services

    Posted by manveen on May 17, 2007 at 04:09 PM | Permalink | Comments (1)

    You're back from JavaOne, with buzz words of cool new technologies you heard about still ringing in your ears. Here you are sitting at your desk, thinking about all the cool stuff you wish you could learn.

    Well, there is HOPE.

    Did you know that Sun Microsystems Inc. offers comprehensive training and certification for several Java technology components and the Java Platform, Enterprise Edition (Java EE)?

    What?

    To add to the list of courses being offered in the Web Services learning path , is an offering on XML and Web Services security (DWS-4120-EE5) being offered in the Java EE track.

    When?

    Estimated to be on the training schedule mid June. Stay tuned!

    Where?

    Watch this space.

    What will I learn?

    As part of the course, you will learn to :

    • Identify the need to secure web services
    • List and explain the primary elements and concepts of application security
    • Outline the factors that must be considered when designing a web service security solution
    • Determine the issues and concerns related to securing web service interactions
    • Evaluate the tools and technologies available for securing a Java web service
    • Analyze the security requirements of web services
    • Identify the security challenges and threats in a web service application
    • Secure web services using application-layer, transport-layer security, and message-layer security
    • Secure web services using the message security providers available in the Sun Java System Application Server
    • Describe the concept of identity and the drivers behind identity management solutions
    • Explain the role of the Access Manager in securing web services
    • Illustrate identity management capabilities in the NetBeans environment
    • Secure web services using the Username token profile
    • Secure web services using SAML assertions and Liberty tokens
    • And if this isn't enough- there is another incentive as well. The course will also help in preparation towards the SCJDWS (Sun Certified Developer for Java Web Services) exam.

      The students perform the course lab exercises using the NetBeans 5.5 Enterprise Pack Integrated Development Environment (IDE) and using AppServer 9.0 U1.

      Cool stuff! Is there anything else you would want to learn?



      Getting started with jMaki

      Posted by manveen on May 16, 2007 at 10:51 AM | Permalink | Comments (0)

      There has been quite some buzz about jMaki and Web 2.0 this JavaOne. There were atleast 7 or 8 talks/sessions or BoFs! That sure is a lot!

      Well I've been trying to get started with using jMaki in my own space too. I thought I'd write some of my experiences in blogs as I go along.

      First we need to setup the environment. We need an IDE, a jMaki plugin, and an application server.

      Here are my preferences-

      • IDE: Netbeans (ofcourse!) I got NetBeans 5.5.1 Release Candidate, though its soon to be replaced with the much better version 6. But 5.5.1 will do for now for me.
      • IDE Plugin: NetBeans jMaki Plugin I downloaded the NetBeans Ajax Update center module and installed it in NetBeans. Once installed, I'll have access to the latest jMaki builds from the NetBeans IDE.
      • Server: GlassFish (ofcourse :))

      Now using the update center, I installed jMaki plugin in my NetBeans IDE. There is also a screencast that you can watch.

      Now we're all set to start writing applications using jMaki.

      Let's do something more fruitful. Let's say we want to have a menu bar which will bring up different pages based on the option you select.

      We create a new Web application. Enable jMaki support from the wizard.

      Choose a standard single view and drag and drop the jMaki.Menu under the first div or the main area.

      Drag and drop a jMaki.dcontainer on the second div. The reason we are having the dContainer is because all the actions with the Menu will result in changes in the dContainer. The glue code for the two to work together already exists, so we won't have to do anything else, which makes things simpler. Finally we create new jsp's for the associated actions in the same project. They should be at the same level as the main index.jsp. It's easy to do with NetBeans. Just click on the project in the project tree and create New->jsp.

      This is what the final code will look like:

          <div class="outerBorder">
              
              <div class="header">
                  <div class="banner">Doing something fruitful</div>
                  <br>            
                  <div class="subheader">
                      <div>
                          <a:ajax name="jmaki.menu"
                                  value="{columns: [
                                  {label: 'Strawberry',
                                  menuItems: [
                                  {label:'ripe', url:'ripe.jsp'},
                                  {label:'unripe', url:'unripe.jsp'}
                                  ]},
                                  {label: 'Apples',
                                  menuItems: [
                                  {label:'Red', url:'red.jsp'},
                                  {label:'Green', url:'green.jsp'}
                                  ]}
                                  ]}" />
                      </div>
                  </div> <!-- subheader  -->
      
              </div> <!-- header -->
      
              <div class="main">
      
                  <a:ajax name="jmaki.dcontainer"/>
                      
              </div> <!-- content -->
          </div> <!-- main -->
      
          </div> <!-- outerborder -->
      
      Feel free to try and point to some other useful tips as well!



      Powered by
      Movable Type 3.01D
 Feed java.net RSS Feeds