WebLogic类加载过程简述

WebLogic类加载过程简述
WebLogic类加载过程简述

WebLogic类加载过程

王明杰

20061012 19:28-21:59

英文水平有限,翻译的肯定有不对的地方,欢迎指正。

希望能够各位同事在使用weblogic的过程中带来帮助。

小注:

2006-10-12 下午,在weblogic中部署一个启动类,部署了近2个小时,weblogic总是提示“找不到类的异常”。心情很是郁闷。

“大事问老婆,小事问goole”,一个字“搜”。

终于找到了WebLogic的官方文档,摘录下来,进行了翻译,终于对WebLogic的类的加载过程有了比较系统的了解。

希望该文档能够帮助和我有同样疑惑的人走出困境,共同进步!!!

V ersion 0.1

msn:wangmingjie_2002@https://www.360docs.net/doc/6113156477.html,

官方原版

(19:30开始)20061012开始

WebLogic Server Application Classloading

The following sections provide an overview of Java classloaders, followed by details about WebLogic Server J2EE application classloading.

下面的部分概况的介绍了java的类装载器,接着详细的介绍了WebLogicJ2EE

应用服务器(WebLogic Server J2EE application )的类装载过程。

?Java Classloader Overview java类转载器综述

?WebLogic Server Application Classloader Overview WebLogic 应用服务器类装载器介绍。

?Resolving Class References Between Modules and Applications

Java Classloader Overview

Classloaders are a fundamental module of the Java language. A classloader is a part of the Java virtual machine (JVM) that loads classes into memory;

a classloader is responsible for finding and loading class files at run time. Every successful Java programmer needs to understand classloaders and their behavior. This section provides an overview of Java classloaders.

类装载器是java语言的一个基本模块,类装载器是java虚拟机的一部分,把相应的类装载到内存中,类装载器负责在运行期间找到类并载入类

。每个成功的java程序员都需要理解java类装载器及其行为。本部分综述了java类装载器。

Java Classloader Hierarchy java类装载器的层次

Classloaders contain a hierarchy with parent classloaders and child classloaders. The relationship between parent and child classloaders is analogous to the object relationship of super classes and subclasses. The bootstrap classloader is the root of the Java classloader hierarchy. The Java virtual machine (JVM) creates the bootstrap classloader, which loads the Java development kit (JDK) internal classes and java.* packages included in the JVM. (For example, the bootstrap classloader loads https://www.360docs.net/doc/6113156477.html,ng.String.)

类装载器有层次,包含了父装载器和子装载器。父装载器和子装载器直接的关系和java中的父类和子类的关系是相似的。启动类装载器是根类装载器,它将jdk 的内部类和包含在java.*包中的类装载到java虚拟机。(例如:启动类装载器载入https://www.360docs.net/doc/6113156477.html,ng.String类。)

The extensions classloader is a child of the bootstrap classloader. The extensions classloader loads any JAR files placed in the extensions directory of the JDK. This is a convenient means to extending the JDK without adding entries to the classpath. However, anything in the extensions directory must be self-contained and can only refer to classes in the extensions directory or JDK classes.

(C:\j2sdk1.4.2_08\jre\lib\ext)

扩这的类装载器是启动类装载器的子类装载器。扩展类装载器会自动加载放在jdk扩展文件夹中的jar包。这很方便,意味着扩展JDK不需要

向classpath中增加信息。然而扩展文件夹中的任何包都必须独立,只能参照扩展文件夹中的类或者JDK的类。(最后这句翻译的不好。)

The system classpath classloader extends the JDK extensions classloader. The system classpath classloader loads the classes from the classpath of the JVM. Application-specific classloaders (including WebLogic Server classloaders) are children of the system classpath classloader.

系统classpath类装载器继承了JDK扩展类装载器。系统类装载器从JVM指定的应用类装载器(系统装载器的子类装载器)的classpth来加载类。

Note: What BEA refers to as a "system classpath classloader" is often referred to as the "application classloader" in contexts outside of WebLogic Server. When discussing classloaders in WebLogic Server, BEA uses the term "system" to differentiate from classloaders related to J2EE applications (which BEA refers to as "application classloaders").

注意:在WebLogic应用服务器之外,BEA中说的“系统classpth类装载器”也称为“应用类装载器”。

在weblogic中讨论类装载器的时候,BEA使用的术语“系统”和J2EE应用服务器的类装载器(BEA称之为“应用类装载器”)是有区别的。

Loading a Class

Classloaders use a delegation model when loading a class. The classloader implementation first checks its cache to see if the requested class has already been loaded. This class verification improves performance in that its cached memory copy is used instead of repeated loading of a class from disk. If the class is not found in its cache, the current classloader asks its parent for the class. Only if the parent cannot load the class does the classloader attempt to load the class. If a class exists in both the parent and child classloaders, the parent version is loaded. This delegation model is followed to avoid multiple copies of the same form being loaded. Multiple copies of the same class can lead to a ClassCastException.

类装载器使用代理模式来装载一个类。子类装载器时候从它的缓存中检查被请求的类是否已经装载。类被缓存在内存中而不是重复的从

硬盘上读取,这样可以提高类的校验效率。如果被请求的类不在它的缓存中,那么当前的类装载器就请求它的父类来装载这个类。当父

类装载器无法找到请求的类,那么子类装载器才试图去装载这个类。如果一个类既在父类装载器中又在子类装载器中,那么父类装载器

中的类会被加载。代理模式可以防止同样的类被多次装载。多次装载相同的类会产生ClassCastException异常。

Classloaders ask their parent classloader to load a class before attempting to load the class themselves. Classloaders in WebLogic Server that are associated with Web applications can be configured to check locally first before asking their parent for the class. This allows Web applications to use their own versions of third-party classes, which might also be used as part of the WebLogic Server product. The

prefer-web-inf-classes Element section discusses this in more detail.

类装载器在自己装载请求类之前,先请求他们的父类装载器来装载此类。(父类找不到,才自己装载请求类)weblogic服务器中和web应用关联的类装载器可以配置先从自己的类装载器中找到请求的类,如果找不到在请求父类。这就允许

web应用使用他们自己的第三方类库,这些类库也被weblogic应用服务器产品使用。在章节prefer-web-inf-classes Element中会详细讨论。

prefer-web-inf-classes Element

The weblogic.xml Web application deployment descriptor contains a prefer-web-inf-classes element (a sub-element of the

container-descriptor element). By default, this element is set to False. Setting this element to True subverts the classloader delegation model so that class definitions from the Web application are loaded in preference to class definitions in higher-level classloaders. This allows a Web application to use its own version of a third-party class, which might also be part of WebLogic Server. See weblogic.xml Deployment Descriptor Elements.

在web应用部署描述文件weblogic.xml 中,包含了元素

prefer-web-inf-classes (container-descriptor 元素的子元素)。默认值被设置为false。设置这个元素的值未true,从来改变类装载器的代理模式,提升子类装载器的级别,定义为首先从web应用中加载类。(然后从父类装载器中加载类)。这允许web应用来使用他们自己的第三方类库,这些类库也可能是weblogic应用服务器的。See weblogic.xml Deployment Descriptor Elements.

When using this feature, you must be careful not to mix instances created from the Web application's class definition with issuances created from the server's definition. If such instances are mixed, a ClassCastException results.

当使用这一特性的时候,你必须小心,不要web应用的类的实例和服务器定义的实例混淆。否则就会产生ClassCastException 异常。

Listing 4-1 illustrates the prefer-web-inf-classes element, its description and default value.

列表4-1,举例说明了prefer-web-inf-classes元素,有详细描述和默认值。Listing 4-1 prefer-web-inf-classes Element

/**

* If true, classes located in the WEB-INF directory of a web-app will be loaded in preference to classes loaded in the application or system classloader.

* @default false

*/

boolean isPreferWebInfClasses();

void setPreferWebInfClasses(boolean b);

Changing Classes in a Running Program

WebLogic Server allows you to deploy newer versions of application modules such as EJBs while the server is running. This process is known as hot-deploy or hot-redeploy and is closely related to classloading.

WebLogic Server 在运行的时候允许你重新部署新的类,例如ejbs。这就是热部署或者热重新部署,是和类加载过程紧密相关的。

Java classloaders do not have any standard mechanism to undeploy or unload a set of classes, nor can they load new versions of classes. In order to make updates to classes in a running virtual machine, the classloader that loaded the changed classes must be replaced with a new classloader. When a classloader is replaced, all classes that were loaded from that classloader (or any classloaders that are offspring of that classloader) must be reloaded. Any instances of these classes must be re-instantiated.

java的类装载器没有任何标准机制来重新部署或者装载类,或者装载新版本的类。因此为了能够在jvm运行的时候更新类,重新装载被改变的类就必须使用一个新的类装载器将原来的类装载器替换掉。当类装载器被替换,所有的已经被替换的类装载器装载的类(包括它的子类装载器装载的类)都必须重新装载。所有这些类的实例必须被重新实例化。

In WebLogic Server, each application has a hierarchy of classloaders that are offspring of the system classloader. These hierarchies allow applications or parts of applications to be individually reloaded without affecting the rest of the system. WebLogic Server Application Classloader Overview discusses this topic.

在WebLogic Server,每个应用都有系统类装载器的一系列子类装载器。这种机制允许应用程序或应用程序中的独自重新装载类而不影响系统的其他部分。章节WebLogic Server Application Classloader Overview讨论这个主题。

WebLogic Server Application Classloader Overview

This section provides an overview of the WebLogic Server application classloaders.

本章节给出了WebLogic Server 应用类装载器的总的描述。

Application Classloading

WebLogic Server classloading is centered on the concept of an application. An application is normally packaged in an Enterprise Archive (EAR) file containing application classes. Everything within an EAR file is considered part of the same application. The following may be part of an EAR or can be loaded as standalone applications:

?An Enterprise JavaBean (EJB) JAR file

?A Web application WAR file

?A resource adapter RAR file

WebLogic Server类装载过程是应用概念中的中心。一个应用通常是一个EAR文件,它包含应用classes。EAR文件中所有的文件都被认为是应用的一部分。下面的是是EAR的一部分,或者能够被应用程序独自加载。

?EJB jar文件

?WAR文件

?包含资源适配器的RAR文件(这些都可以被应用单独加载,也可以是EAR的一部分)

Note: For information on Resource Adapters and classloading, see About Resource Adapter Classes.

注意:关于资源适配器的信息和加载过程,请看About Resource Adapter Classes.

If you deploy an EJB and a Web application separately, they are considered two applications. If they are deployed together within an EAR file, they are one application. You deploy modules together in an EAR file for them to be considered part of the same application.

如果你单独的部署了EJB和WEB应用,那么他们被认为是两个应用,如果他们通过一个EAR文件同时部署,那么他们被认为是一个应用。你部署了一个EAR文件,那么其中所有的模块都被认为是一个应用。

Every application receives its own classloader hierarchy; the parent of this hierarchy is the system classpath classloader. This isolates applications so that application A cannot see the classloaders or classes of application B. In hierarchy classloaders, no sibling or friend concepts exist. Application code only has visibility to classes loaded by the classloader associated with the application (or module) and classes that are loaded by classloaders that are ancestors of the application (or module) classloader. This allows WebLogic Server to host multiple isolated applications within the same JVM.

每个应用接受他们自己的有继承关系的多个类装载器;这些类装载器的父类装载器就是系统classpath装载器。(呵呵,所以在classpath中设置的类可以被所有的应用使用。明白了这些就可以重构我们的部署,使jar包变的清晰明了。)因此独立的应用a是不能看到B的类装载器和classes的。从类的装载器继承关系上看,没有兄弟或者友元的概念存在。应用程序代码仅能访问被和本应用或者模块相关的类装载器装载的类,还有被这些类装载器的父类装载器装载的类。这就允许weblogic服务器在同一个JVM下处理多个独立的应用。

Application Classloader Hierarchy 应用类装载器层次关系

WebLogic Server automatically creates a hierarchy of classloaders when an application is deployed. The root classloader in this hierarchy loads any EJB JAR files in the application. A child classloader is created for each Web application WAR file.

weblogic Server自动建立类装载器层次当一个应用被部署的时候。层次中的根类装载器装载应用中所有EJB jar包中的文件,每个web应用(WAR)都会创建一个子类装载器。

Because it is common for Web applications to call EJBs, the WebLogic Server application classloader architecture allows JavaServer Page (JSP) files and servlets to see the EJB interfaces in their parent classloader. This architecture also allows Web applications to be redeployed without redeploying the EJB tier. In practice, it is more common to change JSP files and servlets than to change the EJB tier.

因为web应用调用ejb很平常,weblogic应用服务器的类装载器架构允许jsp

和servlet可以在他们的父类装载器中访问ejb接口。这个架构同样允许web

应用重新部署的时候不需要重新部署ejb。实际上,改写jsp和servlet比改写ejb更普遍。

The following graphic illustrates this WebLogic Server application classloading concept.

Figure 4-1 WebLogic Server Classloading

If your application includes servlets and JSPs that use EJBs:

?Package the servlets and JSPs in a W AR file

?Package the Enterprise JavaBeans in an EJB JAR file

?Package the W AR and JAR files in an EAR file

?Deploy the EAR file

(EAR中包含EJB JAR和WAR,WAR中包含jsp和servlet。)

Although you could deploy the WAR and JAR files separately, deploying them together in an EAR file produces a classloader arrangement that allows the servlets and JSPs to find the EJB classes. If you deploy the WAR and JAR files separately, WebLogic Server creates sibling classloaders for them. This means that you must include the EJB home and remote interfaces in the WAR file, and WebLogic Server must use the RMI stub and skeleton classes for EJB calls, just as it does when EJB clients and implementation classes are in different JVMs. This concept is discussed in more detail

in the next section Application Classloading and Pass-by-Value or Reference.

虽然你可以单独的部署WAR和JAR文件,但是将他们一块部署到一个EAR好处多多,可以允许servlet和jsp访问ejb的类。如果你将WAR和JAR单独部署了,那么weblogic服务器会创建兄弟类装载器。(创建两个并行的类装载器,没有继承关系)这就意味着你必须在你的WAR包中包含EJB的home和remote interface 。weblogic服务器使用RMI技术来访问EJB,就和EJB客户端和实现类在不同的JVM中一样。(换句话说,效率和访问机制都不同了。)这些概念会在下个章节Application Classloading and Pass-by-Value or Reference.中纤细讨论。

Note: The Web application classloader contains all classes for the Web application except for the JSP class. The JSP class obtains its own classloader, which is a child of the Web application classloader. This allows JSPs to be individually reloaded.

注意:Web应用类装载器包含除了jspclass之外的所有class,也就是说jsp

有自己的类装载器,它的父类装载器是WAR类装载器。这就允许jsp被单独装载。Custom Module Classloader Hierarchies 自定义模块类装载器层次关系

You can create custom classloader hierarchies for an application allowing for better control over class visibility and reloadability. You achieve this by defining a classloader-structure element in the

weblogic-application.xml deployment descriptor file.

你为一个应用可以创建自定义的类装载器层次管理,以便更好的丛刊类的可见性和重新装载的能力。你通过在weblogic-application.xml 定义元素classloader-structure来构建。

The following diagram illustrates how classloaders are organized by default for WebLogic applications. An application level classloader exists where all EJB classes are loaded. For each Web module, there is a separate child classloader for the classes of that module.

下图详细说明了类装载器是如何被weblogic应用默认组织的。所有ejb类被装载时应用层的类装载器已经存在。每个WEB模块,都有一个子类装载器。

For simplicity, JSP classloaders are not described in the following diagram.

为了简化,jsp类装载器不在下图中。

Figure 4-2 Standard Classloader Hierarchy

This hierarchy is optimal for most applications, because it allows call-by-reference semantics when you invoke EJBs. It also allows Web modules to be independently reloaded without affecting other modules. Further, it allows code running in one of the Web modules to load classes from any of the EJB modules. This is convenient, as it can prevent a Web module from including the interfaces for EJBs that is uses. Note that some of those benefits are not strictly J2EE-compliant.

对于大多数应用来说这个层次是比较理想的,因为它允许参照调用ejb(不需要rmi)。它也允许web模块独立的重新装载而不影响其他模块,进一步说,它允许在一个web模块中运行的代码调用任何ejb模块。这个很方便,不需要web

模块包含ejb的interface类。注意这些好处并不全部严格遵循J2EE规范。

The ability to create custom module classloaders provides a mechanism to declare alternate classloader organizations that allow the following:

?Reloading individual EJB modules independently

?Reloading groups of modules to be reloaded together

?Reversing the parent child relationship between specific Web modules and EJB modules ?Namespace separation between EJB modules

(21:52结束,水平有限接近两个半小时才翻译了一半,希望能够各位

同事在使用WebLogic的时候带来帮助。:) )

Declaring the Classloader Hierarchy 声明类装载器层次关系(用户

可以自己定制,个人观点了解即可)

You can declare the classloader hierarchy in the WebLogic-specific application deployment descriptor weblogic-application.xml. For instructions on how to edit deployment descriptors, refer to the WebLogic Builder Online Help.

The DTD for this declaration is as follows:

Listing 4-2 Declaring the Classloader Hierarchy

The top-level element in weblogic-application.xml includes an optional classloader-structure element. If you do not specify this element, then the standard classloader is used. Also, if you do not include a particular module in the definition, it is assigned a classloader, as in the standard hierarchy. That is, EJB modules are associated with the application Root classloader, and Web application modules have their own classloaders.

The classloader-structure element allows for the nesting of classloader-structure stanzas, so that you can describe an arbitrary hierarchy of classloaders. There is currently a limitation of three levels. The outermost entry indicates the application classloader. For any modules not listed, the standard hierarchy is assumed.

Note: JSP classloaders are not included in this definition scheme. JSPs are always loaded into a classloader that is a child of the classloader associated with the Web module to which it belongs.

For more information on the DTD elements, refer to Enterprise Application Deployment Descriptor Elements.

The following is an example of a classloader declaration (defined in the classloader-structure element in weblogic-application.xml):

Listing 4-3 Example Classloader Declaration

ejb1.jar

web3.war

web1.war

ejb3.jar

web2.war

web4.war

ejb2.jar

The organization of the nesting indicates the classloader hierarchy. The above stanza leads to a hierarchy shown in the following diagram.

Figure 4-3 Example Classloader Hierarchy

User-Defined Classloader Restrictions 用户定义类装载器的限制

User-defined classloader restrictions give you better control over what is reloadable and provide inter-module class visibility. This feature is primarily for developers. It is useful for iterative development, but the reloading aspect of this feature is not recommended for production use, because it is possible to corrupt a running application if an update includes invalid elements. Custom classloader arrangements for namespace separation and class visibility are acceptable for production use. However, programmers should be aware that the J2EE specifications say that applications should not depend on any given classloader organization.

Some classloader hierarchies can cause modules within an application to behave more like modules in two separate applications. For example, if you place an EJB in its own classloader so that it can be reloaded individually, you receive call-by-value semantics rather than the

call-by-reference optimization BEA provides in our standard classloader hierarchy. Also note that if you use a custom hierarchy, you might end up with stale references. Therefore, if you reload an EJB module, you should also reload calling modules.

There are some restrictions to creating user-defined module classloader hierarchies; these are discussed in the following sections.

Servlet Reloading Disabled

If you use a custom classloader hierarchy, servlet reloading is disabled for Web applications in that particular application.

如果自定义,那么servlet 重新装载失效。

Web Applications prefer-web-inf-classes Flag Ignored

If you use a custom classloader hierarchy, the

prefer-web-inf-classes flag will be ignored for web applications within that hierarchy.

Custom Classloader Structure with Iterative Development

When a new classloader-structure element is added as a leaf node anywhere in the existing class-loader hierarchy, then the module added to the new classloader-structure can be deployed without redeploying the entire application. However, when deleting or rearranging the existing classloader-structure element within the hierarchy, the entire application should be redeployed.

When you add new module-uri(s) to an existing classloader-stucture, ensure that it is added only after the existing module-uri(s). New module(s) can be deployed without redeploying the entire application. However, when moving or deleting module-uri(s) across

classloader-stucture elements, ensure that you redeploy the entire application.

Nesting Depth

Nesting is limited to three levels (including the application classloader). Deeper nestings lead to a deployment exception.

Module Types

Custom classloader hierarchies are currently restricted to Web and EJB modules.

Duplicate Entries

Duplicate entries lead to a deployment exception.

Interfaces(注意)

The standard WebLogic Server classloader hierarchy makes EJB interfaces available to all modules in the application. Thus other modules can invoke

an EJB, even though they do not include the interface classes in their own module. This is possible because EJBs are always loaded into the root classloader and all other modules either share that classloader or have a classloader that is a child of that classloader.

With the custom classloader feature, you can configure a classloader hierarchy so that a callee's classes are not visible to the caller. In this case, the calling module must include the interface classes. This is the same requirement that exists when invoking on modules in a separate application.

Call-by-Value Semantics

The standard classloader hierarchy provided with WebLogic Server allows for calls between modules within an application to use call-by-reference semantics. This is because the caller is always using the same classloader or a child classloader of the callee. With this feature, it is possible to configure the classloader hierarchy so that two modules are in separate branches of the classloader tree. In this case, call-by-value semantics are used.

In-Flight Work

Be aware that the classloader switch required for reloading is not atomic across modules. In fact, updates to applications in general are not atomic. For this reason, it is possible that different in-flight operations (operations that are occuring while a change is being made) might end up accessing different versions of classes depending on timing.

Development Use Only

The development-use-only feature is intended for development use. Because updates are not atomic, this feature is not suitable for production use. Individual EJB Classloader for Implementation Classes

WebLogic Server allows you to reload individual EJB modules without requiring you to reload other modules at the same time and having to redeploy the entire EJB module. This feature is similar to how JSPs are currently reloaded in the WebLogic Server servlet container.

Because EJB classes are invoked through an interface, it is possible to load individual EJB implementation classes in their own classloader. This way, these classes can be reloaded individually without having to redeploy the entire EJB module. Below is a diagram of what the classloader hierarchy for a single EJB module would look like. The module contains two EJBs (Foo and Bar). This would be a sub-tree of the general application hierarchy described in the previous section.

Figure 4-4 Example Classloader Hierarchy for a Single EJB Module

To perform a partial update of files relative to the root of the exploded application, use the following command line:

Listing 4-4 Performing a Partial File Update

java weblogic.Deployer -adminurl url -user user -password password

-name myapp -redeploy myejb/foo.class

After the -redeploy command, you provide a list of files relative to the root of the exploded application that you want to update. This might be the path to a specific element (as above) or a module (or any set of elements and modules). For example:

Listing 4-5 Providing a List of Relative Files for Update

java weblogic.Deployer -adminurl url -user user -password password

-name myapp -redeploy mywar myejb/foo.class anotherejb

Given a set of files to be updated, the system tries to figure out the minimum set of things it needs to redeploy. Redeploying only an EJB impl class causes only that class to be redeployed. If you specify the whole EJB (in the above example, anotherejb) or if you change and update the EJB home interface, the entire EJB module must be redeployed.

Depending on the classloader hierarchy, this redeployment may lead to other modules being redeployed. Specifically, if other modules share the EJB classloader or are loaded into a classloader that is a child to the

EJB's classloader (as in the WebLogic Server standard classloader module) then those modules are also reloaded.

Application Classloading and Pass-by-Value or Reference

Modern programming languages use two common parameter passing models: pass-by-value and pass-by-reference. With pass-by-value, parameters and return values are copied for each method call. With pass-by-reference, a pointer (or reference) to the actual object is passed to the method. Pass by reference improves performance because it avoids copying objects, but it also allows a method to modify the state of a passed parameter.

WebLogic Server includes an optimization to improve the performance of Remote Method Interface (RMI) calls within the server. Rather than using pass by value and the RMI subsystem's marshalling and unmarshalling facilities, the server makes a direct Java method call using pass by reference. This mechanism greatly improves performance and is also used for EJB 2.0 local interfaces.

RMI call optimization and call by reference can only be used when the caller and callee are within the same application. As usual, this is related to classloaders. Because applications have their own classloader hierarchy, any application class has a definition in both classloaders and receives a ClassCastException error if you try to assign between applications. To work around this, WebLogic Server uses call-by-value between applications, even if they are within the same JVM.

Note: Calls between applications are slower than calls within the same application. Deploy modules together as an EAR file to enable fast RMI calls and use of the EJB 2.0 local interfaces.

Resolving Class References Between Modules and Applications

Your applications may use many different Java classes, including enterprise beans, servlets and JavaServer Pages, utility classes, and

linux weblogic创建域

Weblogic linux 下创建域步骤 1.cd /bea/wlserver_10.3/common/bin 进入目录 2.执行./config.sh进入配置界面。 选择1 3. 选择1

这一步直接继续 这一步是设置用户名密码和确认密码 这是选择模式我们选择2 (产品模式) 选择JDK版本我们选择第一个选择1

我们选择1 (YES) 这里选择1 (不配置安全存储) 这里指需要修改端口号就行 3

继续

继续 继续 继续 v 这里输入你要改的名字我这里随便写了一个1作为域名了

这里确认名字选择1 然后完成 修改 setDomainEnv.sh 在底端处JA V A_OPTIONS="${JA V A_OPTIONS}" export JA V A_OPTIONS 后面加上这两句话 WLS_USER=weblogic WLS_PW=weblogic 在startWeblogic.sh 中间添加这些参数 SA VE_JA V A_OPTIONS="${JA VA_OPTIONS}" SA VE_CLA S SPATH="${CLASSPATH}" 找到这个所在的位置在下面添参数 WLS_USER="weblogic" 域用户民 export WLS_USER WLS_PW="weblogic_note" 域密码 export WLS_PW MEM_ARGS="-Xms2048m -Xmx2048m -XX:MaxPermSize=1024m" export MEM_ARGS 在setDomainEnv.sh最前面添加此参数 JA V A_OPTIONS="${JA V A_OPTIONS} -Djava.security.egd=file:/dev/./urandom" export JA V A_OPTIONS WLS_USER=weblogic 域用户名 WLS_PW=weblogic_note 域密码

windows 配置WebLogic Server集群(增加版)

配置WebLogic Server集群 (本文讲述如何在WebLogic Server 8.1上配置集群,以及通过Proxy Server来访问集群)

预备知识 什么是Domain和Server Domain Domain是WebLogic Server实例的基本管理单元。所谓Domain就是,由配置为Administrator Server的WebLogic Server实例管理的逻辑单元,这个单元是有所有相关资源的集合。 Server Server是一个相对独立的,为实现某些特定功能而结合在一起的单元。 Domain and Server的关系 一个Domain 可以包含一个或多个WebLogic Server实例,甚至是Server集群。一个Domain中有一个且只能有一个Server 担任管理Server的功能,其它的Server具体实现一个特定的逻辑功能。 本文环境 平台:Windows 2000 软件:Bea WebLogic Server 8.1 SP2 配置WebLogic Server集群 WebLogic集群的体系结构 单层混合型的集群架构(Cluster) 这种架构将所有的Web应用以及相关的服务应用全部置于集群中的单一WLS实例中,这种架构的优势在于: 易于管理 灵活的负载平衡机制

更强的安全控制 多层结构的集群架构(Cluster) 这种架构使用两个WLS集群,一个放置表静态内容和集群Servlet,另一个放置集群EJB。一般应用于下面这些情况: 在负载平衡机制需要调用集群EJB中的方法时; 在提供内容与提供对象的服务之间需要更大的机动性时; 在需要更高的系统稳定性时;

weblogic管理服务配置方法

Weblogci管理服务配置方法 (第三稿)

目录 1概述 (3) 1.1本文预期读者: (3) 1.2本文作用: (3) 1.3名词解释: (3) 2基本测试环境 (4) 3管理服务与被管服务基本配置 (4) 3.1中间件安装 (4) 3.2配置管理服务器 (4) 3.3配置计算机 (4) 3.4配置NodeManager (5) 3.5配置本机受管服务 (6) 3.6配置远程受管服务 (6) 3.7配置“远程启动”选项卡 (6) 3.7.1设置类路径 (6) 3.7.2Java虚拟机内存设置 (7) 3.8受管服务的启动和停止 (7) 3.8.1控制台启动停止服务 (7) 3.8.2Weblogic脚本启动受管理服务 (8) 4久其CI部署相关配置 (8) 4.1配置连接池 (8) 4.2配置数据源 (8) 4.3发布应用程序 (8) 5其他 (8) 5.1多台计算机安装weblogic注意事项 (8) 5.2配置NodeManager常见问题 (9) 5.3设置远程启动选项卡常见问题 (10) 6后记 (10)

1概述 1.1本文预期读者: 本文读者必须有一定weblogic使用经验,对weblogic管理体系有一定了解。熟练掌握weblogic单domain配置方式。文中只对安装使用管理服务需要用到的特殊设置步骤进行说明。本文省略的地方请参考公司文档《久其CI3.0安装配置手册—Weblogic》。 1.2本文作用: 场景一: 对于某些IT内控比较严格的项目,项目组无法获得用户服务器密码。如果有需要重新启动中间件服务时项目组会非常被动。此时可以使用管理服务器来启动和停止受管理服务器上的应用服务。 场景二 在硬件资源比较充足的情况下我们可以在多台服务器上启动中间件来支撑我们的应用。此时使用管理服务可以统一部署升级应用,控制、监控各个服务的运行情况。场景三: 在单服务器32位操作系统环境下java内存最大只能使用2G。为了充分利用服务器资源我们可以启动多个服务支撑应用。多个服务如果都在单独的域中将给我们的应用部署升级,管理监控各个服务带来不便。此时我们可以使用管理服务对所有的服务进行统一管理。 场景四: 本文对weblogic管理服务进行了简单讲解,可作为学习weblogic集群的参考资料。 1.3名词解释: 域:英文名domain。“域”是指一组彼此相关的 WebLogic Server 资源,这些资源作为一个单元来管理。一个域包括一个或多个 WebLogic Server,另外还可能包括一个或多个WebLogic Server 群集。域是独立的管理单元。如果将应用程序部署在某个域中,则此应用

weblogic_10.3.5多机集群配置实测完整步骤(windows版)

Weblogic10.0多机集群配置说明 一配置说明: 配置weblogic双机集群,主机1上运行管理服务器,受管理服务器1和代理服务器,主机2上运行受管理服务器2。 二目标: 实现所有http请求全部发到主机1上的代理服务器,统一由代理服务分发给两个主机上的受管理服务器来处理业务,并且实现会话复制,即一台机器上的受管理服务器宕掉,所有的请求都转到另一台受管理服务器上,并且会话也会转移 三配置图解: 第一步, 首先在主机1上运行weblogic的配置向导。

选择“新建weblogic域”点击“下一步。(图01) 选择“生成一个自动配置的域以支持下列BEA产品“,点击”下一步“。(图02)

(03) 填入用户名和密码,请记录填写的信息不要丢失,后面登陆控制台的时候需要用到这些信息,点击“下一步“。(图 03)

(04) 首先选择左侧的“生产模式“,然后选择右侧的”sun jdk“,点击”下一步“。 (图04)

选择下方的“是“,点击”下一步“。(图05) (06)

填写管理服务器的相关信息( 我的配置:主机1 192.168.1.103),点击“下一步“。(图06) (07) 填写各个受管理服务器的详细信息,这里要注意的是new_ManagedServer_2的监听地址填的是主机2的ip地址,因为这个服务实际是运行在主机2上,下面是我的配置: new_ManagedServer_1 192.168.1.103 7002 new_ManagedServer_2 192.168.1.101 7003 proxy_server 192.168.1.103 80 点击“下一步“。(图07)

weblogic12.1.3集群搭建(包括远程机器)

Weblogic12.1.3集群搭建 1基本概念 WebLogic的一些基本概念:熟悉Weblogic的必经了解的概念——1.1域(Domain): 1.概念 (1)域是管理的单元或边界; (2)作为一个单元来管理的,并相互关联的一组WebLogic服务器资源被称为域; (3)Domain是webLogic Server管理的一个基本单元,包括一个管理server和一个管理的入口。 (4)在创建server和使用server的时候需要先创建Domain。 (5)每个Domain都包括一个config.xml文件,在domain的根目录下的config目录中。 2.组成 ——(1)由server组成 (2)server分Administration server和Managed Servers (3)Administrationserver负责domain的管理,一般不负责应用

(4)Managed server部署实际的应用 (5)Cluster 3.总结: Domain是一个逻辑上的概念 Domain是一组Sever的集合 一个域有且只有一个管理服务器 1.2服务器(Server): 1.分类 ——服务器(Server)分Administration Server(管理服务器)和Managed Server(被管理服务器,也称受管服务器) 2.Administration Server(管理服务器) ——是控制整个域配置的中心操作节点,管理服务器维护着整个域Domain 的配置并将配置分配到每个被管理服务器Managed Server 中,每个域中都必须有一个Administration Server。

weblogic服务器优化配置详解

第一章概要 WebLogic 配置文件(config.xml)包含了大量很直观的与性能有关的参数,能通过配置环境与应用程序得到很好的优化。基于系统的需要调整这些参数不仅能改善单个点的性能,而且能提高整个应用程序性能的可衡量性。 试着采用下列WebLogic配置方法,或许能使你的系统达到最佳状态: 一修改运行队列线程数的值。在WebLogic 中队列元素的线程数等于同时占用运行队列的应用程序的数目。当任务加入一个WebLogic 实例,它就被放到执行队列中,然后分配给任务一个线程来运行。线程消耗资源,因此要小心处理这个属性——增加不需要的值,会降低性能。 二,如果可能,使用自带的性能包(NativeIOEnabled=true)。 三,使用特定的应用程序执行队列。 四,使用JDBC连接池时,修改下列属性: 驱动名称:使用小的驱动或者jDriver。 初始容量:设为与最大容量相同的值。 最大容量:其值至少应与线程数相同。 五,把连接池的大小设为与执行队列的线程数相同。 六,设置缓冲。 七,为Servlet和JSP使用多个执行队列。 八,改变JSP默认的Java编译器,javac 比jikes或sj要慢。 第二章优化WebLogic 提要: 为WebLogic启动设置Java参数。 设置与性能有关的配置参数。 调整开发与产品模式默认值。 使用WebLogic“自有的IO”性能包。 优化默认执行队列线程。 优化连接缓存。 如何提高JDBC连接池的性能。 设置Java编译器。 使用WebLogic集群提高性能。 监视WebLogic域。 一、为WebLogic启动设置Java参数 只要启动WebLogic,就必须指定Java参数,简单来说,通过WebLogic.Server 域的命令行就可以完成,不过,由于这样启动的过程冗长并且易于出错,BEA 公

手册:Weblogic 集群配置

Weblogic 集群配置手册 使用Domain Configuration Wizard进行配置 创建新的Domain 输入命令“./config.sh”,单击“下一步”按钮,如果没有配置环境路径,可进入/../weblogic/Oracle/Middleware/wlserver_10.3/common/bin/安装目录执行。 选择安装域源 选择安装“WebLogic Server”,单击“下一步”按钮

指定域名和位置 输入域名,单击“下一步”按钮。

配置管理员用户名和密码 输入Weblogic管理员管理服务器(AdminServer)的用户名和密码,在此以“sxscms”作用登录管理服务器的用户名,密码welcome1,单击“下一步”按钮 配置域启动模式和JDK 选择“生产模式”和“JRockt SDK”后,单击“下一步”按钮

选择可选配置 选择“管理服务器”和“受管服务器,集群和计算机”,单击“下一步”按钮。

配置管理服务器 根据集群配置前的规划,输入Administrator Server的名称,监听地址,监听端口,如果需要SSL支持的话可以在“SSL enabled”后面的复选取框上打勾,配置SSL监听端口,单击“下一步”按钮。 配置受管理服务器(代理服务器实际上也是一个受管理服务 器) 根据集群配置规划输入Managed Server的名称,监听地址,监听端口,如果需要SSL 支持的话,可以在“SSL enabled”复选框上打勾,配置SSL监听端口。可以配置多个Managed Server。单击“下一步”按钮

命令行安装及创建域

2.2 安装步骤如下: [zhuying@Test232 opt]$ ./server103_linux32.bin Extracting 0%.......................................................................................... ..........100% Unable to instantiate GUI, defaulting to console mode. <----------------------------------------- Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------> Welcome: -------- This installer will guide you through the installation of WebLogic Platform 10.3.0.0. Type "Next" or enter to proceed to the next prompt. If you want to change data entered previously, type "Previous". You may quit the installer at any time by typing "Exit". Enter [Exit][Next]>Next <----------------------------------------- Oracle Installer - WebLogic Platform 10.3.0.0 -----------------------------------------> Choose BEA Home Directory: -------------------------- "BEA Home" = [Enter new value or use default "/home/zhuying/bea"] Enter new BEA Home OR [Exit][Previous][Next]> /home/zhuying/opt/bea <----------------------------------------- Oracle Installer - WebLogic Platform 10.3.0.0 ----------------------------------------->

weblogic集群例子步骤

一,注意: 1,不要通过控制台启动ManagedServer 2,做集群的电脑上的ManagedServer 名字要和其他机器上的相同ManagedServer 名字相同。 二,具体步骤: 1, 2, 两台电脑分别安装好weblogic10.3.2版本 3,第一台电脑Machine1上创建一个域cluster_domain Run as follow “Configuration Wizard” 创建一个域例如叫cluster_domain, 其中有一步要选择yes,这样可以配置proxy server,cluster 等信息 在这个步骤中要创建cluster_domain,并在创建cluster_domain的过程中 配好一下对象: 1,两个Machine :

3,一个cluster new_Cluster_1 并将new_ManagedServer_2, new_ManagedServer_1给new_Cluster_1, 将new_Cluster_1 给proxy Server 4,第二台电脑machine2上也建一个域名字同上交cluster_domain 当然也可以是任何其 5,创建该域是不需要被指cluster ,代理服务等信息, 建一个受管server名称new_ManagedServer_2 一定要和machine1中做集群的那个受管server名称new_ManagedServer_2完全相同,端口号7002也要同 三、创建启动Managed Server 的文件 1,第一台电脑Machine1 在目录C:\bea\user_projects\domains\cluster_domain新建 startWebLogic.cmd 内容为: SETLOCAL set DOMAIN_HOME=C:\bea\user_projects\domains\cluster_domain call "%DOMAIN_HOME%\bin\startWebLogic.cmd" %* ENDLOCAL stopWebLogic.cmd 内容为: SETLOCAL set DOMAIN_HOME=C:\bea\user_projects\domains\cluster_domain call "%DOMAIN_HOME%\bin\stopWebLogic.cmd" %* ENDLOCAL

创建weblogic新域(带图说明)

创建weblogic新域与配置Oracle连接池 一、创建一个新域 1.1.选择创建域服务器 以服务器192.168.165.14为例,用户crm01登录,进入目录:/weblogic/92/weblogic92/common/bin 使用ls命令查看bin目录下的文件,如图1.1.1所示: 图1.1.1 1.2 创建域命令 使用./congfig运行命令,如图1.2.1所示: 图1.2.1

该界面显示的1为创建一个新域,2为扩展一个已经存在的weblogic域 1.3.域资源配置 在命令行中选择输入“1”或者直接输入“Next”后点击回车进入Domain Source选择界面,如图:1.3.1 图 1.3.1 图示1为选择weblogic平台组件,2为选择已经存在的模板。 在提示符处输入“1”或者输入“Next”按回车进入Application Template选择界面,如图1.3.2所示: 图1.3.2 同样在提示符处输入“Next”进入用户配置,包括weblogic控制台登录用户名,密码,描述。如图1.3.3所示: 图1.3.3 图示1为修改用户名 图示2为修改用户密码 图示3为确认修改密码 图示4为修改描述

成功修改提交后显示如图1.3.4所示: 图1.3.4 修改完成后在提示符输入“Next”进入域模式配置Domain Mode Configuration 1.4 域模式配 域模式配置是对新建的域选择一个域的模式,模式如图1.4.1所示 图1.4.1 图示1为扩展模式,2为生产模式,默认选择1,输入Next进入下个配置项。 1.5 JDK的配置 JDK配置是选择服务器上装好的JDK版本和目录进行择,举例机器上为2,故选择2后回车,进入下个配置,如图1.5.1所示 图1.5.1 1.6 确认配置 该页面提示和选择的是是否需要修改已经配置好的模板,默认为否,如图1.6.1所示

weblogic在windows下安装及部署项目教程

Weblogic在windows下安装及部署项目教程 1.Weblogic10.3.6版本下载地址: https://www.360docs.net/doc/6113156477.html,/technetwork/cn/middleware/ias/downloads/wls-main-091116-zhs.html 或在\\192.168.60.244\Tool\测试环境工具上取 2.安装 1)安装目录:D:\Oracle\Middleware 2)选择安装类型为自定义,选择自己需要安装的组件,其他都是默认直接下一步,直 到安装完成。 3.创建域 1)创建新的weblogic域 2)其他默认,点“下一步”,到下图这个界面设置用户名和密码。例如:用户名:weblogic 密码:weblogic1

3)选择服务器启动模式和JDK 4)选择可选配置

5)配置管理服务器 6)后面步骤直接“下一步”,知道创建完成。创建完成,运行 D:\oracle\Middleware\user_projects\domains\easyStore_domain\bin\startWeblogic.c md,用浏览器打开http://192.168.60.244:7001/console可直接登录管理服务器。 4.配置受管服务器 1)登录界面,使用自己设置的用户名密码登录

2)新建受管服务器 3)设置服务器名称、服务器监听地址、服务器端口,名称和端口均不与其他服务器重 复。然后点击“下一步”,完成。

5.配置数据源 1)点击“新建”,选择“一般数据源” 2)设置JDBC数据源名称,以及数据库类型,点击“下一步” 3)设置数据库驱动程序,选择如下图所示 4)设置JDBC数据源详细信息,实际的数据库名称、数据库用户名、主机地址等。

weblogic集群的优势和劣势

Weblogic集群介绍 在介绍weblogic集群之前,先看看传统的双机架构, 这种架构存在以下几点不足之处: 1)采用主机备机的方式,一般主机使用比较频繁,导致另外比较空闲,资源利用不均衡。 2)当一个Server发生故障的时候,必须通知用户使用另外一台的Server,管理和维护比较麻烦。 3)用户切换应用的时候,需重新登录,有些延误时间。 群集的优点是什么 可伸缩性 可以动态增加部署在WebLogic Server 群集中的应用程序的容量以满足需要。可以将服务器实例添加到群集中而不会中断服务,应用程序将继续运行而不会影响客户端和最终用户。 高可用性 在WebLogic Server 群集中,当服务器实例失败时应用程序可继续进行处理。可通过将应用程序组件部署到群集中的多个服务器实例,“群集”这些组件,这样,如果在其上运行某个组件的服务器实例失败,则将此组件部署到的其他服务器实例可以继续进行应用程序处理。 群集WebLogic Server 实例的选择对于应用程序开发人员和客户端是透明的。但是,了解启用群集的技术基础结构将有助于编程人员和管理员最大化其应用程序的可伸缩性和可用性。 群集的关键功能是什么 应用程序故障转移 简单的说,故障转移是当应用程序组件(在下列部分中通常称作“对象”)正在处理某个特定作业时某些处理任务部分由于任何原因而变得不可用,已失败对象的副本将结束此作业。WebLogic Server 支持自动或手动将群集服务器实例从一台计算机迁移到另一台计算机。可迁移的受管服务器被称作“可迁移服务器”。本功能适用于要求高可用性的环境。 负载平衡 负载平衡是在环境中跨计算资源与网络资源平均分发作业和关联的通信。 哪种类型的对象可以群集 群集的应用程序或应用程序组件在群集中的多个WebLogic Server 实例上可用。如果已群集某个对象,则此对象的故障转移和负载平衡是可用的。将对象均匀部署到群集中的每个服务器实例,可以简化群集管理、维护和故障排除。 Web 应用程序可由不同类型的对象组成,包括企业Java Bean (EJB),servlet 和Java Server Pages (JSP)。每种对象类型都具有唯一的一组与控制、调用以及它如何在应用程序内起作用相关的行为。由于此原因,WebLogic Server 用于支持群集的方法,以及用于提供负载平衡和故障转移的方法,会因不同的类型对象而异。可在WebLogic Server 部署对下列类型的对象进行群集:

weblogic创建domain域

weblogic创建domain域.txt 2008-02-21 15:55 bash-2.05# ls bsu utils.jar bash-2.05# cd.. bash: cd..: command not found bash-2.05# cd .. bash-2.05# cd weblogic81 bash-2.05# ls common javelin samples server uninstall workshop bash-2.05# cd server bash-2.05# ls 3rd_party_licenses.txt about_wls.html builder ext LICENSE.TXT bin copyright lib bash-2.05# cd bin bash-2.05# ' > ls > > > bash-2.05# pwd /usr/local/bea/weblogic81/server/bin bash-2.05# ls -l total 7830 -rwxr-xr-x 1 root other 5054 May 26 2006 ant -rwxr-xr-x 1 root other 171 May 26 2006 antRun -rwxr-xr-x 1 root other 1433 May 26 2006 antRun.pl -rwxr-xr-x 1 root other 2488 May 26 2006 complete-ant-cmd.pl -rwxr-xr-x 1 root other 1406 May 26 2006 cw_blueglobe.ico -rwxr-xr-x 1 root other 1406 May 26 2006 html.ico -rwxr-xr-x 1 root other 557056 May 26 2006 iisproxy128.dll drwxr-xr-x 2 root other 512 May 26 2006 international -rwxr-xr-x 1 root other 569344 May 26 2006 mod_wl128_20.so -rwxr-xr-x 1 root other 569344 May 26 2006 mod_wl_20.so drwxr-xr-x 2 root other 512 May 26 2006 oci817_8 drwxr-xr-x 2 root other 512 May 26 2006 oci901_8 drwxr-xr-x 2 root other 512 May 26 2006 oci920_8 -rwxr-xr-x 1 root other 548864 May 26 2006 proxy30128.dll -rwxr-xr-x 1 root other 548864 May 26 2006 proxy35128.dll -rwxr-xr-x 1 root other 548864 May 26 2006 proxy36128.dll -rwxr-xr-x 1 root other 548864 May 26 2006 proxy61128.dll

linux字符界面创建weblogic域方法

linux字符界面创建weblogic域方法 〇、环境 操作系统:Redhat 5.5 Weblogic :英文版 8.1.6 Weblogic安装目录:/weblogic 一、域的建立 执行下面语句进入weblogic的bin目录: 1.cd /weblogic/weblogic81/common/bin/ 运行新建服务向导: 1../config.sh 出现如下图界面 默认是新建服务(1.Create a new WebLogic configuration),所以:直接回车(或者输入1,回车) 出现下图

因为是创建新域,所以选择Basic WebLogic Server Domain(基本Weblogic 服务域)。 图中默认就是选中的这项,直接回车,如果不默认,输入该项前的序号 3 然后回车。 接下图: 提示:Do you want to run the wizard in express mode?(是否进入快捷向导模式?) 因为在非快捷模式下才可以自定义端口号等配置,所以要对它说No了: 输入 2 ,回车接下图:

上图中可以设置服务名、监听地址、监听端口等等,输入相应序号进入相应设置。 提示:Enter option number to select(输入选项序号进行选择)首先我们设置Name(服务名) 输入 1 ,回车接下图: 提示:Enter value for "Name" (输入服务名) 输入你的服务的名称比如:testserver,回车 接下图:

再次到设置选择页面,可以看到Name后面的值已经变成了刚刚输入的testserver。 现在我们来设置端口,输入3,回车接下图: 默认端口号是7001,如果不改的话不用管,我们在这里改为9001。输入9001,回车接下图:

WebLogic集群详细方案设计

From here 数据库层: 数据库:oracle 10g 数据库服务器:2台以上F5 设备:2台

部署图: 采用RAID 0+1的 磁盘阵列 部署描述: 1.F5虚拟地址作为对数据用户的唯一地址。 2.F5有主备2台设备,相互之间部署心跳线,在F5的配置中设定其中一台作为主机,配 置心跳的告警设置和数据库服务器的告警设置。 3.ORACLE需要安装F5的管理插件以监控数据库服务器性能参数和状态。 4.数据库采用RAC的方式进行集群,数据库之间有心跳线。 5.服务器Cluster需要一个统一的时间,在整个应用中由统一的服务器提供同步服务。

6.在数据库服务器集群和文件系统之间的交换机需要有主备线路。 访问控制: 1.对F5虚拟地址的访问需要在数据库防火墙中配置白名单 2.数据库的实地址只有DBA等数据库管理角色才能访问 负载均衡: 1.F5设备通过在Oracle服务器上的插件获取各个数据库本身的连接数,内存使用量,CPU 占用率等参数,以及在F5配置中设置负载分发的规则来分发对数据库的真实访问。2.对于数据库Cluster来说,采用10g以上版本的RAC的方式会有一个公用的缓存区。 数据安全: 1.在文件系统中采用RAID 0+1的方式进行数据存放和备份 2.磁带库作为文件系统的最终容灾备份。 故障处理: 1.在F5主机出现故障时,由F5备用的心跳监控到并做自动切换,同时可以按告警配置进 行对应操作。 2.数据库节点中一台出现问题时,会由别的节点接手,同时F5会监控到数据库的状态出 现异常并按照告警配置进行对应操作,例如【发送告警邮件】等。 3.在数据库集群和文件系统的网络中,当主要线路出现问题,由备用线路接手。 优点: 1.可扩展性好,在性能出现瓶颈的时候不需要修改整体布局,只需要增加服务器并配置 2.可靠性好,所有设备都至少有一个备用节点。 3.访问无缝隙,对于用户来说只有一个访问接口,对于内部所有节点的备用节点都能实现 自动切换或自动故障点剔除。

weblogic创建域

1、创建一个Weblogic Server域 本文假设你已经正确安装了这两个软件。值得注意的是在Weblogic Server8.1安装的时候,最后要你设置一个Server,你可以在安装的时候设置也可以在安装完了后从开始菜单 ——>程序——>Bea Weblogic Platform8.1——>Configuration Wizard来设置。 第一步:

选择“Create a new Weblogic confinguration”按next 下一步 选择Express选项,直接next 下一步

输入用户名,密码直接next 下一步 Production模式,然后选择SDK,直接next 下一步

create 将创建一个weblogic的应用域 done完成创建。 1、创建一个Weblogic 的应用(快速配置weblogic8.X的应用目录) 我们知道在weblogic7.x之前,安装完后weblogic会自动创建默认的应用目录

DefaultWebApp。如果没有特别的需要,就可以利用这个默认的应用目录布署Web应用程序或者J2EE系统了。而在weblogic8.x之后版本中,它不会自动创建默认的应用目录。所以我们需要使用Configuration Wizard来创建自己的应用目录,发布应用目录有两种方法,现分别介绍。 1.weblogic8.x安装 weblogic8.x有几个版本提供使用,我们使用了英文版的weblogic8.1。 2.回顾创建weblogic服务安装成功后,依次点击”开始”->”BEA WebLogic Platform 8.1”->”Configuration Wizard”,启动”BEA WebLogic Configuration Wizard”,选择”create a new weblogic configuration”,然后”next”,在”template”选择”base weblogic server domain”,然后”next”,没有特别的需要就不修改默认选择,然后”next”,在这个界面上输入用户名、密码和创建这个服务的描述(请记住这个用户密码它是启动这个服务和进入服务控制台的帐号),然后”next”,选择jdk 的版本,然后”next”,在这个界面你可以修改创建服务的目录和名称,然后按”create”开始创建。 3.创建应用目录创建应用目录有两种方式分别介绍如下(后面3.2的方法作为参考): 3.1 最简单的应用目录创建当weblogic服务创建成功后,再次打开“Configuration Wizard”,这次选择”extend and existing weblogic configuration(扩展weblogic配置)”,然后”next”,选择weblogic服务目录,然后”next”,在”Configuration Extensions”中勾选”DefaultWebApp”,然后以下取默认值一路”next”直到”import”就OK了。默认应用目录一般在D:\bea\user_projects\applications\mydomain\DefaultWebApp(注:d:为我PC机上安装weblogic的盘符,读者根据安装目录进行查找)。 配置方法如下:

weblogic_11g的安装和集群部署

weblogic 11g安装部署及集群

目录 1. Weblogic的安装与单个项目部署 (4) 1.1. Weblogic的安装 (4) 1.2. 创建域 (11) 1.3. 配置系统使用的数据源 (16) 1.4. 发布应用程序 (20) 2. 集群的简介、部署和运行 (24) 2.1. 集群的简介 (24) 2.1.1. 集群的定义 (24) 2.1.2. 集群的优点 (24) 2.1.3. 主要功能 (25) 2.1.4. 配置集群应用的必要条件 (25) 2.2. WebLogic单台主机集群的部署 (25) 2.2.1. 运行weblogic的配置向导 (25) 2.2.2. 创建新的Domain (26) 2.2.3. 选择安装域源 (27) 2.2.4. 指定域的名称和位置 (28) 2.2.5. 配置管理员用户名和密码 (29) 2.2.6. 配置域启动模式和JDK (30) 2.2.7. 选择可选配置 (31) 2.2.8. 配置管理服务器 (32) 2.2.9. 配置受管理服务器 (33) 2.2.10. 配置群集信息 (34) 2.2.11. 将“受管理服务器”添加到“集群”中 (35) 2.2.12. 创建HTTP 代理应用程序 (36) 2.2.13. 配置计算机 (37) 2.2.14. 配置向计算机分配服务器 (38) 2.2.15. 检查WebLogic 域配置 (39) 2.2.16. 正在创建域 (40)

2.2.17. 编辑WebLogic 服务启动文件 (41) 2.3. 增加新的受控节点 (41) 2.3.1. 增加计算机 (42) 2.3.2. 增加受控服务器 (43) 2.3.3. 在新主机上配置weblogic服务 (45) 2.3.4. 编辑weblogic服务启动文件 (51) 2.4. 运行WebLogic 服务 (51) 2.5. 将应用部署到集群上 (55) 2.5.1. 配置数据源 (55) 2.5.2. 点击“部署”菜单 (55) 2.5.3. 锁定并编辑 (56) 2.5.4. 开始安装 (57) 2.5.5. 部署成功验证 (60) 2.6. 部署集群过程中的问题 (62)

WebLogic 域配置策略

WebLogic 域配置策略 在本文的第一部分(第 8 期,卷 3 ,WLDJ )中,我曾向您详细介绍了可用于创建和配置域,以及经过评估的指南和模板选项的不同策略。在本文中,我使用了像 WLShell 、 WebLogic Scripting Tool 、 Silent Scripts 和 Ant 这样的工具来配置域。这些工具利用了简单的高级脚本语言。 注意:本文在很大程度上依赖于一些通用的步骤,比如第一部分中描述的域创建、数据库配置和检查域配置。 脚本语言 有很多问题与脚本语言的结构和语义有关。如何编写注释?如果有的话,什么是行分隔符?该语言支持哪些数据类型?该语言是否有变量和赋值?如何执行查询和导航?如何调用行为(即方法)?是否支持分支和循环?幸运的是,许多可选的脚本语言都可以用于域配置。让我们看一看这些语言。 WLShell 根据 WLShell 站点的说法,“ WLShell 是一种用于 WebLogic 的 shell 。” WLShell 使用一种非常简单的脚本语言来提供对 JMX Mbean 的访问,并提供一种熟悉的文件和目录导航模型,来导航 MBean 。 WLShell 的安装非常简单。下载正确的安装程序并执行之。遵照安装程序的步骤,完成安装。 WLShell 脚本语言支持单行注释。注释字符是散列符号( # )。以 # 开始的一切内容都被注释掉了。没有特殊的行结束符号。回显命令是 print 或者 echo 。 WLShell 使用熟悉的目录和文件概念来导航 WebLogic Server 实例, MBean 对应于目录,而 MBean 的属性对应于文件。因此,导航是通过像 cd 和 ls 这样的可识别命令来完成的。用于创建一个 MBean 的命令是 md ,而用于删除一个对象的命令是 rd 。例如,要创建一个名为 semJDBCConnectionPool 的连接池,可以执行下面的命令: md /JDBCConnectionP oo l/semJDBCConnectionP oo l 如果名称包含正斜杠怎么办?可以通过使用一个另外的正斜杠对这个正斜杠进行转义。例如,要创建一个名为 jdbc/semJDBCDataSource 的数据源,可以执行下面的命令: md /JDBCTxDataSource/jdbc//semJDBCDataSource 设置一个对象的变量属性可以使用 set 命令来完成。要设置一个 boolean 类型的变量,需要调用 set variable-name true-or-false 。例如,要把 StdoutDebugEnabled 变量设置为 true ,可以调用下面的命令: set StdoutDebugEnabled true 要设置一个 integer 类型的变量,需要调用 set variable-name integer-value 。例如,要把StdoutSeverityLevel 变量的值设置为 64 ,可以调用下面的命令: set StdoutSeverityLevel 64 要设置一个 string 类型的变量,需要调用 set variable-name "string-value." 。例如,要把 URL 设置为 jdbc:pointbase:server://localhost:9093/workshop ,可以调用下面的命令: set URL "jdbc:pointbase:server://localhost:9093/workshop" 设置原始类型的变量很容易,但是如何设置 java.util.Properties 类型的变量呢?要设置 java.util.Properties 类型的变量,需要使用特殊的语法。调用 set variable-name (java.util.Properties) "name=value ,各个 name=value 对之间由分号隔开。例如,要设置连接池的属性,可以调用下面的命令: set Properties (java.util.Properties) "user=weblogic;databaseName=jdbc:pointbase:server://localhost:9093/semdb" 至此,我已分析了如何设置 boolean 、 int 、 String 和 Properties 类型的变量。那么如何设置另一种 MBean 类型的变量呢?只要调用 set variable-name path-to-the-mbean 即可。例如,要设置 JMS JDBC 存储器的连接池属性,可以调用下面的命令: set ConnectionP oo l /JDBCConnectionP oo l/semJDBCConnectionP oo l 通过执行 ls 命令, WLShell 不仅列出了可以获取或设置的属性,而且还列出了可以调用的操作。如何执行一项操作呢?需要使用一个叫做 invoke 的特殊命令。 Invoke 命令的语法是: invoke method-name parameter-list-separated-by-space 。例如,要把连接池部署到服务器,可以调用下面的命令:

相关文档
最新文档