﻿<?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>IT博客-生命源代码-文章分类-JAVA开发</title><link>http://www.cnitblog.com/Walter/category/7862.html</link><description>在自己设计的操作系统里，用自己发明的编程语言，写自己的生命代码---</description><language>zh-cn</language><lastBuildDate>Thu, 29 Sep 2011 11:05:30 GMT</lastBuildDate><pubDate>Thu, 29 Sep 2011 11:05:30 GMT</pubDate><ttl>60</ttl><item><title>（原）测试 Tesseract-OCR 在windows平台过程记录</title><link>http://www.cnitblog.com/Walter/articles/72987.html</link><dc:creator>HQ</dc:creator><author>HQ</author><pubDate>Mon, 07 Mar 2011 15:10:00 GMT</pubDate><guid>http://www.cnitblog.com/Walter/articles/72987.html</guid><wfw:comment>http://www.cnitblog.com/Walter/comments/72987.html</wfw:comment><comments>http://www.cnitblog.com/Walter/articles/72987.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/Walter/comments/commentRss/72987.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Walter/services/trackbacks/72987.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;由于承接各种项目的缘故，遇到了所谓分析图片内容相关的需求。特地研究了一番OCR。看到很多人都困惑在这里，特记录过程如下： 参考网站：http://blog.csdn.net/zhoushuyan/archive/2010/10/18/5948289.aspx http://blog.csdn.net/foamflower/archive/2010/12/31/6110211.a...&nbsp;&nbsp;<a href='http://www.cnitblog.com/Walter/articles/72987.html'>阅读全文</a><img src ="http://www.cnitblog.com/Walter/aggbug/72987.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Walter/" target="_blank">HQ</a> 2011-03-07 23:10 <a href="http://www.cnitblog.com/Walter/articles/72987.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>精简出最小jre （经典文章-转载）</title><link>http://www.cnitblog.com/Walter/articles/59164.html</link><dc:creator>HQ</dc:creator><author>HQ</author><pubDate>Tue, 09 Jun 2009 02:18:00 GMT</pubDate><guid>http://www.cnitblog.com/Walter/articles/59164.html</guid><wfw:comment>http://www.cnitblog.com/Walter/comments/59164.html</wfw:comment><comments>http://www.cnitblog.com/Walter/articles/59164.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Walter/comments/commentRss/59164.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Walter/services/trackbacks/59164.html</trackback:ping><description><![CDATA[<p>基本知道思路了，我把写的程序打包成jar，能双击运行了，然后拷贝一个jre到程序目录下，具体是这样的，目录叫dict，dict下面有dict.jar、jre（目录），然后写了一个cmd脚本：<br>@echo off<br>set path=%cd%\jre\bin<br>java -jar -verbose:class dict.jar &gt;&gt;class.txt<br>pause<br>这样程序使用的就是当前目录下的jre，程序运行后，最好把所有的功能使用一遍，这样输出了一个文件class.txt，里面有所有需要的class，其格式如下：<br>[Opened D:\data\dict\jre\lib\rt.jar]<br>[Loaded java.lang.Object from D:\data\dict\jre\lib\rt.jar]<br>[Loaded java.io.Serializable from D:\data\dict\jre\lib\rt.jar]<br>[Loaded java.lang.Comparable from D:\data\dict\jre\lib\rt.jar]<br>[Loaded java.lang.CharSequence from D:\data\dict\jre\lib\rt.jar]<br>[Loaded org.apache.lucene.index.CompoundFileReader$FileEntry from file:/D:/data/dict/dict.jar]</p>
<p>我们依照这个文件来裁剪rt.jar：<br>首先在utralEdit中进行一些处理，去掉所有不是rt.jar中的class的行,去掉from后面的，去掉loaded等无关项目，再把&#8220;.&#8221;替换成&#8220;/&#8221;.这个可以利用正则表达式等轻松处理。处理完后得到的文件类似如下格式：<br>java/lang/Object<br>java/io/Serializable<br>java/lang/Comparable<br>java/lang/CharSequence<br>java/lang/String <br>然后写一个脚本或者程序处理，将rt中需要的的class拷贝到另一个对应的文件夹rt1，我用java写了一个,没有时间仔细改，但能完成人物了。代码如下：<br>import java.io.File;<br>import java.io.FileInputStream;<br>import java.io.FileOutputStream;<br>import java.io.IOException;<br>import java.io.InputStreamReader;<br>import java.io.LineNumberReader; public class ReduceRt {<br>//文件拷贝<br>public static boolean copy(String file1,String file2)<br>{<br>try //must try and catch,otherwide will compile error<br>{<br>// instance the File as file_in and file_out<br>java.io.File file_in=new java.io.File(file1);<br>java.io.File file_out=new java.io.File(file2);<br>FileInputStream in1=new FileInputStream(file_in);<br>FileOutputStream out1=new FileOutputStream(file_out);<br>byte[] bytes=new byte[1024];<br>int c;<br>while((c=in1.read(bytes))!=-1)<br>out1.write(bytes,0,c);<br>in1.close();<br>out1.close();<br>return(true); //if success then return true<br>}</p>
<p>catch(Exception e)<br>{<br>System.out.println("Error!");<br>return(false); //if fail then return false<br>}<br>}<br>//读取路径,copy<br>public static int dealClass(String needfile ,String sdir,String odir) throws IOException<br>{<br>int sn = 0; //成功个数</p>
<p>File usedclass = new File(needfile);<br>if(usedclass.canRead())<br>{<br>String line = null;<br>LineNumberReader reader = new LineNumberReader(new InputStreamReader(new FileInputStream(usedclass),"UTF-8"));<br>while((line = reader.readLine())!=null)<br>{<br>line = line.trim();<br>int dirpos =line.lastIndexOf("/");<br>if(dirpos&gt;0)<br>{<br>String dir = odir+ line.substring(0,dirpos);<br>File fdir = new File(dir);<br>if(!fdir.exists())<br>fdir.mkdirs();<br>String sf = sdir + line + ".class";<br>String of = odir + line + ".class";<br>boolean copy_ok=copy(sf.trim(),of.trim());<br>if(copy_ok)<br>sn++;<br>else<br>{<br>System.out.println(line);<br>}</p>
<p>}</p>
<p>}<br>}<br>return sn;</p>
<p>}</p>
<p>public static void main(String[] args)<br>{<br>String needfile = "usedclass.txt";<br>String sdir = "./rt/";<br>String odir = "./rt1/";<br>try {<br>int sn = dealClass(needfile,sdir,odir);<br>System.out.print(sn);<br>} catch (IOException e) {<br>// TODO 自动生成 catch 块<br>e.printStackTrace();<br>}</p>
<p>}</p>
<p>}</p>
<p>我裁剪出来的rt大小为500多k。然后将rt1里面的目录和文件打包成rt.zip,改名为rt.jar，然后替换原来的rt.jar。具体的步骤可以参考上面提到的那两篇文章。</p>
<p>#######################</p>
<p>如何制作最小的RCP程序压缩包（包含JRE）</p>
<p>Java开发程序，发布时总要考虑的问题就是怎么在使用者的机器上装好JRE。要考虑的问题很多：使用者有没有能力独自安装JRE，使用者已有的 JRE 和我们需要的版本是不是一致，会不会出现版本问题，等等。使用.NET要考虑的问题就少些。现在.NET CLR似乎已经很普及了，看好多D版的 Win XP都会自己安装最新的.NET CLR，而且似乎它的安装界面也比JRE友好些。彻底解决安装JRE的问题的方案，就是让我们的应用程序自己背着JRE！这样，我们的程序就像传统的Win32应用程序一样，双击就可以执行，不用管所在的机器上是否有JRE，是什么版本的JRE，无论怎样，我有我自己的！要做到这一点，其实非常容易。<br>王森在他的《Java深度历险》（强力推荐这本书，内容少而精）的第一章就解释了JDK，JRE，JVM之间的关系。解释了我们执行java.exe时发生的事情。其中提到，java.exe依照一套逻辑来寻找可以用的JRE，首先查找自己所在的目录下有没有 JRE（据王森讲这样说不确切，我没有JDK全部的源代码，在此无从考证）；其次查找自己的父目录下有没有JRE；最后才是查询Windows的注册表。<br>通常我们在安装好了JRE的机器上的任何一个目录下都可以执行java.exe。因为它在安装时被复制到了windows的system32目录下，而后者无论如何都会在path环境变量中。这个java.exe最终必然会访问注册表来确定真正的JRE的所在地。若我们要求每一个应用程序都自带JRE，必然不能走这条路。但，逻辑的第二条讲，java.exe会在它的父目录下查找JRE，解决方案就在这一条中。<br>假设我们的应用程序打好了包，叫做 MyApp.jar，放在MyApp的目录下。我们在MyApp目录下，可以执行java ?jar MyApp.jar来运行我们的程序。我们安装的是 JRE 1.5，在C:\Program Files\Java\jre1.5.0下。现在，我们只需要简单的将jre1.5.0目录搬到MyApp目录下，顺便改个容易写的名字比如叫jre。现在，我们的应用程序就象这样：<br>MyApp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MyApp.jar<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jre<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jre1.5.0目录下的全部内容<br>Java.exe 就在jre目录下的bin目录中。根据第二条逻辑，java.exe会在它的父目录中查找jre，实验证实，它会查找lib目录，而lib就在jre目录下。因此，这样java.exe就会确定jre的所在然后正常执行java程序，不会去管我们是否安装了JRE，注册表中是否有注册项这些杂事了。<br>试一下，在命令行下进入MyApp的目录下，假设它在C盘，将path指向MyApp下的JRE：<br>set path=c:\MyApp\jre\bin<br>然后运行：<br>java ?verbose ?jar MyApp.jar<br>加上verbose参数以确定我们确实用了这一套被搬出了家的JRE。<br>程序可以运行，并且在命令行输出的前几行，可以看到：<br>[Opened C:\MyApp\jre\lib\rt.jar]<br>[Opened C:\MyApp\jre\lib\jsse.jar]<br>[Opened C:\MyApp\jre\lib\jce.jar]<br>[Opened C:\MyApp\jre\lib\charsets.jar]<br>因此程序读取的确实是它的私有的JRE。<br>至此，我们似乎完成了任务。但是现在我们的私有JRE仍不完美，缺点是太大。JRE 1.5有接近70MB，作为我们的私有的JRE，好多内容都是可以抛弃的。Jre目录下的license都可以不要，bin下的执行文件只需要保留java.exe或者javaw.exe，lib下只要保留rt，jsse， jce，charsets几个库就可以了。除了i386和zi两个子目录外，其余的子目录都可以不要。Zi下只需要保留自己地区的子目录和其下的一些文件就可以。Lib下除了库之外的属性文件等等都要保留。这样清理一番，JRE仍然有接近50MB。还可以继续清理几个库文件里面不需要的内容，这需要仔细的整理，会很费功夫。最好能写出一个自动工具帮助我们整理它们。从Sun公司上下到的JMF里面附带的用Java写的媒体播放器就自带了JRE，只有几个 MB。<br>清理过后需要运行几遍我们的应用程序，以确保我们的JRE不缺少东西。<br>如果我们希望能有一个程序直接启动我们的应用程序，那就还要费些功夫。最简单的方法是弄出一个快捷方式来，但是快捷方式的路径不能是相对的，不方便我们安装。我想到的方案就是用Win32程序包装一下。在VS.NET下写一个Win32小程序：<br>int PASCAL WinMain( HINSTANCE hInstance,<br>&nbsp;&nbsp;&nbsp;&nbsp; HINSTANCE hPrevInstance,<br>&nbsp;&nbsp;&nbsp;&nbsp; LPSTR lpszCmdLine,<br>&nbsp;&nbsp;&nbsp;&nbsp; int nCmdShow )<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp; STARTUPINFO si;<br>&nbsp;&nbsp;&nbsp;&nbsp; PROCESS_INFORMATION pi;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; ZeroMemory( &amp;si, sizeof(si) );<br>&nbsp;&nbsp;&nbsp;&nbsp; si.cb = sizeof(si);<br>&nbsp;&nbsp;&nbsp;&nbsp; ZeroMemory( &#960;, sizeof(pi) );</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; // Start the child process. <br>&nbsp;&nbsp;&nbsp;&nbsp; if( !CreateProcess( "jre\\bin\\javaw.exe",//执行的程序名<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "jre\\bin\\javaw.exe -jar MyApp.jar", // 带参数的执行程序<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Process handle not inheritable. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Thread handle not inheritable. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FALSE,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Set handle inheritance to FALSE. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // No creation flags. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Use parent's environment block. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Use parent's starting directory. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;si,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Pointer to STARTUPINFO structure.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#960; )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Pointer to PROCESS_INFORMATION structure.<br>&nbsp;&nbsp;&nbsp;&nbsp; ) <br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ErrorExit( "CreateProcess failed." );<br>&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; // Wait until child process exits.<br>&nbsp;&nbsp;&nbsp;&nbsp; WaitForSingleObject( pi.hProcess, INFINITE );</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; // Close process and thread handles. <br>&nbsp;&nbsp;&nbsp;&nbsp; CloseHandle( pi.hProcess );<br>&nbsp;&nbsp;&nbsp;&nbsp; CloseHandle( pi.hThread );<br>}<br>基本上是按照MSDN文档中的例子照搬的。将它编译成一个EXE文件，我们的任务才全部完成。双击这个EXE文件，我们的程序启动了，看起来和传统的Win32程序没有两样，JRE完全被隐藏在底层。</p>
<p>###################</p>
<p>如何制作最小的RCP程序压缩包（包含JRE）</p>
<p>如果开发完了一个RCP应用程序，要安装到客户端，那么这个安装文件会有多大呢，我们当然希望是越小越好。</p>
<p>我们先算一下普通方式下的文件大小：</p>
<p>jre1.5 安装程序 16M</p>
<p>rcp3.2 runtime 9M</p>
<p>rcp应用程序（包含用到的第三方的lib） 此处假设 2－3M</p>
<p>那么将这些文件打成包后的大小将为28M左右，一个普通的rcp安装程序居然会有这么大。这实在有点令人难以接受。</p>
<p>难道就不能再小一点吗？我们多么希望有一个小巧的RCP安装程序啊。答案是肯定的，我们完全可以将RCP安装程序控制在10M以内，甚至更小。</p>
<p>此处只介绍如何压制一个最小的RCP压缩包，至于如何制作安装程序，已经超出了讨论的范畴，只要有了最小的压缩包，不论用何种安装程序，都可以制作出10M以下的RCP安装程序。</p>
<p>第一步： jre 减肥</p>
<p>jre1.5安装程序有16M，这可是一个大东西，客户想要运行RCP程序，首先就要安装JRE。这也是很多客户反感的，jre里面包含了太多的东西，很多是rcp程序根本用不到的，比如swing库，如果全是用swt开发，swing包就多此一举了。 而且JRE的安装程序也不见的那么健壮，笔者就曾经两次遇到在不同的机器上不能成功安装jre的情况，而且通过添加删除程序也删不掉，非常烦人。其实完全没有必要安装JRE，只需要在rcp安装目录下建一个jre目录，里面包含jre用到的文件就可以了。rcp程序启动时，会首先查找当前目录下有没有jre目录，如果有，就用里面的jre，如果没有才去注册表查找jre。接下来，我们看看这个jre目录里面都有哪些东西，一些不要的统统删掉，至于删掉哪些，要根据情况而定，这个需要反复实验才能确定哪些有用，哪些没用。最后bin目录笔者保留了必须的dll和exe文件，llib目录里面，只保留了rt.jar和charsets.jar这两个库。但是rt.jar还是太大了32M，既然要减肥，那就彻底减到底吧，用winrar或者其他解压缩工具打开rt.jar，看看哪些包里面的class不需要，就统统删掉。例如，客户端不需要swing,javax.swing包干掉，客户端不需要rmi，javax.rmi包干掉，删来删去，最后rt.jar变成了10多M, charsets.jar这个包也挺大8M，里面包含了不同的字符集编码，其实很多字符集都用不到，根据情况挑选你所用的吧。</p>
<p>到了这一步，jre已经瘦了一圈了，但还是不能达到我们的目的，如果用普通的压缩工具压缩jre目录后，基本可以达到10到12多M。这离我们的目标还差好大一快呢。jre还的减肥，这次狠一点，拿出我们的杀手武器pack200，pack200是java1.5自带的（在jre\bin\目录下）一个针对class文件进行压缩的工具，由于专门针对class文件进行了优化，压缩比高的惊人（当然速度也比普通压缩软件慢多了）pack200的用法请自行参考相关文档</p>
<p>。先用pack200把rt.jar,和charsets.jar压缩一下，然后用其他压缩软件对jre整个目录压缩一下，压缩后的大小让你吃惊，如果用rar，压缩出来的是4M，zip高一些4.8M。可能是笔者删的东西太多了，所以会这么小。但这里还包含一个8M的charsets.jar文件。笔者试过，如果不包括charset.jar，用rar压缩后大小为2.88M,这实在太惊人了，有谁能想象一个只有2.88M的JRE，遗憾的是charset.jar是必须的，你可以删掉里面一些不要的字符集这样能压出来的jre也再3M-4M之间。必须注意的是，解压缩的时候，还要用pack200解开压缩后的jar文件。整个步骤就是压缩两遍，第一遍用pack200压缩所有的jar文件，第二遍再用一个其他压缩软件压缩jre目录。这样就能得到一个很小的jre压缩包。</p>
<p>看到这里，有人开始怀疑，这个3M多的JRE能用吗？笔者就曾将这个jre放到eclipse目录下，eclipse启动一切正常，进去后可以继续写我的java代码，还可以编译java文件（其实eclispe本身不需要tools.jar,它自己就带了一个很强的java编译器），从cvs下载文件也不成问题，试了一圈，没发现有什么出错的地方。当然，包不齐，少了那个class文件，就会出错了，所以删除class文件的时候，尽量不要多删。如果你很熟悉每个class文件的用途，就可以放心的去删了。如果SUN能出一个 MINI JRE 那就更好了。</p>
<p>第二步: RCP插件减肥</p>
<p>记不清从eclipse3.1起的那个版本，已经开始支持将插件打包成一个jar文件，甚至这个插件里面包含着其他的jar文件，这在3.1以前只能创建一个插件目录。既然插件可以打包成jar文件，那么pack200就派上用场了，同压缩jre一样，此处就不在叙述了。</p>
<p><br>值的注意的问题是，有的插件jar文件里面包含一个目录lib,lib里面又包含了其他的jar文件，那么用pack200对这个插件jar压缩的时候，lib里面的jar文件是不会压缩的。这个也不是什么问题，只要写个小程序，对lib里面的jar文件压缩一下就行了。</p>
<p>笔者实验的所做的RCP的插件压缩后的大小为6M多，这里面包括rcp runtime 必须的插件，以及自己开发的rcp程序，用到的第三方库，以及eclipse的一些插件emf,gef,jface-databinding等，这些加起来压缩后总共6M多。如果你用的插件不是那么多，压缩后的肯定更小。 这样加上jre，整个程序控制在了10M以内。</p>
<p>让人非常讨厌的是，从eclispe3.2M5 起，又加了一个com.ibm.icu的插件，这个插件竟然有3M多，而且这个插件是rcp runtime必须的。其实这个插件又是一个和字符集相关的插件，里面很多字符集是程序用不到的，除非你的程序要支持多语言，但也不会把所有的语言都囊括吧。如果每个字符集都能做成一个插件，只挂接自己想需要的，哪可真是太好不过了。希望eclispe3。3会改进这一点。<br>&nbsp;</p>
<p>&nbsp;</p>
<img src ="http://www.cnitblog.com/Walter/aggbug/59164.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Walter/" target="_blank">HQ</a> 2009-06-09 10:18 <a href="http://www.cnitblog.com/Walter/articles/59164.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于 WebSphere 的应用部署(原)</title><link>http://www.cnitblog.com/Walter/articles/54779.html</link><dc:creator>HQ</dc:creator><author>HQ</author><pubDate>Sat, 21 Feb 2009 03:59:00 GMT</pubDate><guid>http://www.cnitblog.com/Walter/articles/54779.html</guid><wfw:comment>http://www.cnitblog.com/Walter/comments/54779.html</wfw:comment><comments>http://www.cnitblog.com/Walter/articles/54779.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Walter/comments/commentRss/54779.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Walter/services/trackbacks/54779.html</trackback:ping><description><![CDATA[<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center; mso-pagination: widow-orphan" align=left><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">关于</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 14pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> WebSphere </span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 14pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">的应用部署<br></span></strong><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">作者：</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> Walter Zhou<span style="mso-spacerun: yes">&nbsp; </span></span><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">日期</span><span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> </span><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">：</span><span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> <span lang=EN-US>2007-6-15<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">服务器</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">IP </span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> http://192.168.1.240/<o:p></o:p></span></strong></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">操作系统</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"><span style="mso-spacerun: yes">&nbsp; </span></span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> FEDORA LINUX 6</span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">。</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">0<o:p></o:p></span></strong></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">WEB</span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">应用</span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> </span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt">：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"> Apache + WebSphere + DB2<o:p></o:p></span></strong></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">下面是终端登陆步骤：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></strong></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 19.5pt; TEXT-INDENT: -19.5pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-list: l0 level1 lfo2; tab-stops: list 19.5pt" align=left><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><span style="mso-list: Ignore">一.<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </span></span></span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">管理</span></strong><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">Websphere</span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">服务</span></strong><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br><strong style="mso-bidi-font-weight: normal">1</strong>:</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">通过</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">ssh</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">查看</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">websphere</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">的服务状态</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <br>&nbsp;</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">登陆</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">ssh : ssh 192.168.1.240 &#8211;l root </span><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">(ENTER)<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">输入密码！</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&nbsp;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">cd opt/IBM/WebSphere/AppServer/bin<br>(</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">注：可以使用</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&nbsp;./serverStatus.sh -all -user </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">第一步重大登录名</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> -password </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">第一步中的密码</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">这样就可以查看所有</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">199</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">的</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">server</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">情况，比如</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">server1</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">已经启动</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">)<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br><strong style="mso-bidi-font-weight: normal">2</strong>:./startServer.sh server1&nbsp;</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以开启服务</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <br>&nbsp; ./stopServer.sh server1&nbsp;</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以停止服务</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&nbsp;<br>&nbsp; ./startNode.sh&nbsp;&nbsp; </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以开启节点（一个节点代表一个机器）</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&nbsp; ./stopNode.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以停止节点</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">&nbsp; cd opt/IBM/WebSphere/AppServer/profiles/Dmgr0101/bin<br>&nbsp; ./startManager.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">开启管理控制台</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp; ./stopManager.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">停止管理控制台</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br><strong style="mso-bidi-font-weight: normal">3</strong>:</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">一般开启服务的顺序是：</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;./stopManager.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">开启管理控制台</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;./startNode.sh&nbsp;&nbsp; </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以开启节点</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;./startServer.sh server1<br><strong style="mso-bidi-font-weight: normal">4</strong>:</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">一般停止服务的顺序是：</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;./stopServer.sh server1&nbsp;</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以停止服务</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;./stopNode.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">可以停止节点</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br>&nbsp;./stopManager.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">停止管理控制台</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br><strong style="mso-bidi-font-weight: normal">5</strong>:</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">备份以前的</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">stat.war<br>cd opt/IBM/WebSphere/AppServer/profiles/default/installedApps/was&#8230;/<br></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">将以前的东西备份一下。</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">tar -zcvf myfiles.tar.gz ./stat_war.ear (</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">将</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">./stat_war.ear</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">打包到当前目录下</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">)<br></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">相应的解包操作：</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">tar&nbsp; zxvf ./myfiles.tar.gz&nbsp; /home(</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">将</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">./stat_war.ear</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">打包到</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">home</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">目录下</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">)<br style="mso-special-character: line-break"><br style="mso-special-character: line-break"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 2.4pt 19.5pt; TEXT-INDENT: -19.5pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-list: l0 level1 lfo2; tab-stops: list 19.5pt; mso-margin-top-alt: auto; mso-outline-level: 3" align=left><strong style="mso-bidi-font-weight: normal"><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><span style="mso-list: Ignore">二.<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp; </span></span></span></strong><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">安装部署文件</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">:</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">比如说安装</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">loginServer.war<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 2.4pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-outline-level: 3" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><br></span><strong><span style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">部署和管理应用程序</span></strong><strong><span lang=EN-US style="COLOR: black; FONT-FAMILY: Arial; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></strong></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">在开发企业应用程序并配置应用程序服务器后，就可使用管理控制台在服务器上安装应用程序文件，并管理已部署应用程序的活动。</span><span lang=EN-US style="COLOR: black; FONT-FAMILY: Arial; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt">通过</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">./startManager.sh </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">开启管理控制台（默认为打开）</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l1 level1 lfo1; tab-stops: list 18.0pt"><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: Verdana; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-fareast-font-family: Verdana"><span style="mso-list: Ignore">1．<span style="FONT: 7pt 'Times New Roman'"> </span></span></span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">登陆控制台有两种方法：</span><span lang=EN-US style="FONT-FAMILY: Verdana; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><a href="http://192.168.1.240:9060/admin"><u><font color=#0044b6>http://192.168.1.240:9060/admin</font></u></a> </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</span> <span lang=EN-US><a href="http://192.168.1.240:9060/ibm/console"><u><font color=#0044b6>http://192.168.1.240:9060/ibm/console</font></u></a> </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般控制台的登陆都是和系统关联的，所以可以直接使用</span><span lang=EN-US>LINUX</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">系统用户登陆。</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"><img height=410 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/websphere-0.gif" width=765 border=0></o:lock></v:shapetype></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US>2. </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">通过</span><span lang=EN-US>winzip </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">或</span><span lang=EN-US> winrar </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">讲项目压缩成</span><span lang=EN-US> .zip </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">格式。（注：</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">必须保证项目文件处于压缩包中的根目录）</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US>3. </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">下面我们开始部署</span><span lang=EN-US> loginServer.war </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">点击</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;应用程序&#8221;</span><span lang=EN-US>/ </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;企业应用程序</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">如下图</span><span lang=EN-US>1</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><img height=433 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/ws-1.gif" width=876 border=0></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US>4</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">．然后选择</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;安装&#8221;</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">进入如下页面见图</span><span lang=EN-US>2</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><img height=407 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/ws-2.gif" width=859 border=0></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在&#8220;指定路径&#8221;选择本地磁盘的</span><span lang=EN-US> loginServer.war </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件。然后填写</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;上下文根&#8221;</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这里我填写的内容是</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;</span><span lang=EN-US>/loginServer</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;然后点击&#8220;下一步&#8221;。进入&#8220;选择生成缺省绑定和映射。&#8221;这个页面只要都选择默认就可以了继续</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;下一步&#8221;。然后你会看到</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;分析此应用程序导致以下安全性警告。&#8221;的页面。点击&#8220;继续&#8221;。如图</span><span lang=EN-US>3</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><img height=637 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/ws-3.gif" width=835 border=0></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;安装应用程序的目录&#8221;</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">输入：&#8220;</span><span lang=EN-US>/loginServer</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;然后&#8220;下一步&#8221;。注：其他为默认。&#8220;预编译</span><span lang=EN-US> JSP</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;不要开启。接下来的两个界面默认就可以&#8220;下一步&#8221;把：</span><span lang=EN-US>-</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）到这里就可以点击完成拉！图</span><span lang=EN-US>4</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><img height=640 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/ws-4.gif" width=835 border=0></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后可以看到正个安装过程！如有意外会现实安装成功！见图</span><span lang=EN-US>5</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><img height=607 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/ws-5.gif" width=622 border=0></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">点击</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;保存到主配制&#8221;一路保存。。。</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">然后又回到了图</span><span lang=EN-US>1</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的页面，只是多了一项见图</span><span lang=EN-US>6</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><v:shape id=_x0000_i1031 style="WIDTH: 414.75pt; HEIGHT: 19.5pt" type="#_x0000_t75"><v:imagedata src="file:///C:\DOCUME~1\dell\LOCALS~1\Temp\msohtml1\02\clip_image013.png" o:title="%7b41C79304-B3AF-47B2-BF41-9932364AD659%7d"></v:imagedata></v:shape></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">将前面复选框选上，然后点击上面的&#8220;启动&#8221;。输入：</span><span lang=EN-US><a href="http://192.168.1.240:9080/loginServer/"><u><font color=#0044b6>http://192.168.1.240:9080/loginServer/</font></u></a></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">就应该可以访问你部署的项目了！如果通过</span><span lang=EN-US>80</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">端口直接访问就</span> <span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">需要手工修改</span><span lang=EN-US> Aapache</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span><span lang=EN-US>plugin</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的配制文件。请查阅相关主题！</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">参考：</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US>1. IBM</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">官方</span><span lang=EN-US>Websphere</span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中文使用教程</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><a href="http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_appl.html"><u><font color=#0044b6>http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/trun_appl.html</font></u></a></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US>2. APACHE </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">官方文档</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><a href="http://httpd.apache.org/docs/2.0/"><u><font color=#0044b6>http://httpd.apache.org/docs/2.0/</font></u></a></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US>3. IBM Websphere </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">自带的光盘中</span><span lang=EN-US> doc </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关于</span><span lang=EN-US> IBM Http Plugin </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">组件的具体配制。</span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<img src ="http://www.cnitblog.com/Walter/aggbug/54779.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Walter/" target="_blank">HQ</a> 2009-02-21 11:59 <a href="http://www.cnitblog.com/Walter/articles/54779.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于:unknown Oracle major version 异常的解决方案 (原)</title><link>http://www.cnitblog.com/Walter/articles/53127.html</link><dc:creator>HQ</dc:creator><author>HQ</author><pubDate>Sat, 27 Dec 2008 13:02:00 GMT</pubDate><guid>http://www.cnitblog.com/Walter/articles/53127.html</guid><wfw:comment>http://www.cnitblog.com/Walter/comments/53127.html</wfw:comment><comments>http://www.cnitblog.com/Walter/articles/53127.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Walter/comments/commentRss/53127.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Walter/services/trackbacks/53127.html</trackback:ping><description><![CDATA[<p><font size=2><font face=宋体>作者：<span>Walter Chou <span>&nbsp;&nbsp; </span></span>出处<span>: <a href="http://www.cnitblog.com/walter"><font color=#666666>http://www.cnitblog.com/walter</font></a></span></font></font><span><br><br>首先，造成</span><span>hibernate</span><span>方言设置不正确的原因很多。以下列出了可能的解决办法：</span><span><br></span></p>
<p><span></span>&nbsp;</p>
<p><span>一：<span>MyEclipse</span><span>插件安装问题</span></span></p>
<p><span>插件本身在默认安装后，</span><span>Hibernate</span><span>相关的配置和生成的模版有误。可能的解决方式是重装</span><span>MyEclipse</span><span>插件，更换路径或版本号。<br>还有就是在配置项目的</span><span>Spring</span><span>和</span><span>hibernate</span><span>支持的时候将</span><span>hibernate</span><span>相关的包都勾上。</span><span>(</span><span>见图</span><span>1)</span></p>
<p>&nbsp;<img height=434 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/1.gif" width=572 border=0></p>
<p><span>在选择</span><span>JDBC</span><span>连接时，注意数据库方言设置是否正确。Oracle默认的方言是:Oracle9i/10g </span></p>
<p><span>二：&nbsp;<span>JDK</span><span>的安装问题</span></span></p>
<p><span>MyEclipse 4.5</span><span>以上版本，本身自带有</span><span>JRE</span><span>。但是常常问题就出现在这方面。默认带的</span><span>JDK</span><span>版本过低。导致在</span><span>6.5</span><span>或</span><span>6.6</span><span>版本中常出现内存泄露问题。所有的</span><span>MyEclipse</span><span>相关的插件都共用这个默认的</span><span>jre</span><span>如</span><span>MyEclipse Database Explorer </span><span>。。。</span> <br><span>建议不要使用</span><span>MyEclipse</span><span>自带的</span><span>JDK</span><span>，而使用系统安装的</span><span>JDK</span><span>（不是</span><span>JRE</span><span>）。</span></p>
<p><span>三：<span>数据库的</span><span>JDBC</span><span>驱动程序<br><br></span></span></p>
<p><span>针对</span><span>Oracle</span><span>来说，它的</span><span>JDBC</span><span>驱动有两种</span><span>class12.jar</span><span>和</span><span>ojdbc14.jar</span><span>，前者对</span><span>Hibernate</span><span>的支持不好，连接常出现问题，推荐后者。<br><span style="COLOR: red">由于驱动问题导致这个异常的情况特别多，因为ojdbc14.jar有两个版本，一个版本为9.0.1.1另一个是9.2.1.1后者经常性出现这个问题。<br>通过查看他们的大小可以看出来版本，推荐使用9.0.1.1版本（也就是文件大小是1.5MB左右）。9.2.1.1的JAR文件大小是1.1MB左右。<br><span style="COLOR: #000000">如果通过更换驱动还不能解决问题，请您继续往下看。</span></span>这里的驱动不是只在项目里用的驱动包，而是在配置&#8220;</span><span>MyEclipse Database Explorer</span><span>&#8221;连接数据库时所使用的</span><span>jar</span><span>包。（见图</span><span>2</span><span>）<br><img height=524 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/2.gif" width=524 border=0><br></span></p>
<p><span>如果项目一开始使用</span><span>12</span><span>的版本出现了这样的问题，后来再更换，就无法解决了。只能重装<span>MyEclipse </span><span>插件。</span><br><br>四：项目的相关配置文件<br><br></span><span>MyEclipse </span><span>会在项目相关的很多个配置文件中记录。典型的就是项目目录中那些以&#8220;</span><span>.</span><span>&#8221;开头的文件，查看一下就知道了</span><span>。(如图3)<br></span></p>
<p><span><img height=316 alt="" src="http://www.cnitblog.com/images/cnitblog_com/walter/3.gif" width=589 border=0><br>在</span><span>MyEclipse</span><span>较老版本的</span><span>&#8221;.myhibernatedata&#8221;</span><span>文件里加入如下内容也可以解决。</span></p>
<p><span>&#8220;</span><span>hibernate.dialect=org.hibernate.dialect.MySQLDialect</span><span>&#8221;</span><span>。</span><br>多查看一下这个文件，相关的参数还有：<span>configFile=/../../hibernate.cfg.xml" 是否指向错误。</span></p>
<img src ="http://www.cnitblog.com/Walter/aggbug/53127.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Walter/" target="_blank">HQ</a> 2008-12-27 21:02 <a href="http://www.cnitblog.com/Walter/articles/53127.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于:unknown Oracle major version 异常的分析（原）</title><link>http://www.cnitblog.com/Walter/articles/52051.html</link><dc:creator>HQ</dc:creator><author>HQ</author><pubDate>Fri, 28 Nov 2008 14:44:00 GMT</pubDate><guid>http://www.cnitblog.com/Walter/articles/52051.html</guid><wfw:comment>http://www.cnitblog.com/Walter/comments/52051.html</wfw:comment><comments>http://www.cnitblog.com/Walter/articles/52051.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.cnitblog.com/Walter/comments/commentRss/52051.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Walter/services/trackbacks/52051.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=2><font face=宋体>作者：<span>Walter Chou <span>&nbsp;&nbsp; </span></span>出处<span>: <a href="http://www.cnitblog.com/walter"><font color=#666666>http://www.cnitblog.com/walter</font></a><br></span></font></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最近一段时间，周围有好多朋友在用 spring 2.0 + hibernate 3.1 + MyEclipse6.5&nbsp; 整合开发项目的时候都出现了这个问题。异常的截图如下：<br>&nbsp;<img src="http://www.cnitblog.com/images/cnitblog_com/walter/101_109856_10bbca1b4dadcd8.jpg" border=0><br>网上找到了很多说法，现对这个问题分析如下：<br>首先是从代码的角度去看这个问题。查看了MyEclipse的日志文件信息如下： <br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">!</span><span style="COLOR: #000000">MESSAGE&nbsp;在&#8220;Generating&nbsp;Artifacts&#8221;期间发生了内部错误。&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">STACK&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>org.hibernate.HibernateException:&nbsp;unknown&nbsp;Oracle&nbsp;major&nbsp;version&nbsp;[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.dialect.DialectFactory$</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">.getDialectClass(DialectFactory.java:</span><span style="COLOR: #000000">135</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:</span><span style="COLOR: #000000">65</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:</span><span style="COLOR: #000000">39</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:</span><span style="COLOR: #000000">426</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:</span><span style="COLOR: #000000">128</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.cfg.Configuration.buildSettings(Configuration.java:</span><span style="COLOR: #000000">2005</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;com.genuitec.eclipse.hibernate.wizards.MEJDBCMetaDataConfiguration.readFromJDBC(MEJDBCMetaDataConfiguration.java:</span><span style="COLOR: #000000">72</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob$</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">.execute(GenerateArtifactsJob.java:</span><span style="COLOR: #000000">877</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:</span><span style="COLOR: #000000">65</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:</span><span style="COLOR: #000000">91</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.buildConfiguration(GenerateArtifactsJob.java:</span><span style="COLOR: #000000">858</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;com.genuitec.eclipse.hibernate.wizards.GenerateArtifactsJob.run(GenerateArtifactsJob.java:</span><span style="COLOR: #000000">405</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>at&nbsp;org.eclipse.core.internal.jobs.Worker.run(Worker.java:</span><span style="COLOR: #000000">55</span><span style="COLOR: #000000">)&nbsp;</span></div>
发现是HibernateException于是查看相关代码，在 org.hibernate.dialect.DialectFactory 及Dialect等相关类中发现如下：<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;<br><img id=Codehighlighter1_12_2606_Open_Image onclick="this.style.display='none'; Codehighlighter1_12_2606_Open_Text.style.display='none'; Codehighlighter1_12_2606_Closed_Image.style.display='inline'; Codehighlighter1_12_2606_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_12_2606_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_12_2606_Closed_Text.style.display='none'; Codehighlighter1_12_2606_Open_Image.style.display='inline'; Codehighlighter1_12_2606_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_12_2606_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_12_2606_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;HashMap();<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">HSQL&nbsp;Database&nbsp;Engine</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.HSQLDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">DB2/NT</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.DB2Dialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">DB2/LINUX</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.DB2Dialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">MySQL</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.MySQLDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">PostgreSQL</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.PostgreSQLDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Microsoft&nbsp;SQL&nbsp;Server&nbsp;Database</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.SQLServerDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Microsoft&nbsp;SQL&nbsp;Server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.SQLServerDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Sybase&nbsp;SQL&nbsp;Server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.SybaseDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Adaptive&nbsp;Server&nbsp;Enterprise</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.SybaseDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Informix&nbsp;Dynamic&nbsp;Server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.InformixDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Apache&nbsp;Derby</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;VersionInsensitiveMapper(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.DerbyDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br><img id=Codehighlighter1_1318_2598_Open_Image onclick="this.style.display='none'; Codehighlighter1_1318_2598_Open_Text.style.display='none'; Codehighlighter1_1318_2598_Closed_Image.style.display='inline'; Codehighlighter1_1318_2598_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1318_2598_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1318_2598_Closed_Text.style.display='none'; Codehighlighter1_1318_2598_Open_Image.style.display='inline'; Codehighlighter1_1318_2598_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAPPERS.put(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Oracle</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;DatabaseDialectMapper()&nbsp;</span><span id=Codehighlighter1_1318_2598_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_1318_2598_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getDialectClass(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;majorVersion)<br><img id=Codehighlighter1_1393_2587_Open_Image onclick="this.style.display='none'; Codehighlighter1_1393_2587_Open_Text.style.display='none'; Codehighlighter1_1393_2587_Closed_Image.style.display='inline'; Codehighlighter1_1393_2587_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1393_2587_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1393_2587_Closed_Text.style.display='none'; Codehighlighter1_1393_2587_Open_Image.style.display='inline'; Codehighlighter1_1393_2587_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1393_2587_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_1393_2587_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">switch</span><span style="COLOR: #000000">(majorVersion)<br><img id=Codehighlighter1_1448_2472_Open_Image onclick="this.style.display='none'; Codehighlighter1_1448_2472_Open_Text.style.display='none'; Codehighlighter1_1448_2472_Closed_Image.style.display='inline'; Codehighlighter1_1448_2472_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1448_2472_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1448_2472_Closed_Text.style.display='none'; Codehighlighter1_1448_2472_Open_Image.style.display='inline'; Codehighlighter1_1448_2472_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1448_2472_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_1448_2472_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;'\b'</span><span style="COLOR: #008000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;(DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle8iDialect&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">&nbsp;DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle8iDialect&nbsp;:&nbsp;(DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle8iDialect&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;DialectFactory._mthclass$(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.Oracle8iDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))).getName();<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">9</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;'\t'</span><span style="COLOR: #008000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;(DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle9iDialect&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">&nbsp;DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle9iDialect&nbsp;:&nbsp;(DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle9iDialect&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;DialectFactory._mthclass$(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.Oracle9iDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))).getName();<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;'\n'</span><span style="COLOR: #008000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;(DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle10gDialect&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">&nbsp;DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle10gDialect&nbsp;:&nbsp;(DialectFactory.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">$org$hibernate$dialect$Oracle10gDialect&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;DialectFactory._mthclass$(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">org.hibernate.dialect.Oracle10gDialect</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))).getName();<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;HibernateException(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">unknown&nbsp;Oracle&nbsp;major&nbsp;version&nbsp;[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;majorVersion&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">);<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div>
以上代码可以很清楚看到此异常被抛出时的定义，尤其是最后一行。那么我们为什么会遇到这个问题呢？<br>很明显跟hibernate的dialect（方言）配置有关！也就是说它的判断应该是这样的逻辑：<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">MAPPERS.put(&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Oracle</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;<br><img id=Codehighlighter1_81_582_Open_Image onclick="this.style.display='none'; Codehighlighter1_81_582_Open_Text.style.display='none'; Codehighlighter1_81_582_Closed_Image.style.display='inline'; Codehighlighter1_81_582_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_81_582_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_81_582_Closed_Text.style.display='none'; Codehighlighter1_81_582_Open_Image.style.display='inline'; Codehighlighter1_81_582_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;DatabaseDialectMapper()&nbsp;</span><span id=Codehighlighter1_81_582_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_81_582_Open_Text><span style="COLOR: #000000">{&nbsp;<br><img id=Codehighlighter1_149_565_Open_Image onclick="this.style.display='none'; Codehighlighter1_149_565_Open_Text.style.display='none'; Codehighlighter1_149_565_Closed_Image.style.display='inline'; Codehighlighter1_149_565_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_149_565_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_149_565_Closed_Text.style.display='none'; Codehighlighter1_149_565_Open_Image.style.display='inline'; Codehighlighter1_149_565_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;String&nbsp;getDialectClass(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;majorVersion)&nbsp;</span><span id=Codehighlighter1_149_565_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_149_565_Open_Text><span style="COLOR: #000000">{&nbsp;<br><img id=Codehighlighter1_194_545_Open_Image onclick="this.style.display='none'; Codehighlighter1_194_545_Open_Text.style.display='none'; Codehighlighter1_194_545_Closed_Image.style.display='inline'; Codehighlighter1_194_545_Closed_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_194_545_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_194_545_Closed_Text.style.display='none'; Codehighlighter1_194_545_Open_Image.style.display='inline'; Codehighlighter1_194_545_Open_Text.style.display='inline';" src="http://www.cnitblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">switch</span><span style="COLOR: #000000">&nbsp;(&nbsp;majorVersion&nbsp;)&nbsp;</span><span id=Codehighlighter1_194_545_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnitblog.com/Images/dot.gif"></span><span id=Codehighlighter1_194_545_Open_Text><span style="COLOR: #000000">{&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;Oracle8iDialect.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">.getName();&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">9</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;Oracle9iDialect.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">.getName();&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">case</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;Oracle10gDialect.</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">.getName();&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000">:&nbsp;</span><span style="COLOR: #0000ff">throw</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;HibernateException(&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">unknown&nbsp;Oracle&nbsp;major&nbsp;version&nbsp;[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;majorVersion&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;);&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);&nbsp;</span></div>
正好有个项目开发环境用了Oracle 11g。那么也同样遇到了这个问题。<br>看上面的代码就知道了，只有对10g的支持。<br>后来经过一番研究发现如果是标准的11g，那么将dataSource相关的xml配置里dialect相关的地方用10g的方言也是可以支持的。配置如下：<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">property&nbsp;</span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="hibernateProperties"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">props</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">prop&nbsp;</span><span style="COLOR: #ff0000">key</span><span style="COLOR: #0000ff">="hibernate.dialect"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;org.hibernate.dialect.Oracle10gDialect<br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">prop</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">props</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.cnitblog.com/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">property</span><span style="COLOR: #0000ff">&gt;</span></div>
注意到版本了吧，如果你用的是Oracle9i那么就改成Oracle9iDialect就可以了。<br>当然，从上面的代码看造成这个问题不一定只有这一个原因，查看Oracle的jdbc驱动发现也有对org.hibernate.dialect的支持。请使用ojdbc14.jar的驱动，12版的驱动对dialect的支持并不是太好。在有就是可能你在配置数据库联接的时候有操作上的问题。不管怎么说他都是没有找到相匹配的方言造成的。<br>如果还是没有解决问题可参考我的另一篇文章：<a href="http://www.cnitblog.com/Walter/articles/53127.html" target=_new><font style="COLOR: red" color=#666666>http://www.cnitblog.com/Walter/articles/53127.html</font></a><br>
<img src ="http://www.cnitblog.com/Walter/aggbug/52051.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Walter/" target="_blank">HQ</a> 2008-11-28 22:44 <a href="http://www.cnitblog.com/Walter/articles/52051.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>