Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 编程语言 > Java > MyEclipse 5.0 + WebLogic 9.2 配置详解
【标  题】:MyEclipse 5.0 + WebLogic 9.2 配置详解
【关键字】:MyEclipse,5.0,WebLogic,9.2
【来  源】:http://blog.csdn.net/grock304/archive/2006/12/02/1425759.aspx

MyEclipse 5.0 + WebLogic 9.2 配置详解

Your Ad Here 本文所用环境:Eclipse 3.2 + MyEclipse 5.0GA + WebLogic 9.2

选择 WebLogic 9.2 的原因

①WebLogic 8 支持的是 J2EE 1.3,也就是 Servlet 2.3 规范。若在 MyEclipse 中建立 Web Project 时选择了 J2EE 1.4[default],在部署的时候就会出现异常,提示部署描述符 web.xml 是畸形的,也就是未通过 DTD 检验。因为 J2EE 1.4 使用的是 Servlet 2.4 规范,这直接体现在 web.xml 部署描述符的头部引用中。这就是有些朋友遇到的,部署在 Tomcat 和 JBoss 中能够运行的 JSP 程序,部署到 WebLogic 8 就无法运行的原因之一。解决这个问题,需要将 WebLogic 升级到 9.2 版本;或者使用 J2EE 1.3。

Servlet 2.3 规范生成的 web.xml 头部:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"
>
<web-app>
...
</web-app>

Servlet 2.4 规范生成的 web.xml 头部:


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi
=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>
...
</web-app>

②若在上一个问题选择了 J2EE 1.3 进行开发后,在部署时会出现另外的异常,提示“Unsupported major.minor version 49.0”—— 又是版本问题,这次是由于 JDK 版本不支持造成的。WebLogic 8 不支持 JDK 1.5,由 JDK 1.5 编译的程序无法部署到只支持 JDK 1.4 的服务器上运行。解决的办法也有两个:用 JDK 1.4 重新编译;或者换用支持 JDK 1.5 的服务器,也就是升级到 WebLogic 9.2。

配置 WebLogic 9.2

安装 WebLogic 比较容易,在这里就不再累述了,大家可以参阅相关文档。现在着重讲一下 WebLogic 的配置,因为后面在配置 MyEclipse 时将用到这里的配置信息。

①运行开始 -> 程序 -> BEA Products -> Tools -> Configuration Wizard。
②选择 Create a new WebLogic domain,Next。
③在 Select Domain Source 界面保持默认,Next。
④在 User name 处输入 user,两个 password 都输入 12345678(密码要求 8 位),Next。
⑤ 在 Configure Server Start Mode and JDK 界面中保持默认,即 JDK 选择的是“Sun SDK 1.5.0_04 @ C:\BEA\jdk150_04”,注意这里若选择“Other JDK”配置比 SDK 1.5.0_04 更高的版本,服务器启动时将会出现异常,所以最好保持默认,然后 Next。
⑥在 Customize Environment and Services Settings 界面中默认为 No,Next。
⑦在 Domain name 处输入 mydomain,点击 Create。
⑧完成后点击 Done 关闭 Configuration Wizard 对话框。
⑨ 运行开始 -> 程序 -> BEA Products -> User Projects -> mydomain -> Start Admin Server for Weblogic Server Domain,检查服务器是否启动成功。

配置 MyEclipse 的 WebLogic 9 服务器

启动 Eclipse,选择“Window -> Preferences”菜单,打开首选项对话框。展开 MyEclipse 下的 Application Servers 节点,点击 WebLogic 9,选中右边的 Enable 单选按钮,启用 WebLogic 服务器。配置如下:
①BEA home directory:C:\BEA(假定 WebLogic 安装在 C:\BEA 目录中)
②WebLogic installation directory:C:\BEA\WebLogic92
③Admin username:user(来自 WebLogic 中的配置)
④Admin password:12345678(来自 WebLogic 中的配置)
⑤Execution domain root:C:\BEA\user_projects\domains\mydomain
⑥Execution server name:AdminServer
⑦Security policy file:C:\BEA\WebLogic92\server\lib\weblogic.policy
⑧JAAS login configuration file:(Null)

接着展开 WebLogic 9 节点,点击 JDK,在右边的 WLS JDK name 处选择 WebLogic 9 的默认 JDK。这里组合框中缺省为单独安装的 JRE。单击 Add 按钮,弹出 WebLogic -> Add JVM 对话框,在 JRE 主目录处选择 WebLogic 安装文件夹中的 JDK 文件夹,我的版本为 C:\BEA\jdk150_04,程序会自动填充其他选项。单击确定按钮关闭对话框。这时候就可以在 WLS JDK name 组合框中选择 jdk150_04 了。

至此,MyEclipse 中 WebLogic 9 的配置工作就算完成了。下面可以看看在 Eclipse 中能否启动 WebLogic 服务器了?安装了 MyEclipse 之后,Eclipse 工具栏中就会有一个“Run/Stop/Restart MyEclipse Application Servers”下拉按钮。点击该按钮的下拉部分,选择“WebLogic 9 -> Start”菜单,即开始启动 WebLogic 了。通过查看控制台的消息,就可以检查启动是否成功,或发生什么异常。

补充配置

点击 Paths,在右边的 Prepend to classpath 列表框中,通过 Add JAR/ZIP 按钮,加入:
C:\BEA\WebLogic81\server\lib\weblogic.jar
C:\BEA\WebLogic81\server\lib\webservices.jar
如果要用到数据库,还需要把数据库的驱动类库添加进来,这里我们用 WebLogic 自带的 SQL Server 数据库驱动类库:
C:\BEA\WebLogic81\server\lib\mssqlserver4v65.jar

对常见启动问题

出现 The WebLogic Server did not start up properly. 提示和 java.io.InvalidClassException 异常的问题,通常是因为 JDK 选择不当引起的,在 MyEclipse 的配置中选择的 JDK 应该必须与配置 WebLogic 时选择的 JDK 相同。当选择默认 JDK 时,也可以在 MyEclipse 中配置 BEA 的 jrockit90_150_04 这个 JDK。
MyEclipse + WebLogic 开发 EJB 需注意:【上一篇】
Swing 中设置模态窗体和启动位置:【下一篇】
【相关文章】
  • MyEclipse + WebLogic 开发 EJB 需注意
  • 使用泛型技术排序数组JDK5.0
  • discuz5.0安装详解
  • 菜鸟 Weblogic 9 之旅图文 1 - 下载和安装(Windows版本)
  • SCO UNIX 5.0.7与UnixWare 7.1.4如何开启超线程
  • 解决jBPM Designer插件与MyEclipse插件冲突的办法
  • Eclipse+MyEclipse+tomcat图解安装JSP
  • weblogic各版本下载地址大全
  • Apache2.2.3+PHP5.2.0+MySQL5.0.27+openssl0.98d安装笔记
  • 发行版发布: Yellow Dog Linux 5.0
  • 【随机文章】
  • 网上银行前置机
  • C++ 标准模板库(STL)编程示例 - 容器适配器PriorityQueue
  • rpm包制作
  • RHEL 4 Md5 Code
  • Java中如何打jar包
  • 让你的错误能留下痕迹(错误日志mysql篇目)
  • many to many
  • 安装DBD::Pg
  • 改变“通用文件夹”目录
  • 编程低手箴言(三)
  • 【相关评论】
    发表人:georgena Post @ 2007-4-28 23:24:47
    邮件:georgena123126.com
    首先,谢谢您,写的很详细,对我这个初学者很有帮助! 其次,我开始启动Weblogic,控制台的消息是以下这样的,有什莫问题吗? <2007-4-28 下午11时17分19秒 CST> <Notice> <WebLogicServer> <BEA-000395> <Following extensions directory contents added to the end of the classpath: E:\bea\weblogic92\platform\lib\L10N\beehive-controls_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\beehive-netui-compiler_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\beehive-netui-core_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\beehive-netui-tags_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\netuix_common_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\netuix_prop_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\p13n-plugin_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\p13n-schemas_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\p13n_ejb_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\p13n_prop_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\p13n_system_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\rdbmsAtnProvider_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\tuxedocontrol_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\weblogic-controls_zh_CN.jar;E:\bea\weblogic92\platform\lib\L10N\wsrp-common_zh_CN.jar;E:\bea\weblogic92\platform\lib\p13n\p13n-schemas.jar;E:\bea\weblogic92\platform\lib\p13n\p13n_common.jar;E:\bea\weblogic92\platform\lib\p13n\p13n_system.jar;E:\bea\weblogic92\platform\lib\wlp\netuix_common.jar;E:\bea\weblogic92\platform\lib\wlp\netuix_schemas.jar;E:\bea\weblogic92\platform\lib\wlp\netuix_system.jar;E:\bea\weblogic92\platform\lib\wlp\wsrp-common.jar> <2007-4-28 下午11时17分21秒 CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.5.0_04-b05 from Sun Microsystems Inc.> <2007-4-28 下午11时17分23秒 CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 9.2 Mon Jul 31 05:48:10 PDT 2006 796124 > <2007-4-28 下午11时17分31秒 CST> <Info> <WebLogicServer> <BEA-000215> <Loaded License : E:\bea\license.bea> <2007-4-28 下午11时17分31秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <2007-4-28 下午11时17分31秒 CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool> <2007-4-28 下午11时17分32秒 CST> <Notice> <Log Management> <BEA-170019> <The server log file E:\bea\user_projects\domains\mydomain\servers\AdminServer\logs\AdminServer.log is opened. All server side log events will be written to this file.> <2007-4-28 下午11时17分40秒 CST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.> <2007-4-28 下午11时17分48秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY> <2007-4-28 下午11时17分48秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING> <2007-4-28 下午11时18分01秒 CST> <Notice> <Log Management> <BEA-170027> <The server initialized the domain log broadcaster successfully. Log messages will now be broadcasted to the domain log.> <2007-4-28 下午11时18分03秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN> <2007-4-28 下午11时18分03秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING> <2007-4-28 下午11时18分13秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 169.254.188.1:7001 for protocols iiop, t3, ldap, http.> <2007-4-28 下午11时18分13秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 123.5.50.138:7001 for protocols iiop, t3, ldap, http.> <2007-4-28 下午11时18分13秒 CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, http.> <2007-4-28 下午11时18分13秒 CST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "mydomain" running in Development Mode> <2007-4-28 下午11时18分14秒 CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING> <2007-4-28 下午11时18分14秒 CST> <Warning> <Server> <BEA-002611> <Hostname "LENOVO-97594CC8", maps to multiple IP addresses: 169.254.188.1, 123.5.50.138> <2007-4-28 下午11时18分15秒 CST> <Warning> <Server> <BEA-002611> <Hostname "lenovo-97594cc8", maps to multiple IP addresses: 169.254.188.1, 123.5.50.138> <2007-4-28 下午11时18分15秒 CST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.