Krishnamohan Meduri's weblog

Thursday Dec 06, 2007

Running Metro on SJS Web Server 7 Update 1

Recently I found that one can run Metro on SJS Web Server 7.0 Update 1 in minutes. If you want to give it a try, following steps would help you get going:

Set up SJS Web Server:

  • Download Metro bundle and unzip it say, under USER_DIR. I will refer to USER_DIR/metro as METRO_HOME.

  • SJS WS 7.0 Update 1 bundles JAX-WS 2.0 libraries. Therefore you need to override them with the latest libraries from Metro. For this, use wadm set-jvm-prop CLI command to set its class-path-prefix property to the jar files under METRO_HOME/lib directory.

    For example,

    $cd WS7_INSTALL_DIR/bin
    $./wadm --user=admin_user --password-file=admin_passwd_file

    wadm> set-jvm-prop --config=<config> class-path-prefix=METRO_HOME/lib/webservices-api.jar: METRO_HOME/lib/webservices-extra-api.jar:METRO_HOME/lib/webservices-extra.jar: METRO_HOME/lib/webservices-rt.jar:METRO_HOME/lib/webservices-tools.jar

    wadm> deploy-config <config>

    For more details on SJS Web Server's administration command line tool wadm, please refer to the first two sections of my SDN article on SJS Web Server.

    Note: When you set class-path-prefix, make sure you don't have one already set. If you already have one set, append its value to the above command so you won't lose it. Use the appropriate path separator (: for unix and ; for windows) for class-path-prefix value.
Run Metro sample (mtom):
  • Set METRO_HOME environment variable. For example,
         bash$export METRO_HOME=USER_DIR/metro

  • Build the war file.

    $cd METRO_HOME/samples/mtom
    $ant server


    This target builds jaxws-mtom.war under METRO_HOME/samples/mtom/build/war directory.

  • Add this web application to the configuration and deploy changes to all instances.

    wadm> add-webapp --config=<config> --vs=<vs> --uri=/jaxws-mtom METRO_HOME/samples/mtom/build/war/jaxws-mtom.war

    wadm> deploy-config <config>


  • Start the instance.

    $cd WS7_INSTALL_DIR/https-<hostname>/bin
    $./startserv


    (At this point, you can find the endpoint details at http://<host>:<port>/jaxws-mtom/mtomsample)

  • Build and run the client.

    $cd METRO_HOME/samples/mtom
    $ant client run


    Note: This client assumes that the server is running on port 8080. If the server port is different, you must modify the port in its build.xml appropriately.


Monday Oct 02, 2006

Want to run Sun Java System Web Server 7.0 Technology Preview 3 with Java EE 5 Web Container ?

If you want to run Sun Java System Web Server 7.0 Technology Preview 3 with Java EE 5 compliant web container from Project Glassfish, you can do so. As it stands today, it has a few known issues and hence is good for experimental purpose only.

Here are the steps:

1. Download and install Web Server 7.0 Technology Preview 3.

2. Checkout and build web container from project glassfish

    Prerequisites to building GlassFish

  • The user must have Maven v1.0.2 and JDK 5.0 (Java SE Development kit) installed.
  • The user must have a login on java.net and must have access to the CVS repository for the GlassFish project.
    Build instructions

     $mkdir workspace
     $cd workspace
     $cvs -d :pserver:<userid>@cvs.dev.java.net:/cvs checkout -r PWC12Dev_Branch glassfish/bootstrap

Create  workspace/glassfish/bootstrap/build.properties -or-
one-time process is to create ${HOME}/build.properties (Unix)  or %HOMEPATH%\build.properties (Windows) and set the following variables:
    glassfish.os.name= <Possible values:WINNT, SunOS, Linux, SunOS_X86 or Darwin>
    glassfish.cvs.username= <java.net id>

     $cd glassfish/bootstrap
     $maven checkout-pwc bootstrap-pwc build-pwc

         Note: These targets checkout, bootstrap and build only those components that are relevent to web container.
 
3. Modify the Web Server 7.0 installation to use the Java EE 5 compliant web container binaries from project glassfish

     $cp workspace/publish/pwc/pwc.jar WS7_INSTALL_DIR/lib/pwc.jar
         $cp workspace/publish/pwc/appserv-jstl.jar WS7_INSTALL_DIR/lib/webserv-jstl.jar

Monday Aug 07, 2006

How to deploy a war file on Sun Java System Web Server 7 using its Admin console


1) Start the admin server. To do so,
cd WS7_INSTALLATION_DIR/admin-server/bin (where WS7_INSTALLATION_DIR is the installation directory)
./startserv (On unix or startserv.bat on Windows)
2) Open https://localhost:8989/ from browser (assuming admin server is running on localhost with default settings)
3) You will see Admin Console's login page. Once you login, You will see



Click Add Web Application to see the next page.
Type appropriate values in Location and URI text fields



4) Click OK to see the next page.
5) Click Deployment Pending link on the top right corner to see the next page.
6) Click Deploy and then Close.

Run Apache Lenya on Sun Java System Web Server 6.1

Apache Lenya is an Open Source Java/XML Content Management System that comes with revision control, site management, scheduling, search, WYSIWYG editors, and workflow.

You can run this application on Sun Java System Web Server 6.1. Before I get to the steps to do so, let's first decide on some terminology:

  WS61_INSTALL_DIR specifies Sun Java System Web Server 6.1 installation directory.
  LENYA_HOME specifies the directory where Lenya binary (tar or zip) is extracted
  LENYA_WEBAPP_HOME specifies the directory where LENYA_HOME/lenya.war is extracted.

Steps to setup and run Lenya on SJS WS 6.1:

1. Download Apache Lenya 1.2.4 binary from http://lenya.apache.org/ and extract the tar or zip.
2. Create a new directory named endorsed under WS61_INSTALL_DIR/bin/https/jdk/jre/lib
3. Copy the following three jar files from LENYA_WEBAPP_HOME/WEB-INF/lib to WS61_INSTALL_DIR/bin/https/jdk/jre/lib/endorsed
       xalan-2.6.1-dev-20041008T0304.jar  
       xml-apis.jar
       xercesImpl-2.6.2.jar
(I am not sure what will be the side effects of this change. But to get Lenya running, this is a necessary step. Lenya seems to depend on these jars heavily.)
4. Deploy LENYA_HOME/lenya.war to Web Server instance with say /lenya as uri.
5. Start the web server instance and visit http://hostname:port/lenya in your browser. This shows the index page of Lenya.

To experiment, you can click "Lenya's Weblogs" link and create blogs.
From Lenya home page, you can also click "Default Publication" and open WYSIWYG Editors and do much more.

To my surprise, Apache Lenya sometimes throws some errors. I observed the same errors with jetty also which is a container bundled with Lenya binaries.

Monday Jun 19, 2006

Migrating Web Applications From Apache Tomcat 5.x to Sun Java System Web Server 7.0

Recently Marina Sum (SDN staff writer) and I wrote an article Migrating Web Applications From Apache Tomcat 5.x to Sun Java System Web Server 7.0. I tried to introduce users to Sun Java System Web Server 7.0's (SJS WS7.0) new administration CLI. I tried to explain with examples how to add users to a file realm, how to configure JDBC DataSource with JNDI, and how to configure SSL in Sun Java System Web Server 7.0. Take a look at it. Apache Tomcat users who want to try SJS WS 7.0 Technology Preview 1 will find this article useful.

Calendar

Feeds

Search

Links

Navigation

Referrers