WebLogic application deployment guide

Source: Internet
Author: User
WebLogic application deployment guide
    Blog type:

  • WebLogic application deployment guide
1.1 deploy a Java EE application

Copy the compiled web application to the WebLogic Server Directory. For example, path D: \ bea10 \ user_projects \ Domains \ base_domain \ autodeploy;

In this way, WebLogic Automatically releases the project when Weblogic is started. There is a bug in WebLogic, and sometimes the project cannot be automatically released. In this case, we manually modify the config. xml configuration file. The configuration is as follows:

<App-deployment>

<Name> _ nvidir_qcgroup_dir </Name>

<Target> adminserver </Target>

<Module-type> war </Module-type>

<Source-path> autodeploy \ qcgroup </source-path>

<Security-dd-model> ddonly </security-dd-model>

<Staging-mode> nostage </staging-mode>

</APP-deployment>

Note: The configuration should be between <configuration-version> 9.2.0.0 </configuration-version> and <admin-server-Name> adminserver </admin-server-Name>.

Start the service and view information about the web program, such as logs, on the console. This indicates that the application has been published successfully.

I do not recommend that you use the Weblogic Web Control Program for deployment. If any error occurs, it is difficult to find the specific cause.
1.2 deploy the EJB Program

The deployment of the EJB program is the same as that of the Java EE program. You only need to change the module-type to EJB, as shown below:

<App-deployment>

<Name> appejb </Name>

<Target> adminserver </Target>

<Module-type> EJB </Module-type>

<Source-path> autodeploy \ EJB \ appejb. Jar </source-path>

<Security-dd-model> ddonly </security-dd-model>

</APP-deployment>

1.3 application architecture, compiling environment, and WebLogic version Selection
WebLogic has poor adaptability to JDK. It must use its own JDK version or the same JDK version. If the JDK version is different, the service cannot be started.

If the web application uses a framework of JDK 1.5 or later and the xml dtd is of Version 2.5 or later. You must use weblogic10 for deployment. Otherwise, the application cannot run normally and an error occurs in the project description. Even if the weblogic10 deployment is used, the application may not run normally. The following sections will cover it.

For example, if the struts2 framework is used and the version is weblogic9 or earlier, struts2 El expressions cannot be compiled.

1.4 precautions for deploying hibernate3 and WebLogic
Hibernate3 and WebLogic deployment exception: classnotfoundexception: org. hibernate. hql. Ast. hqltoken

Hibernate3.0 uses the new anlr-based hql/SQL query translator. In the hibernate configuration file, the hibernate. query. factory_class attribute is used to select the query translator.

(1) Select the query translator of hibernate3.0:
Hibernate. query. factory_class = org. hibernate. hql. Ast. astquerytranslatorfactory

(2) Select the query translator for hibernate2.1.
Hibernate. query. factory_class = org. hibernate. hql. Classic. classicquerytranslatorfactory

To use 3.0 of the batch update and delete functions,

You can only select (1). Otherwise, you cannot explain the statement for batch update. When using the statement, you may not be able to enter Chinese as a condition. If you select (2), you can enter Chinese characters, but you cannot explain the batch update statements.

Anlr is required in hibernate3. However, this package already contains the antrl class library in weblogic. jar, and some class loading errors will occur and the hibernate3.jar in war or ear cannot be found.

After this error occurs, anlr will call system. Exit (), so that WebLogic will stop the service.
Solution:
1. Add the attribute hibernate. query. factory_class to the hibernate. properties file. The attribute value is org. hibernate. hql. Classic. classicquerytranslatorfactory.

However, some functions may be faulty. For example, this system may have problems in batch deletion and update, and this system will not be used.

2. use WinRAR or WinZip to Open c: \ Bea \ weblogic81 \ Server \ Lib \ Weblogic in pre_classpath: antlr-2.7.5H3.jar to weblogic. jar to delete the anlr directory, and then antlr-2.7.5H3.jar in weblogic. jar in the same directory (Note: no strict tests have been performed after replacement, and I do not know whether there is any sequelae)

2.1. Copy the packet antlr-2.7.5H3.jar in hibernate3 to % wl_home % \ Server \ Lib

2.2. Modify % mydomain % \ startweblogic. CMD:
Add the following sentence before set classpath (note the package version ):
Set pre_classpath = % wl_home % \ Server \ Lib \ antlr-2.7.6.jar
Add the following sentence after set classpath:
Set classpath = % pre_classpath %; % classpath %

1.5 jar package conflict
Remove the following configuration from the Weblogic configuration file:
<Container-Descriptor>

<Prefer-web-INF-classes> true </prefer-web-INF-classes>

</Container-Descriptor>

1.6 deploy the Java EE Project in weblogic9.2
If the schema configured in Web. XML is 2.4.xsd, It is a J2EE project, but currently most applications are 2.5.xsd. In this case, we should change the schema to the following format:

<Web-app version = "2.4" xmlns = "http://java.sun.com/xml/ns/j2ee"

Xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance"

Xsi: schemalocation = "http://java.sun.com/xml/ns/j2ee

Http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd>

We recommend that you use weblogic10 to deploy applications because weblogic9 does not support struts2.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.