Some experience of WebLogic6.0

xiaoxiao2021-03-14  199

I feel very well, so reprint is shared with everyone!

Forehead

WebLogic is a superior J2EE server in my country, which grows rapidly in our users. But now there is basically no Chinese information about it, and there is no introduction to the use of experience. Below is some of the experiences you have learned in WebLogic 6.0, write it out with you.

First, WebLogic6.0 installation

WebLogic6.0 has brought JDK1.3, so you can install it directly without pre-installation, and you can run it directly in the Win2000 platform; the installation package on the UNIX platform is a * .bin file, use The SH is running it, it is best to add -i console's console option (if it is not added, it may report the Classnofound and other errors) as follows:

SH Weblogic60_sol.bin -i console console

note:

1. The TMP directory of the UNIX system (environment variable TmpDir or TMP_DIR refers to the path) should have enough space because WebLogic 6.0 is installed first in the TMP directory of the system, and then install it. If the TMP directory space is not installed, it will be wrong. At this time, you can set TMPDIR to the directory you want to have enough space.

2. If you install an error with a normal user, you can try it with the root user. Generally a problem of environmental variables and permissions.

3, install the software to http://commerce.bea.com/downloads/products.jsp download, online documentation can be downloaded at http://edocs.bea.com/wls/docs61/index.html.

Second, with oracle

Database connection

WebLogic6.0 Accesss Oracle via an Oracle client, so you have to install the Oracle client correctly on the machine where WebLogic6.0 is located. WebLogic6.0 provides the JDBC Driver support for Oracle, which is some dynamic connection libraries (NT is .dll, unix is ​​.so) file, under $ wl_home / bin, in several directories starting with OCI. Specifically, which directory is related to the version of the Oracle Server End and the version of the Client and the version of the Oracle API, you can refer to WebLogic 6.0 online documentation. To add the path where these libraries is located to the environment variable of the system, otherwise access

When the database, WebLogic 6.0 will report the following error:

Java.sql.sqlexception: system.loadlibrary threw java.lang.unsatisfiedlinkerror

With the message '' NO WebLogicoci37 in java.library.path '' .....

Add to PATH environment variables in Win2000, such as:

Set path = d: /weblogic6.0/wlserver6.0/bin/oci816_7; c: / orate816 / bin;% PATH%

In the NIX platform, you want to go to the system's library path, as in Sun, you are adding to the ld_library_path environment variable, the method is as follows:

Export ld_library_path = / bea / webLogic6.0 / ORI816_8: $ Oracle_Home / LIB

On the HP platform, add to the SHLIB_PATH environment variable, such as:

Export shlib_path = / bea / webLogic6.0 / lib / hpux11 / oci816_8: $ oracle_home / lib

Third, set access to resources in WebLogic 6.0

WebLogic6.0 can set access to all resources it managed, including EJB, JSP, Servlet, Pool, JMS, RMI, JNDI, JDBC, and more. When the user has an access control table for the first time, WebLogic 6.0 will pop up a dialog require input password and password. If the connection is 3 times, it will return the following error: Error 401 - Unauthorized XXX

From RFC 2068 Hypertext Transfer Protocol - HTTP / 1.1:

10.4.2 401 Unauthorized

There are two ways to set access to access:

1. Set in the console of WebLogic6.o, save the results into the FileRealm.properties, which uses WebLogic 6.0's File Realm. Feeling to Database Pool, EJB, etc., set access to JSP, Server, and some directory The control table is more difficult. I have tried it many times. It works on web users (accessible via browser) and ordinary users (accessible through Java clients).

2, set in Web.xml, WebLogic.xml, can only work on web users. The following example shows this approach.

For example: In a Web Application called ORDERWebApp, the customer's order file is placed in the / orders directory, and only Manager can browse the files in this directory. Its web.xml and WebLogic.xml are set as follows:

*********************** Web.xm1 ********************* ***

SecureRDerseast

Security Constraint for Resources In The Orders Directory

/ orders / *

pos

get

ConsTRAINT for Orders

manager

SSL NOT Required

None

Managers

manager

Specify the access control table defined in . Define resources and their access methods in ; Define the role of this resource in ; define the beginning of WebLogic Server and Client in Whether to establish a connection with SSL when communicating. Define the role name in .

*********************** Weblogic.xml ****************************** ***

>

manager

Peter

Bill

Description: Users corresponding to the roles defined in Web.xml in . These users must have defined in the console of WebLogic 6.0.

When entering http: // localhost: 7001 / orderwebapp / orders / order100.html in the browser, WebLogic6.0 requires the username and password. Only Peter, Bill can access the file.

I found: If you don't set in WebLogic.xml, and the username defined in WebLogic6.o's console is the same as the name of the character in in Web.xml. The user can access protected resources. If is set in WebLogic.xml, the user who is the same as the character name in can also access protected resources, only in

Fourth, JSP settings and debugging

In WebLogic6.0, JSP is to be placed in a web application to access it, and the configuration of JSP is in WebLogic.xml, as shown below:

PageCheckseconds

1

Verbose

True

More importantly have pagecheckseconds, setting up WebLogic 6.0 for a long time to detect whether the content of the JSP file changes, and needs to be recompiled, equal to 0, each call is recompiled (generally used in debugging), equal to -1 Never recompile (generally used in the operating environment). When you first access a JSP file under a Web Application, WebLogic6.0 compiles it into a Class file and put it in the corresponding directory:

1. If it is the web application released in the form of a directory structure, put it in the web application

WEB-INF / _TMP_WAR_EXAMPLESSERVER_EXAMPLESSERVER_ * directory.

2, if the Web Applicat is arranged in a WAR file, put it:

... / Applications / .wl_temp_do_not_delete / web-inf / _tmp_war_examplesserver_examplesserver_ * directory.

When debugging JSP, in order to always access the latest page, except setting up PageCheckseconds = 0, you should make the IE not cache the page. Set as follows:

Set the updated version of the / setup / Tool / Internet Option / Regular / Setting / Setting / Setting / Setting / Settings, set to each access to the page. If you still can't see the latest pages, you can delete the Class file corresponding to the JSP in the directory described above to force WebLogic6.0 recompile.

5. Management of Password

WebLogic6.0 will prompt each time you start, please enter your password. If you don't want to enter your password each time you start, you can create a paddword.ini file and save your password in this file. You can also use-dpassword = password to add your password to the startup script. The password can be modified in Security in the console of WebLogic6.o.

6. Use of WebLogic6.o console

WebLogic6.o's console can be launched in the version above IE5.0, if IE sets the proxy server, WebLogic6.o's console may not be activated, and the settings of the proxy server should be removed in / tool / Internet option / Connection / LAN settings. In the WebLogic 6.0 console can complete almost all configurations, it is not like WebLogic 5.1 sometimes modifying the configuration file directly.

Seven, config.xml file

Each time WebLogic 6.0 starts successfully, back up the config.xml file to config.xml.booted (in the same directory). If the content in config.xml is changed, it is unable to start successfully, and it can be used to overwrite the destroyed config.xml. If the resource registered in config.xml (such as an EJB, WAR file) is deleted, WebLogic 6.0 will give an error message each time, can handle the EJB or WAR in config.xml in config.xml, Will not prompt later. Pay attention to this file backup.

8. Access to the default web application

WebLogig has a default web application, if a HTTP (HTTPS) request, the specified Web Application can automatically process the default application, if the Default Application can't handle, then report error. To visit http: //localhost:7001/Myweb/my.jsp. When there is no my.jsp in myWeb, if you have my.jsp, you return the results to your browser. The default web application is the defaultwebApp_examplesserver under Applications, which can only be arranged in the form of a directory structure, which cannot be a WAR file. If you delete the directory, the weblogic6.0 will automatically generate this directory. When accessing it, don't have to add the name of the web application, add nothing. If there is a Test.jsp: http: // localhost: 7001 / test.jsp can access the JSP, but http: // localhost: 7001 / defaultWebApp_examplesserver / test.jsp is not accessed.

Note: Access files in other web applications. To add the name of the web application.

9. Configuring problems that CLUSTER should pay attention to

1. Set the gateway

When configuring CLUSTER, each server is configured to configure the default gateway. If you are not configured, Manager Server will not be able to connect to Administrator Server. In WIN2000, you can add directly in the control panel. Under UNIX, use the Router Add IP Address setting, IP address available, the server's IP address, and change the last section to 1, as 192.168.1.111 can be used for 192.168.1.1 Default gateway. Under UNIX, you can use NetStat -rn to view the system's default gateway.

2, WebLogic6.0 runs in a Cluster mode, and the license containing the Cluster license is only used.

3, MulticastAddress is not legal

Effective multicastadDress is from 224.0.0.0 to 239.255.255.255.

The multicastAddress used by Utils.MultiCastTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest. Such as:

Java Utils.MulticastTest -n Test -a 237.0.0.1

-N Specifies a name to identify the process and can be casually.

-A IP address

4. The version of WebLogic6.0 Server in a Cluster should be consistent, and the number of listeners is also the same.

5. It is best not to set any applications in Administrator Sever to enlarge the application on the Managed Server.

Ten, in WebLogic6.0 in the arrangement application 1, WebLogic 6.0 can be divided into three, respectively correspond to different description files and extensions or directory structures:

(1) *. Jar: is an EJB compression package (there are 3 description files ejb-jar.xml, weblogic6.0-ejb-jar.xml, weblogic6.0-cmp-rdbms-jar.xml)

(2) *. WAR: is a Web Application compression package containing JSP and Servlet (there are 2 description files Web.xml, WebLoigc.xml)

(3) *. EAR: is a J2EE Enterprise Application compression package containing EJB and Web Application (there is a description file, Application.xml)

Note: They can't be mixed, such as Web Applicatoin cannot be packaged into .ser files.

2, WebLogic 6.0 application use two release methods:

(1) Store in the form of a directory in the Applications directory of WebLogic6.0, suitable for development phases

(2) Store in a compressed package in the Applications directory of WebLogic6.0, suitable for running phases, can be packaged in JAR, such as D: / Test> JAR CF TestWar.war *

Pack all the files in the Test directory into a TestWar.war file.

3. There are two ways to arrange the WebLogic6.0 application.

(1) Static layout: You can register your application in config.xml, you can add it through the WebLogic6.o console, WebLogic 6.0 automatically copies the compressed package corresponding to the application to the Applicaitiss Directory, and modify the application Need to reset it.

(2) Dynamic layout: Not registered in config.xml, directly to copy the compressed package or directory to the Applications directory, WebLogic 6.0 will automatically detect .WebLogic6.0 automatically automatically automatically in the Applications directory each time. The application of static arrangement is dynamically arranged.

4, an example:

If there is an EJB, JSP, servlet in an app, its arrangement steps are as follows:

(1) Generate an EJB's JAR file, preferably a JAR file corresponding to an EJB

(2) Generate the WAR file of Web Application, register, configure servlet, jsp, etc. in Web.xml, WebLogic.xml.

(3) Create an Application.xml file to set the properties of the app. Package Application.xml, *. Jar, * .war, package it into a *. Pear

(4) Register this app in the console of WebLogic6.O, copy the EAR file to the Applicaiton directory. It is completed everywhere.

Eleven, ClassPath issue in WebLogic6.0 6.0

The ClassPath in WebLogic6.0 6.0 is more simple to 5.1, and it is a summary of it:

1. WebLogic6.0 6.0 The ClassPath you need to start will be as follows.

SET% WL_HOME% / lib / weblogic6.0_sp.jar;% wl_home% / lib / weblogic6.0.jar

If you want to use the Cloudscape with it

Database, plus:

% WL_HOME% / Samples / Eval / Cloudscape / lib / cloudscape.jar2, the class referenced in EJB can access it in the system's classpath.

3, if it is a servlet in a web applicat, JSP references other Class, put them in the Web ApplicatOin / web-inf / class of WebLogic 6.0 can be accessed. Of course, if these classes of these classes are set in the system's classpath, WebLogic 6.0 can also be accessed. When calling, WebLogic6.0 will copy all the wects of the web-inf / classes / under the wed .. /Applications/.wl_temp_do_not_delete/.../web-inf, whether it is packaged EAR, WAR file is still Packaged catalog.

4, if the JSP in a web application is called to EJB, that is, JSP is the ejb client, as long as IMPOR is imported in this JSP, if a JSP is called to EJB: com.test.bbs.jar, its import format as follows:

<% @ Page Import = "

Javax.naming. *,

Javax.ejb. *,

Java.rmi.RemoteException,

Java.rmi.Remote,

Java.util. *,

Java.sql. *,

COM.TEST.BBS. *

"%>

Of course, this com.test.bbs.jar must be placed correctly.

When the Web Application is arranged in a WAR file, com.test.bbs.jar is not used in the system's classpath or the web-inf / class of the web application, the JSP can be called. But if a web application is placed in Applications in a directory, the class in the EJB is to access in the system's classpath. Place the Web Application's Web-INF / CLASSES / under the JSP is the access access is not this EJB. You can add com.test.bbs.jar to the system's classpath, such as the ClassPath when WebLogic6.0 is started, can be set as follows:

Set classpath =.; ./ lib / weblogic6.0_sp.jar; ./ lib / weblogic6.0.jar; d: /weblogic6.0.jar; d: /weblogic6.0/wlserver6.0/config/examples/applications/xcjing_ejb_bbsok.jar

You can also copy bbshome.class.bbsbean.class, bbs.class to a certain path specified by the system's classpath, such as the ClassPath that WebLogic6.0 is started as follows:

ClassPath =.; ./ LiB / WebLogic6.0_sp.jar ;./ lib / weblogic6.0.jar; d: /weblogic6.0/wlserver6.0/config/examples/serverclasses

You can copy the 3 files to D: /weblogic6.0/wlserver6.0/config/examples/serverClasses, which can also be accessed.

转载请注明原文地址:https://www.9cbs.com/read-129232.html

New Post(0)