Weblogic deployment problem locating and solving, weblogic deployment

Source: Internet
Author: User

Weblogic deployment problem locating and solving, weblogic deployment

Weblogic, as a commercial middleware (EJB, jndi data source, log management, memory management, resource configuration management...), is a small open-source free container.

Weblogic was first developed by weblogic Inc. And then merged into BEA, and finally merged into Oracle.

Weblogic is a Java application server used to develop, integrate, deploy, and manage large-scale distributed Web applications, network applications, and database applications.

As a result, weblogic is generally used as the server for project release and deployment, while Tomcat/Jetty... small containers are usually used for local R & D.

In this way, problems will inevitably occur. problems may occur when a locally running web program is deployed in weblogic.

Most of the problems are caused by the jar dependency of weblogic conflicts with the jar in the project (the same jar version) or weblogic does not support the project jar.

When weblogic deployment fails (you can summarize the three axes ):

1. Confirm the weblogic version used by the company and read the standards supported by the corresponding weblogic version on the official website;

2. Check the weblogic error log to determine the conflicting jar or the jar not supported by webloigc;

3. Add the weblogic. xml configuration file to the project WEB-INFO directory for conflicting jar files, and declare the project jar to be preloaded;

4. For jar that is not supported by webloigc, upgrade weblogic or downgrade the jar version used by the project.

1. Confirm weblogic version and view the supported standards

Only when you know what you want to do is to be defeated, because weblogic has many minor versions and there are large differences between versions.

There are many ways to check the weblogic version. The most direct way is to ask colleagues who have installed weblogic, or log on to linux as follows.

After learning about the deployed version, go to the official oracle weblogic website, where the documents are the most comprehensive and authoritative.

Http://www.oracle.com/technetwork/middleware/weblogic/documentation/index.html

Find the corresponding version and jump to view Library, which is the overview of the entire version. Our focus should be on the standards supported by the weblogic version.

There are detailed weblogic support java, web Service, some miscellaneous standards, such as JDK, EL, Servlet, JAX-RS, JAX-WS ....

2. Check the deployment error log to identify and solve the problem.

With the specific support standards mentioned above and the specific types and methods for Error Reporting, You can remedy the problem.

The following lists several errors that may occur frequently when weblogic is deployed (many other exceptions are being added ):

Java. lang. UnsupportedClassVersionError: Unsupported major. minor version 51.0 (the Jdk version of weblogic is different from the jdk version of the project)

Request. getRealPath () is null (the servlet-api.jar is local and weblogic is different, use the class to load Thread. currentThread (). getContextClassLoader () to get the relative path)

ClassNotFoundException: org. hibernate. hql. ast. HqlToken (weblogic has relied on earlier versions of anlr. jar)

There are roughly three ways to solve this type of problem. You can also practice it yourself in case of deployment problems.

A. Delete the conflicting jar folder under weblogic:

(1) Delete the conflicting folders in/bea/weblogic12.1.3/server/lib/weblogic. jar;

(2) copy the conflicting XXX. ja r to/bea/weblogic12.1.3/server/lib and restart weblogic.

B. Load some jar files first by modifying the Startup Script

(1) copy the conflicting jar package to the $ {DOMAIN_HOME}/lib directory.

(2) Open the startWeblogic. sh file in $ {DOMAIN_HOME}/bin in a text editor and add the following content to it:

export first_classpath=${DOMAIN_HOME}/lib/xxxx.jar  SAVE_CLASSPATH="${first_classpath}:${CLASSPATH}"  

C. Use the weblogic. xml configuration in the application to preferentially load the application's jar

Weblogic configuration items are different because weblogic is not used. Do not copy the configuration items from the Internet.

Official website version description (other versions will be 1213 change it): http://docs.oracle.com/middleware/1213/wls/WBAPP/weblogic_xml.htm#WBAPP571

Follow the configuration of the prefer-application-resources/prefer-application-packages (preload the jar corresponding to the application) node:

<? Xml version = "1.0" encoding = "UTF-8"?> <Weblogic-web-app xmlns = "http://xmlns.oracle.com/weblogic/weblogic-web-app"> <container-descriptor> <prefer-web-inf-classes> false </prefer-web-inf-classes> <prefer- application-packages> <package-name> preload the package name in project lib, wildcard </package-name> <package-name> com. sun. faces. * </package-name> <package-name> com. bea. faces. * </package-name> </prefer-application-packages> </container-descriptor> </weblogic-web-app>

In Solution a, B, and c, the c solution is the optimal solution. weblogic, as a production environment, may deploy multiple applications, which is unlikely to restart at will.

Solution a and B will undermine the integrity of weblogic and may cause problems in other applications deployed on weblogic.

 

Related Article

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.