﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-AntiquMan-随笔分类-WebApp</title><link>http://www.blogjava.net/AntiquMan/category/39956.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 02 Jun 2009 06:34:38 GMT</lastBuildDate><pubDate>Tue, 02 Jun 2009 06:34:38 GMT</pubDate><ttl>60</ttl><item><title>Eclipse 3.2 + MyEclipse 5.0GA + WebLogic 9.2 配置详解</title><link>http://www.blogjava.net/AntiquMan/archive/2009/06/02/279566.html</link><dc:creator>AntiquMan</dc:creator><author>AntiquMan</author><pubDate>Tue, 02 Jun 2009 05:48:00 GMT</pubDate><guid>http://www.blogjava.net/AntiquMan/archive/2009/06/02/279566.html</guid><wfw:comment>http://www.blogjava.net/AntiquMan/comments/279566.html</wfw:comment><comments>http://www.blogjava.net/AntiquMan/archive/2009/06/02/279566.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/AntiquMan/comments/commentRss/279566.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/AntiquMan/services/trackbacks/279566.html</trackback:ping><description><![CDATA[<span style="font-family: Arial; color: rgb(51,102,255); font-weight: bold">选择 WebLogic 9.2 的原因</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">①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。</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">Servlet 2.3 规范生成的 web.xml 头部：</span><br style="font-family: Arial" />
<span style="font-family: Arial"><span style="font-family: Arial"><br />
<div style="padding-bottom: 4px; padding-left: 5.4pt; width: 95%; padding-right: 5.4pt; padding-top: 4px">
<div><img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /><span style="color: rgb(0,0,255)"><span style="color: rgb(255,0,255)">xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"</span><span style="color: rgb(0,0,255)">?&gt;</span><span style="color: rgb(0,0,0)"><br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span><span style="color: rgb(0,0,255)"><!----><span style="color: rgb(255,0,255)">DOCTYPE&nbsp;web-app&nbsp;PUBLIC&nbsp;"-//Sun&nbsp;Microsystems,&nbsp;Inc.//DTD&nbsp;Web&nbsp;Application&nbsp;2.3//EN"<br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />"http://java.sun.com/dtd/web-app_2_3.dtd"</span><span style="color: rgb(0,0,255)">&gt;</span><span style="color: rgb(0,0,0)"><br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span><span style="color: rgb(0,0,255)">&lt;</span><span style="color: rgb(128,0,0)">web-app</span><span style="color: rgb(0,0,255)">&gt;</span><span style="color: rgb(0,0,0)"><br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />...<br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span><span style="color: rgb(0,0,255)"><!----><span style="color: rgb(128,0,0)">web-app</span><span style="color: rgb(0,0,255)">&gt;</span></span></span></span></div>
</div>
</span><span style="font-family: Arial"><br />
Servlet 2.4 规范生成的 web.xml 头部：</span><br style="font-family: Arial" />
<span style="font-family: Arial"><span style="font-family: Arial"><br />
<div style="padding-bottom: 4px; padding-left: 5.4pt; width: 95%; padding-right: 5.4pt; padding-top: 4px">
<div><img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /><span style="color: rgb(0,0,255)"><span style="color: rgb(255,0,255)">xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"</span><span style="color: rgb(0,0,255)">?&gt;</span><span style="color: rgb(0,0,0)"><br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span><span style="color: rgb(0,0,255)">&lt;</span><span style="color: rgb(128,0,0)">web-app&nbsp;</span><span style="color: rgb(255,0,0)">version</span><span style="color: rgb(0,0,255)">="2.4"</span><span style="color: rgb(255,0,0)">&nbsp;xmlns</span><span style="color: rgb(0,0,255)">="http://java.sun.com/xml/ns/j2ee"</span><span style="color: rgb(255,0,0)"><br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />xmlns:xsi</span><span style="color: rgb(0,0,255)">=http://www.w3.org/2001/XMLSchema-instance<br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span><span style="color: rgb(255,0,0)">xsi:schemaLocation</span><span style="color: rgb(0,0,255)">="http://java.sun.com/xml/ns/j2ee<br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"</span><span style="color: rgb(0,0,255)">&gt;</span><span style="color: rgb(0,0,0)"><br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" />...<br />
<img alt="" align="top" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" /></span><span style="color: rgb(0,0,255)"><!----><span style="color: rgb(128,0,0)">web-app</span><span style="color: rgb(0,0,255)">&gt;</span></span></span></div>
</div>
<br style="font-family: Arial" />
<span style="font-family: Arial">②若在上一个问题选择了 J2EE 1.3 进行开发后，在部署时会出现另外的异常，提示&#8220;<span style="color: rgb(255,0,0)">Unsupported major.minor version 49.0</span>&#8221;—— 又是版本问题，这次是由于 JDK 版本不支持造成的。WebLogic 8 不支持 JDK 1.5，由 JDK 1.5 编译的程序无法部署到只支持 JDK 1.4 的服务器上运行。解决的办法也有两个：用 JDK 1.4 重新编译；或者换用支持 JDK 1.5 的服务器，也就是升级到 WebLogic 9.2。</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial; color: rgb(51,102,255); font-weight: bold">配置 WebLogic 9.2</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">安装 WebLogic 比较容易，在这里就不再累述了，大家可以参阅相关文档。现在着重讲一下 WebLogic 的配置，因为后面在配置 MyEclipse 时将用到这里的配置信息。</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">①运行开始 -&gt; 程序 -&gt; BEA Products -&gt; Tools -&gt; Configuration Wizard。</span><br style="font-family: Arial" />
<span style="font-family: Arial">②选择 Create a new WebLogic domain，Next。</span><br style="font-family: Arial" />
<span style="font-family: Arial">③在 Select Domain Source 界面保持默认，Next。</span><br style="font-family: Arial" />
<span style="font-family: Arial">④在 User name 处输入 user，两个 password 都输入 12345678（密码要求 8 位），Next。</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑤ 在 Configure Server Start Mode and JDK 界面中保持默认，即 JDK 选择的是&#8220;Sun SDK 1.5.0_04 @ C:\BEA\jdk150_04&#8221;，注意这里若选择&#8220;Other JDK&#8221;配置比 SDK 1.5.0_04 更高的版本，服务器启动时将会出现异常，所以最好保持默认，然后 Next。</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑥在 Customize Environment and Services Settings 界面中默认为 No，Next。</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑦在 Domain name 处输入 mydomain，点击 Create。</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑧完成后点击 Done 关闭 Configuration Wizard 对话框。</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑨ 运行开始 -&gt; 程序 -&gt; BEA Products -&gt; User Projects -&gt; mydomain -&gt; Start Admin Server for Weblogic Server Domain，检查服务器是否启动成功。</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial; color: rgb(51,102,255); font-weight: bold">配置 MyEclipse 的 WebLogic 9 服务器</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">启 动 Eclipse，选择&#8220;Window -&gt; Preferences&#8221;菜单，打开首选项对话框。展开 MyEclipse 下的 Application Servers 节点，点击 WebLogic 9，选中右边的 Enable 单选按钮，启用 WebLogic 服务器。配置如下：</span><br style="font-family: Arial" />
<span style="font-family: Arial">①BEA home directory：C:\BEA（假定 WebLogic 安装在 C:\BEA 目录中）</span><br style="font-family: Arial" />
<span style="font-family: Arial">②WebLogic installation directory：C:\BEA\WebLogic92</span><br style="font-family: Arial" />
<span style="font-family: Arial">③Admin username：user（来自 WebLogic 中的配置）</span><br style="font-family: Arial" />
<span style="font-family: Arial">④Admin password：12345678（来自 WebLogic 中的配置）</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑤Execution domain root：C:\BEA\user_projects\domains\mydomain</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑥Execution server name：AdminServer</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑦Security policy file：C:\BEA\WebLogic92\server\lib\weblogic.policy</span><br style="font-family: Arial" />
<span style="font-family: Arial">⑧JAAS login configuration file：（Null）</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">接 着展开 WebLogic 9 节点，点击 JDK，在右边的 WLS JDK name 处选择 WebLogic 9 的默认 JDK。这里组合框中缺省为单独安装的 JRE。单击 Add 按钮，弹出 WebLogic -&gt; Add JVM 对话框，在 JRE 主目录处选择 WebLogic 安装文件夹中的 JDK 文件夹，我的版本为 C:\BEA\jdk150_04，程序会自动填充其他选项。单击确定按钮关闭对话框。这时候就可以在 WLS JDK name 组合框中选择 jdk150_04 了。</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">至 此，MyEclipse 中 WebLogic 9 的配置工作就算完成了。下面可以看看在 Eclipse 中能否启动 WebLogic 服务器了？安装了 MyEclipse 之后，Eclipse 工具栏中就会有一个&#8220;Run/Stop/Restart MyEclipse Application Servers&#8221;下拉按钮。点击该按钮的下拉部分，选择&#8220;WebLogic 9 -&gt; Start&#8221;菜单，即开始启动 WebLogic 了。通过查看控制台的消息，就可以检查启动是否成功，或发生什么异常。</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial; color: rgb(51,102,255); font-weight: bold">补充配置</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">点击 Paths，在右边的 Prepend to classpath 列表框中，通过 Add JAR/ZIP 按钮，加入：</span><br style="font-family: Arial" />
<span style="font-family: Arial; color: rgb(51,153,102)">C:\BEA\WebLogic81\server\lib\weblogic.jar</span><br style="font-family: Arial; color: rgb(51,153,102)" />
<span style="font-family: Arial; color: rgb(51,153,102)">C:\BEA\WebLogic81\server\lib\webservices.jar</span><br style="font-family: Arial" />
<span style="font-family: Arial">如果要用到数据库，还需要把数据库的驱动类库添加进来，这里我们用 WebLogic 自带的 SQL Server 数据库驱动类库：</span><br style="font-family: Arial" />
<span style="font-family: Arial; color: rgb(51,153,102)">C:\BEA\WebLogic81\server\lib\mssqlserver4v65.jar</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial; color: rgb(51,102,255); font-weight: bold">对常见启动问题</span><br style="font-family: Arial" />
<br style="font-family: Arial" />
<span style="font-family: Arial">出现 <span style="color: rgb(255,0,0)">The WebLogic Server did not start up properly.</span> 提示和 <span style="color: rgb(255,0,0)">java.io.InvalidClassException</span> 异常的问题，通常是因为 JDK 选择不当引起的，在 MyEclipse 的配置中选择的 JDK 应该必须与配置 WebLogic 时选择的 JDK 相同。当选择默认 JDK 时，也可以在 MyEclipse 中配置 BEA 的 jrockit90_150_04 这个 JDK。<br />
<br />
<br />
</span></span></span><span style="font-weight: bold">Eclipse 3.2 + MyEclipse 5.0GA + WebLogic 8.1 配置详解</span><br />
<br />
MyEclipse默认的应用服务器为JBoss3，这里我们使用WebLogic8.1。启动Eclipse，选择&#8220;窗口\首选项&#8221;菜单，打开首选项对 话框。展开MyEclipse下的Application Servers结点，点击JBoss 3，选中右面的Disable单选按钮，停用JBoss 3。然后点击WebLogic 8，选中右边的Enable单选按钮，启用WebLogic服务器。同时下面的配置如下： <br />
(1)BEA home directory：D:\BEA。假定WebLogic安装在D:\BEA文件夹中。 <br />
(2)WebLogic installation directory：D:\BEA\weblogic81。 <br />
(3)Admin username：user。 <br />
(4)Admin password：12345678。 <br />
(5)Execution domain root：D:\BEA\user_projects\dev。 <br />
(6)Execution domain name：dev。 <br />
(7)Execution server name：admin。 <br />
(8)Hostname:PortNumber：localhost:7001。 <br />
(9)Security policy file：D:\BEA\weblogic81\server\lib\weblogic.policy。 <br />
(10)JAAS login configuration file：省略。 <br />
<br />
接着展开WebLogic 8结点，点击JDK，在右边的WLS JDK name处选择WebLogic 8的默认JDK。这里组合框中缺省为j2re1.4.2_03，即之前单独安装的jre。单击Add按钮，弹出WebLogic &gt; Add JVM对话框，在JRE名称处随便输入一个名字，如jre1.4.1_02。然后在JRE主目录处选择WebLogic安装文件夹中的JDK文件夹，如 D:\BEA\jdk141_02，程序会自动填充Javadoc URL文本框和JRE系统库列表框。单击确定按钮关闭对话框。这时候就可以在WLS JDK name组合框中选择jre1.4.1_02了。之后还要在下面的Optional Java VM arguments，如-ms64m -mx64m -Djava.library.path="D:/BEA/weblogic81/server/bin" -Dweblogic.management.discover=false -Dweblogic.ProductionModeEnabled=false <br />
最后点击Paths，在右边的Prepend to classpath列表框中，通过Add JAR/ZIP按钮，加入D:\BEA\weblogic81\server\lib\weblogic.jar、D:\BEA\weblogic81\ server\lib\webservices.jar。如果用到数据库，还需把数据库的驱动类库加进来，这里我们用WebLogic自带的SQL Server数据库驱动库D:\BEA\weblogic81\server\lib\mssqlserver4v65.jar。 <br />
至此，MyEclipse中WebLogic8的配置工作就算完成了。下面可以看看在Eclipse中能否启动WebLogic了？自从安装了 MyEclipse之后，Eclipse工具栏中就会有一个Run/Stop Servers下拉按钮。点击该按钮的下拉部分，选择&#8220;WebLogic 8\Start&#8221;菜单，即开始启动WebLogic了。通过查看下面的控制台消息，就可以知道启动是否成功，或有什么异常发生。停止WebLogic可选 择&#8220;WebLogic\Stop&#8221;菜单。<br style="font-family: Arial" />
</span>
 <img src ="http://www.blogjava.net/AntiquMan/aggbug/279566.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/AntiquMan/" target="_blank">AntiquMan</a> 2009-06-02 13:48 <a href="http://www.blogjava.net/AntiquMan/archive/2009/06/02/279566.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>