Huihoo - IBM WebSphere Application Server Community Edition 初试

来源:百度文库 编辑:神马文学网 时间:2024/04/29 10:38:16

IBM WebSphere Application Server Community Edition 初试

(by huihoo.com Allen)

一、安装wasce


从以下地址:https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=wsced
下载Linux版本: wasce_setup-1.0.0.1.bin

在安装wasce之前请需事先安装设置好以下环境 /etc/profile
#config java
export JAVA_HOME=/usr/local/j2sdk1.4.2_05
export PATH=/usr/local/j2sdk1.4.2_05/bin:$PATH

#config ant
export ANT_HOME=/usr/local/apache-ant-1.6.2
export PATH=/usr/local/apache-ant-1.6.2/bin:$PATH

然后运行安装程序 ./wasce_setup-1.0.0.1.bin -console

依据提示完成wasce的安装

默认安装完的目录在: /opt/IBM/WebSphere/AppServerCommunityEdition/
结构:

--bin
--config-store
--deploy
--graphics
--lib
--license
--repository
--schema
--_uninst
--var

CHANGES.txt
README.htm
_version.properties

二、运行wasce

cd /opt/IBM/WebSphere/AppServerCommunityEdition/bin
[root@fc3-3 bin]# ./startup.sh
Using GERONIMO_BASE: /opt/IBM/WebSphere/AppServerCommunityEdition
Using GERONIMO_HOME: /opt/IBM/WebSphere/AppServerCommunityEdition
Using GERONIMO_TMPDIR: /opt/IBM/WebSphere/AppServerCommunityEdition/var/temp
Using JRE_HOME: /usr/local/j2sdk1.4.2_05/jre
Using GERONIMO_OUT: /opt/IBM/WebSphere/AppServerCommunityEdition/var/log/geronimo.out

打开浏览器,输入
http://192.168.1.3:8080/



Logon to the Administration Console

user name: system
password: manager






三、构建您的第一个 wasce 应用程序

在 10 分钟内构建您的第一个 wasce 应用程序

 

清单 1 显示了一个简单的 JSP Web 应用程序。它只包含一个 JSP,输出 Hello world! 消息。这个 JSP 还使用标准的 指令和 Expression Language(EL)来输出当前的服务器时间。


清单 1. Hello world JSP
                                    dw Getting Started with Geronimo                                    

Hello world, from Geronimo!

on ${datetime}

首先,创建一个称为 test 的工作目录来包含这个项目。在这个目录中,创建包含 清单 1 的内容的 hellojsp.jsp 文件。

现在,在 test 目录中创建子目录 WEB-INF。在 WEB-INF 目录中,创建 web.xml 文件,内容如 清单 2 所示。


清单 2. hellojsp.war 的 web.xml 部署描述文件
                                    developerWorks Getting Started with Geronimo            - Hello JSP example                                    IBM developerWorks getting started with Geronimo example                                    

清单 2 是一个标准的兼容 Servlet 2.4 的 J2EE 部署描述文件。这个描述文件是 J2EE 1.4 标准针对 Web Application aRchive(.war)文件所需要的。

现在,回到 project_base 目录,使用以下命令创建 .war 文件:

jar cvf  hellojsp.war .            

现在有了一个能够部署到 Geronimo 服务器的 hellojsp.war 文件。

要部署这个简单的 Web 应用程序,将 hellojsp.war 文件复制到 Geronimo_installation 目录。在这个目录中,使用运行时部署器来部署这个应用程序:

java –jar bin/deployer.jar  --user system --password manager deploy hellojsp.war            

Geronimo 部署器输出以下状态消息,表示这个 Geronimo 应用程序部署成功了:

Deployed hellojsp            

现在启动浏览器,访问 URL http://192.168.1.3:8080/hellojsp/hellojsp.jsp。

默认的 Jetty 容器处理并执行这个 JSP(在 1.0 版中,将能够默认运行 Tomcat)。浏览器显示这个 JSP,如 图 2 所示。


图 2. Geronimo 中运行的 Hello world JSP

恭喜!您已经完成了 Geronimo 服务器的安装和设置;甚至从头创建了一个应用程序并将它部署到了服务器上。

Huihoo - IBM WebSphere Application Server Community Edition 初试 IBM WebSphere 开发者技术期刊: WebSphere Application Server Community Edition 入门 使用 WebSphere Application Server Community Edition Server 的 Eclipse 插件 为 WebSphere Application Server Community Edition 开发 Spring 应用程序: 第 1 部分:Spring MVC 为 WebSphere Application Server Community Edit... WebSphere Application Server Community Edition 中的高级管理,第 2 部分: 使用线程池、集群和配置插件 为 WebSphere Application Server Community Edition 开发 Spring 应用程序: 第 2 部分:使用 Spring 进行数据库连接管理 IBM - MustGather: Read first for all WebSphere Application Server products IBM WebSphere Application Server 诊断和调优(二) The Spring Framework and IBM WebSphere Application Server IBM WebSphere 开发者技术期刊: 使用 WebSphere Application Server V6.1 中的联合存储库扩展用户注册表选项 WebSphere Application Server v6中的问题诊断以及日志策略 Q & A: WebSphere Application Server 常见安全性问题 -... Developing zero.suggest.demo with the IBM WebSphere sMash application builder 在Red Hat上安装WebSphere Application Server教程在线学习... WebSphere DataStage Enterprise Edition 实践 IBM WebSphere 常见问题解答 IBM WebSphere 常见问题解答 IBM WebSphere 常见问题解答 Community Server专题 WebSphere DataStage Enterprise Edition 实践1 WebSphere DataStage Enterprise Edition 实践2 博客园 - uGoer - Community Server专题一:概述Community Server Server Application Error详细解决办法