unix下的weblogic的安装.doc_第1页
unix下的weblogic的安装.doc_第2页
unix下的weblogic的安装.doc_第3页
unix下的weblogic的安装.doc_第4页
unix下的weblogic的安装.doc_第5页
已阅读5页,还剩53页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

众所周知,发布一个由jsp/SERVLET开发的网站,除了需要相应的WEB服务器来响应普通网页的请求外还需要专门的应用服务器来响应动态网页JSP/SERVLET的请求。对于商业用户来说,目前最流行的应用服务器软件要数BEA公司开发的WebLogic,下面介绍的是WebLogic5.1的版本。先将WebLogic解压到/usr目录下,需要修改WebLogic安装目录下的StartWebLogic.sh脚本文件来来设置你的CLASSPATH和Java_HOME,最后也是通过这个脚本文件来启动服务。现在启动的服务还不支持JSP/EJB/Servlet等技术,所以还需要修改WebLogic安装目录下的perties文件。下面就详细介绍如何来配置这个文件。第98行:weblogic.system.listenPort=80设置HTTP端口,默认是7001第114行:weblogic.passWord.system=11111111设置启动Console的密码,默认密码长度为8位第139行:weblogic.system.SSLListenPort=7002设置SSL端口,默认是7002第236行:weblogic.system.minPasswordLen=8设置最小密码长度,默认为8位第495行-第508行:设置你自己的RMI,命令格式如下:weblogic.system.startupClass.virtualName=fullPackageName例如:weblogic.system.startupClass.hello=examples.rmi.hello.HelloImpl第524行:#weblogic.ejb.deploy=# /usr/WebLogic/myserver/Your_Ejb.jar,默认情况是不允许使用EJB,如果要使用可以把前面的注释去掉,再设置你的EJB的路径第539行-第543行:增加用户列表,命令格式如下:weblogic.password.username=XXX例如:weblogic.password.xxx=11111111第604行:weblogic.httpd.session.enable=true允许在服务器端使用session;session在开发电子商务程序时非常有用第663行-第674行:663行:#weblogic.jdbc.connectionPool.db2Pool=664行:# url=jdbc:db2/localhost/database,665行:# driver=COM..DB2Driver,666行:# loginDelaySecs=1,667行:# initialCapacity=4,668行:# maxCapacity=10,669行:# capacityIncrement=2,670行:# allowShrinking=true,671行:# shrinkPeriodMins=15,672行:# refreshMinutes=10,673行:# testTable=table,674行:# props=user=db2admin;password=db2admin设置你要使用到的JDBC POOL,默认情况是不允许使用,如果要使用JDBC POOL可以将前面的注释去掉,不过首先你的JDBC驱动程 序必须是在StartWebLogic.sh的CLASSPATH中已经存在的。其中663行是设置JDBC POOL的名字(如db2Pool);664和665行是注册JDBC驱动程序以及连接的数据库;667行为缺省的连接数;668行为连接池中最大连接 数;674行为连接数据库的用户名和密码第767行:weblogic.httpd.register.*.sHtml=weblogic.servlet.ServerSideIncludeServlet允许使用SSI,即允许使用.shtml为后缀的扩展名第790行:weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet允许使用Servlet,例如URL:http:/localhost/servlets/foo/hello则实际路径为:/home/servlet/foo/hello.class第814行:weblogic.httpd.documentRoot=/home/www/此行为设定WEB页面的发布目录第831行:weblogic.httpd.servlet.classpath=/home/servlet此行用来设置放置Servlet等class文件的目录,当然这个目录还必须在StartWebLogic.sh的CLASSPATH中已经存在的第861行-第868行:861行:#weblogic.httpd.register.*.jhtml=862行:# weblogic.servlet.jhtmlc.PageCompileServlet863行:#weblogic.httpd.initArgs.*.jhtml=864行:# pageCheckSeconds=1,865行:# packagePrefix=examples.jhtml,866行:# compileCommand=/usr/java/bin/javac,867行:# workingDir=/home,868行:# verbose=true这几行是用来支持JHTML技术的,默认是不能使用JHTML扩展名,如果想使用JHTML,将前面的注释去掉即可。861行后面的*.jhtml用来注册使用扩展名为jhtml的任意文件;866行设置javac的目录第878行-第884行:878行:#weblogic.httpd.register.*.jsp=879行:# weblogic.servlet.JSPServlet880行:#weblogic.httpd.initArgs.*.jsp=881行:# pageCheckSeconds=1,882行:# compileCommand=/usr/java/bin/javac,883行:# workingDir=/home,884行:# verbose=true 这几行是用来支持JSP的,默认是不能使用JSP扩展名,如果想使用JSP,将前面的注释去掉即可。878行后面的*.jsp用来注册使用扩展名为 jsp的任意文件;882行设置javac的目录;在WebLogic中如果要运行test.jsp文件,是先将这个文件编译成_test.class后 在运行的,所以第883行设置的目录就是用来放编译后的.class文件用的到目前为止,WebLogic已经基本配置完成,可以用StartWebLogic.sh脚本来启动服务并且使用已经允许的技术。二说明:服务器硬件:sun E450 weblogic软件:weblogic 10一、在solaris字符界面创建weblogic域方法:* 到weblogic的安装目录下:cd weblogic$home/bea/wlserver_10.0/common/bin* 执行./config.sh命令./config.sh* 字符界面如下:Unable to instantiate GUI, defaulting to console mode.;Create or Extend a Configuration:-Choose between creating and extending a configuration. Based on yourselection, the Configuration Wizard guides you through the steps togenerate a new or extend an existing configuration.-;1|Create a new WebLogic configuration | Start here to create a WebLogic configuration in your projects |directory. 2|Extend an existing WebLogic configuration | Start here to extend an existing WebLogic configuration. Use this |option to addapplications and services, including Database access |(JDBC) and Messaging (JMS). This option also enables you to extend|functionality by enabling WebLogic Workshop.Enter index number to select OR ExitNext; 1;* 选择要创建的域:Select a Domain Template:-Please select a template from the list or select another directory oftemplates. * /export/home/bea/weblogic81/common/templates/domains 1|WebLogic Server Examples Domain | BEA Systems, Inc. | Create the WebLogic Server Examples domain in a directory outside of |the installedkit. The Examples domain contains a collection of |examples to show best practices for coding individual J2EE APIs.-;2|Basic WebLogic Server Domain | BEA Systems, Inc. | Create a basic WebLogic Server domain without installing sample |applications. 3|Basic WebLogic Workshop Domain | BEA Systems, Inc. | Create a basic WebLogic Workshop domain, without installing sample |applications. Domains created from this template will support the |WebLogic Server and WebLogic Workshop runtime functionality, including |support for J2EEapplications, Web applications, Web Services and |custom controls. Use domains created from this template for |development of WebLogic Workshop applications. 4|Avitek Medical Records Sample Domain Enter index number to select OR DownExitPreviousNext; 2;Choose Configuration Option:- *Do you want to run the wizard in express mode?-;1|Yes 2|NoEnter index number to select OR ExitPreviousNext; 1* 创建weblogic管理用户和密码:;Configure Administrative Username and Password:-Create a user automatically assigned to the Administrative Role. This useris the default administrator used to start development mode servers. | Name | Value | _|_|_| 1| *User name: | weblogic | 2| *User password: | | 3| *Confirm user password: | | 4| Description: | The default administration user |Select Option: 1 - Modify User name 2 - Modify User password 3 - Modify Confirm user password 4 - Modify DescriptionEnter option number to select OR ExitPreviousNext; 2;Configure Administrative Username and Password:-Create a user automatically assigned to the Administrative Role. This useris the default administrator used to start development mode servers. *User password: = Input new *User password: OR ExitResetAccept;Configure Administrative Username and Password:-Create a user automatically assigned to the Administrative Role. This useris the default administrator used to start development mode servers. | Name | Value | _|_|_| 1| *User name: | weblogic | 2| *User password: | * | 3| *Confirm user password: | | 4| Description: | The default administration user |Select Option: 1 - Modify User name 2 - Modify User password 3 - Modify Confirm user password 4 - Modify Description 5 - Discard ChangesEnter option number to select OR ExitPreviousNext; 3;Configure Administrative Username and Password:-Create a user automatically assigned to the Administrative Role. This useris the default administrator used to start development mode servers. *Confirm user password: = Input new *Confirm user password: OR ExitResetAccept;Configure Administrative Username and Password:-Create a user automatically assigned to the Administrative Role. This useris the default administrator used to start development mode servers. | Name | Value | _|_|_| 1| *User name: | weblogic | 2| *User password: | * | 3| *Confirm user password: | * | 4| Description: | administrator for liuhaibo |Select Option: 1 - Modify User name 2 - Modify User password 3 - Modify Confirm user password 4 - Modify Description 5 - Discard ChangesEnter option number to select OR ExitPreviousNext;* 选择要创建域Domain的模式:选择Production Mode模式Domain Mode Configuration:-Enable Development or Production Mode for this domain.-;1|Development Mode 2|Production ModeEnter index number to select OR ExitPreviousNext; 2;* Java环境选择:Java SDK SelectionJava SDK Selection:-;1|JRockit SDK 1.4.2_04-8130 /export/home/bea/jrockit81sp3_142_04 2|Other Java SDKEnter index number to select OR ExitPreviousNext; 2;* 选择domain的创建目录:注:目录路径不需要写domain的名称,要不目录会重。Select the target domain directory for this configuration:- Target Location = /export/home/bea/user_projects/domainsInput new Target Location OR ExitPreviousNext; /export/home/bea;Edit Domain Information:- | Name | Value | _|_|_| 1| *Name: | mydomain |Enter value for Name OR ExitPreviousNext;* 开始创建domain:;Creating Domain.0% 25% 50% 75% 100%-|-|-|-* Domain Created Successfully! *二、weblogic启动密码自动添加1、存储加密后的用户身份,使用perties文件来避免启动脚本中出现硬编码的用户身份。创建密码启动文件:perties cd /export/home/bea/mydomain 2、写入登陆用户、密码: # vi perties password=system username=manager 3、系统会自动加密用户名和密码: # vi perties #Thu Jun 16 12:01:02 CST 2005 password=3DESrS5f2/lJowyEnrkv5Q14tA= username=3DESRKPFkGopsVaY6aFXkOuAAA=三、nohup方式自启动weblogic1、在Unix中,使用 nohup 运行 WebLogic Server启动脚本,以保证即使您注销以后,服务器依然在后台运行。为了防止weblogic启动以后,退出登陆窗口weblogic会停止,所以使用nohup方式。2、在startWebLogic.sh文件中添加nohup和&后台符号。路径为:weblogic$home/bea/user_projects/domains/*/bin # more startWebLogic.shnohup $JAVA_HOME/bin/java $JAVA_VM $MEM_ARGS $JAVA_OPTIONS -Dweblogic.Name=$SERVER_NAME -Dweblogic.ProductionModeEnabled=$PRODUCTION_MODE -Djava.security.policy=$WL_HOME/server/lib/weblogic.policy weblogic.Server&四、weblogic配置维护:1、维护配置:Weblogic的console是在浏览器中实现的访问方法 :7001/console,如果需要登录的话 用户名:system 密码:manager常见错误解答1WebLogic Server cannot start: config.xml not found。(1)错误代码描述:C:beauser_projects.config.xml not foundSince no config.xml was found, the fileRperties file will not be used.Would you like the server to create a default configuration and boot? (y/n):(2)问题发生时机:在JBuilder上运行Weblogic Server时,在Weblogic 6.x+ http:7001页上。(3)产生原因:Weblogic域目录没有正确设置。(4)解决方法:选择ToolsConfigure Servers,左边选择Weblogic Server 6.x+,右边选择Custom标签,同时检查域目录是否正确。如:h:beauser_projectsmydomain。2Authentication for user denied。(1)错误代码描述: Exception:java.lang.SecurityException: Authentication for user username deniedjava.lang.SecurityException: Authentication for user username denied.(2)问题发生时机:在JBuilder上运行Weblogic Server时,在Weblogic 6.x+ http:7001页上。(3)产生原因:在JBuilder里用户名、密码填写错误。(4)解决方法:选择ToolsConfigure Servers,左边选择Weblogic Server 6.x+,右边选择Custom标签,检查用户名和密码是否正确。3Deployment of Web application failed;(1)错误代码描述:Exception:weblogic.management. ApplicationException: Prepare failed. Task Id = 0Module: TestWebApp Error: weblogic.j2ee.DeploymentException: Cannot deployServletContext(id=2545674,name=TestWebApp,context-path=/TestWebApp) fromC:beauser_projectsmydomain myserveruploadTestWebAppTestWebApp.war on myserverbecause there is already a webapp namedServletContext(id=5684736,name=TestWeb App,contextpath=/TestWebApp) loaded from C:Documents andSettingsspatijbproject TestWebAppTestWebApp, which is using the context path/TestWebApp.(2)问题发生时机:部署WAR文件的时候。(3)产生原因:可能是已经在Weblogic上部署了一个相同名称的应用了。(4)解决方法:选择ProjectProject Properties,选择Server标签,在Services列表里先选上jsp/servlet,把右边的Map project webapps at runtime的勾去掉,就可以安全的部署了。如果问题还存在的话,就只有重新建一个Web应用程序,然后把程序都拷贝到新的应用上再部署了。4. NameNotFound Exception from test client。(1)错误代码描述如下:javax.naming.NameNot FoundException: Unable to resolve TestSes Resolved:Unresolved:TestSes; remaining name TestSes(2)问题发生时机如下:部署完EJB JAR文件后,运行TestClient的时候。(3)产生原因如下:TestClient不能找到EJB的JNDI名。(4)解决方法如下:打开Weblogic Server Console检查部署是否有错,在DeploymentsEJB里找到EJB的模块名。检查名称后点击右边窗口的Deploy,如果JAR部署正确,右边窗口的Deployment状态是True。5test client run failed。(1)错误代码描述如下:javax.naming.Communication Exception. Root exception .ConnectException:t3:/localhost:7001: Destination unreachable; nested exception is:.ConnectException: Connection refused: connect;No available router to destination(2)问题发生时机如下:部署完EJB JAR文件后,运行TestClient的时候。(3)产生原因如下:TestClient和Weblogic通信出现问题。(4)解决方法如下:如果你的Weblogic是在别的主机上或者端口号改变了,请在TestSesTestClient.java里修改原来的有关主机名或端口的代码在安装、配置WEBLOGIC时,主要有以下几个方面的配置和问题:一、JSP的设置1。perties文件中的设置在PROPERTIES文件中对于JSP进行设置:# Set up WebLogic JSP propertiesweblogic.httpd.register.*.jsp=weblogic.servlet.JSPServletweblogic.httpd.initArgs.*.jsp=pageCheckSeconds=1,compileCommand=c:/jdk1.3/bin/javac.exe,workingDir=C:/weblogic/myserver/classfiles,encoding=gb2312(或GBK),verbose=true2。查看JSP生成的JAVA代码在上边的配置中,到workingDir指定的目录下查找相应目录下的JAVA文件。在测试JSP时,如果出现编译问题,由于报错位置不精确,因此经常需要查看相应的JAVA源文件,以便找到真正的问题所在3。手工编译JSP的方法运行setEnv.sh;java weblogic.jspc your.jsp二、SERVLET的设置1。如何进行SERVLET的登记?#用于进行servlet的登记weblogic.httpd.register.test_servlet=doctor.servlets.test_servletweblogic.httpd.register.test1_servlet=doctor.servlets.test1_servletweblogic.httpd.register.test2_servlet=doctor.servlets.test2_servlet2。如何不登记一个SERVLET,而直接测试该SERVLET首先在perties文件中登记weblogic.httpd.register.servlets=weblogic.servlet.ServletServlet然后在浏览器中键入:http:/host:7001/servlets/your_package/your.class3 。运行登记的SERVLET和使用ServletServlet来运行一个SERVLET有什么区别?使用ServletServlet来运行一个SERVLET,则每次运行的SERVLET都是一个新的线程,而使用登记方式运行SERVLET,则每次都是同一个线程。4。如何在shtml文件中使用servlet三、数据库的设置1。数据库测试工具dbping的使用方式java utils.dbping DBTYPE USER PASS SERVER | DBSERVER:PORTValid DBTYPE values:ORACLE, INFORMIX, INFORMIX4, SYBASE, MSSQLSERVER, MSSQLSERVER4SERVER | DBSERVER:PORT是可选项example:java utils.dbping ORACLE oracle oracle123java utils.dbping ORACLE oracle oracle123 ronghaiOracle例子$ java utils.t3dbping / commandt3:/bigbox:7001 / WebLogic URLscott tiger / user passwordDEMO20 / DBweblogic.jdbc.oci.Driver / driver classjdbc:weblogic:oracle / driver URLOracle with ODBC 例子$ java utils.t3dbping / commandt3:/bigbox:7001 / WebLogic URLscott tiger / user password / DBsun.jdbc.odbc.JdbcOdbcDriver / driver classjdbc:odbc:VISIORA73 / driver URLDB2 with AS/400 type 4 JDBC driver 例子$ java utils.t3dbping / commandt3:/as400box:7001 / WebLogic URLscott tiger / user passwordDEMO / database com.ibm.as400.access.AS400JDBCDriver / driver classjdbc:as400:/as400box / driver URLWebLogic jDriver for Microsoft SQL Server (type 4 JDBC driver) 例子$ java utils.t3dbping / commandt3:/localhost:7001 / WebLogic URLsa / user nameabcd / passworddatabase / databasehostname:port (optional if specified as part of the URL)weblogic.jdbc.mssqlserver4.Driver / driver classjdbc:weblogic:mssqlserver4:pubslocalhost:1433/ driver URL:databasehostname:port (optional if used in the database parameter2。ORACLE连接池的配置使用ORACLE数据库有2种方式,一种使用type2的driver;一种使用type4的driver。weblogic.jdbc.connectionPool.oraclePool=url=jdbc:weblogic:oracle,driver=weblogic.jdbc.oci.Driver,loginDelaySecs=1,initialCapacity=4,maxCapacity=10,capacityIncrement=2,allowShrinking=true,shrinkPeriodMins=15,refreshMinutes=10,testTable=dual,props=user=hysh;password=hysh;server=ora8;weblogic.codeset=8859_1注意如果使用type2的driver,在启动WEBLOGIC前应该设置LD_LIBRARY_PATH环境变量,如果ORACLE中使用的中文,还应该设置lang=zh和NLS_LANG?=?。3。INFORMIX连接池的配置首先得到INFORMIX的DRIVER;安装该DRIVER;安装license;设置perties文件:weblogic.jdbc.connectionPool.InfxPool=url=jdbc:weblogic:informix4,driver=rmix4.Driver,loginDelaySecs=1,initialCapacity=4,maxCapacity=10,capacityIncrement=2,allowShrinking=true,shrinkPeriodMins=15,refreshTestMinutes=10,testTable=dual,props=user=myUserName;password=secret;server=myDatabasemyDBServer:myPortNoweblogic.allow.reserve.weblogic.jdbc.connectionPool.InfxPool=everyone4。MS-SQL-SERVER连接池的配置首先得到MS-SQL的DRIVER;安装该DRIVER;安装license;设置perties文件:weblogic.jdbc.connectionPool.SQLPool=url=jdbc:weblogic:mssqlserver4

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论