一、在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 your selection, the Configuration Wizard guides you through the steps to generate 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 add
applications 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 [Exit][Next]>; 1 ; * 选择要创建的域: Select a Domain Template: -------------------------
Please select a template from the list or select another directory of templates.
* [/export/home/bea/weblogic81/common/templates/domains]
1|WebLogic Server Examples Domain 8.1.3.0 | BEA Systems, Inc. | Create the WebLogic Server Examples domain in a directory outside of |the installed
kit. The Examples domain contains a collection of |examples to show best practices for coding individual J2EE APIs.
->;2|Basic WebLogic Server Domain 8.1.3.0 | BEA Systems, Inc. | Create a basic WebLogic Server domain without installing sample |applications.
3|Basic WebLogic Workshop Domain 8.1.3.0 | 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 J2EE
applications, 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 8.1.3.0
Enter index number to select OR [Down][Exit][Previous][Next]>; 2 ;
Choose Configuration Option: ---------------------------- *Do you want to run the wizard in express mode?
->;1|Yes
2|No Enter index number to select OR [Exit][Previous][Next]>; 1 * 创建weblogic管理用户和密码: ;
Configure Administrative Username and Password: -----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is 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"
Enter option number to select OR [Exit][Previous][Next]>; 2
;
Configure Administrative Username and Password: -----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is the default administrator used to start development mode servers.
"*User password:" = []
Input new *User password: OR [Exit][Reset][Accept]>;
;
Configure Administrative Username and Password: -----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is 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 Changes
Enter option number to select OR [Exit][Previous][Next]>; 3
;
Configure Administrative Username and Password: -----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is the default administrator used to start development mode servers.
"*Confirm user password:" = []
Input new *Confirm user password: OR [Exit][Reset][Accept]>;
;
Configure Administrative Username and Password: -----------------------------------------------
Create a user automatically assigned to the Administrative Role. This user is 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 Changes
Enter option number to select OR [Exit][Previous][Next]>;
; * 选择要创建域Domain的模式:选择Production Mode模式 Domain Mode Configuration: --------------------------
Enable Development or Production Mode for this domain.
->;1|Development Mode
2|Production Mode
Enter index number to select OR [Exit][Previous][Next]>; 2
; * Java环境选择:Java SDK Selection Java SDK Selection: ------------------- ->;1|JRockit SDK 1.4.2_04-8130 @ /export/home/bea/jrockit81sp3_142_04 2|Other Java SDK
Enter index number to select OR [Exit][Previous][Next]>; 2
; * 选择domain的创建目录: 注:目录路径不需要写domain的名称,要不目录会重。 Select the target domain directory for this configuration: ----------------------------------------------------------
"Target Location" = [/export/home/bea/user_projects/domains]
Input new Target Location OR [Exit][Previous][Next]>; /export/home/bea
;
Edit Domain Information: ------------------------
| Name | Value | _|________|__________| 1| *Name: | mydomain |
Enter value for "Name" OR [Exit][Previous][Next]>; * 开始创建domain: ;
Creating Domain...
0% 25% 50% 75% 100% [------------|------------|------------|------------] [***************************************************]
**** Domain Created Successfully! ****
二、weblogic启动密码自动添加 1、存储加密后的用户身份,使用boot.properties文件来避免启动脚本中出现硬编码的用户身份。创建密码启动文件:boot.properties #cd /export/home/bea/mydomain 2、写入登陆用户、密码: # vi boot.properties password=system username=manager 3、系统会自动加密用户名和密码: # vi boot.properties #Thu Jun 16 12:01:02 CST 2005 password={3DES}rS5f2/lJowyEnrkv5Q14tA/=/= username={3DES}RKPFkGopsVaY6aFXkOuAAA/=/=~ 三、nohup方式自启动weblogic 1、在Unix中,使用 'nohup' 运行 WebLogic Server启动脚本,以保证即使您注销以后,服务器依然在后台运行。为了防止weblogic启动以后
,退出登陆窗口weblogic会停止,所以使用nohup方式。 2、在startWebLogic.sh文件中添加nohup和&后台符号。路径为:weblogic$home/bea/user_projects/domains/***/bin # more startWebLogic.sh nohup ${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是在浏览器中实现的访问方法 http://127.0.0.1:7001/console,如果需要登录的话 用户名:system 密码:manager
常见错误解答
1.WebLogic Server cannot start: config.xml not found。
(1)错误代码描述:
<140013> C:/bea/user_projects/./config.xml not found Since no config.xml was found, the fileRealm.properties 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)解决方法:
选择Tools——>Configure Servers,左边选择Weblogic Server 6.x ,右边选择Custom标签,同时检查域目录是否正确。如:
h:/bea/user_projects/mydomain。
2.Authentication for user denied。
(1)错误代码描述:
<000364> Exception:java.lang.SecurityException: Authentication for user username denied java.lang.SecurityException: Authentication for user username denied.
(2)问题发生时机:
在JBuilder上运行Weblogic Server时,在Weblogic 6.x http:7001页上。
(3)产生原因:
在JBuilder里用户名、密码填写错误。
(4)解决方法:
选择Tools→Configure Servers,左边选择Weblogic Server 6.x ,右边选择Custom标签,检查用户名和密码是否正确。
3.Deployment of Web application failed;
(1)错误代码描述:
Exception:weblogic.management. ApplicationException: Prepare failed. Task Id = 0 Module: TestWebApp Error: weblogic.j2ee.DeploymentException: Cannot deploy ServletContext(id=2545674,name=TestWebApp,context-path=/TestWebApp) from C:/bea/user_projects/mydomain/ myserver/upload/TestWebApp/ TestWebApp.war on myserver because there is already a webapp named ServletContext(id=5684736,name=TestWeb App,contextpath=/ TestWebApp) loaded from C:/Documents and Settings/spati/jbproject/ TestWebApp/TestWebApp, which is using the context path /TestWebApp.
(2)问题发生时机:
部署WAR文件的时候。
(3)产生原因:
可能是已经在Weblogic上部署了一个相同名称的应用了。
(4)解决方法:
选择Project——>Project 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检查部署是否有错,在Deployments——>EJB里找到EJB的模块名。检查名称后点击右边窗口的Deploy,如果JAR
部署正确,右边窗口的Deployment状态是True。
5.test client run failed。
(1)错误代码描述如下:
javax.naming.Communication Exception. Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is: java.net.ConnectException: Connection refused: connect; No available router to destination
(2)问题发生时机如下:
部署完EJB JAR文件后,运行TestClient的时候。
(3)产生原因如下:
TestClient和Weblogic通信出现问题。
(4)解决方法如下:
如果你的Weblogic是在别的主机上或者端口号改变了,请在TestSesTestClient.java里修改原来的有关主机名或端口的代码