Deployment methods and caches for WebLogic

Source: Internet
Author: User

Reference URL:

http://dead-knight.iteye.com/blog/1938882

There are three ways to deploy Web apps in weblogic11g, but many novice deployments always have a few errors and don't know how to fix them. The following is an example of the SPRINGSIDE3 application of the White God (the reason is Springside3 is very representative) detailed explanation:
1, Prepare SPRINGSIDE3 application (Mini-web, mini-service), here I tidy up as a war package, a Web application folder, put on the network disk, provide download.
http://pan.baidu.com/share/link?shareid=1314310108&uk=3222190371
2. Automatic deployment (Autodeploy mode)
After http://dead-knight.iteye.com/blog/1938629 created domain, the directory in which the domain is located has a folder that is Autodeploy:
Yes, yes, that's it. Then what are you waiting for? The first step: directly to the Web Application folder (here Mini-web application as an example) copy the past can be. As shown in the following:
The second step: Log in to the console of domain, click on "Domains Structure"-"Deployment", you can see the following interface:
Description The Web app has been successfully deployed "Note: 1" Observation status, and deployment sequence, 2) the previous domain was created with the development model, which is the use of the development model of the rotation automatic hot Deployment "
Step three: Now that the deployment is successful, go to the app, as shown in:
In fact, the Autodeploy method does not require a restart of domain.
"Attention Point"
1) Automatic deployment is suitable for use in the development phase, and is not recommended in production environments
2) If you copy the application to Autodeploy, in the console of domain, click "domains Structure"-"deploy", and if you do not find the deployment record shown, you should look at the log below the logs folder. In general, your application problem is causing the deployment to fail.
3. Console Deployment (console mode):
Step One: Install the Web App (here's an example of the Mini-service application)
1) Select the installation application:
2) Select the application location, where Mini-service is the example and deployed as a war package:
Note: Here you can choose the jar, RAR, zip, war, ear, web App folder
3) The following steps all default until the last step, click "Done".
After clicking the "Finish" button, the domain is actually loading the Web app for your configuration, and you can observe the command console of domain (if the deployment fails, the console will have exception information).
Wocao! Even if there is a mistake, for proof:
Now return to the console and return to the list of deployments, as shown in:
Obviously, the status is "failed." At this time your mind should be thinking, clearly under Tomcat can run, WebLogic so rotten, even a simple application has failed to deploy? Springside3, how come you don't even support WebLogic?
Well, let's analyze the cause of the error (there are actually many applications that have these problems when WebLogic deployment)
To view error exception information:

Java Code

1. Caused By:java.lang.NoSuchMethodError:org.apache.commons.lang.ClassUtils.getCl

2. (ljava/lang/string;) Ljava/lang/class;

3. At Org.dozer.util.DefaultClassLoader.loadClass (defaultclassloader.java:3

4.1)

5. At Org.dozer.DozerInitializer.loadBeanType (dozerinitializer.java:116)

6. At Org.dozer.DozerInitializer.initialize (dozerinitializer.java:98)

7. At Org.dozer.DozerInitializer.init (dozerinitializer.java:75)

8. At Org.dozer.DozerBeanMapper.init (dozerbeanmapper.java:116)

9. Truncated. See log file for complete stacktrace

The error message is Apache-commons-lang's packet has the problem, why under Tomcat not this wrong? This error is due to the fact that WebLogic did not use the WEB app/web-inf/lib the Commons-lang package below. Now let's solve it, it's very simple, write weblogic.xml, put it under Web-inf. Weblogic.xml content is as follows:

Java Code

1. <?xml version= "1.0" encoding= "UTF-8"?>

2. <wls:weblogic-web-app

3. xmlns:wls= "Http://xmlns.oracle.com/weblogic/weblogic-web-app"

4. xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"

5. xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee

6. Http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd

7. Http://xmlns.oracle.com/weblogic/weblogic-web-app

8. Http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd ">

9. <wls:container-descriptor>

Ten. <wls:prefer-application-packages>

<wls: Package-name>org.apache.commons.*</wls: Package-name>

</wls:prefer-application-packages>

</wls:container-descriptor>

</wls:weblogic-web-app>

Configuration on folder: Weblogic.xml

<?xml version=< em> "1.0" ?

<weblogic-web-app

xmlns= "Http://www.bea.com/ns/weblogic/weblogic-web-app "

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

xsi:schemalocation= " http ://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/ Weblogic-web-app.xsd "

;

<context-root>/xx project </context-root>

< Virtual-directory-mapping>

<local-path>d:/</local-path>

<url-pattern>/ Fileupload/*</url-pattern>

</virtual-directory-mapping>

</weblogic-web-app>

Switch off domain's cmd console and restart domain. Review the deployment list again, as shown in:
As long as you add a weblogic.xml, restart the service, the application status is immediately changed to active. Now that the deployment is successful, access the WebService service WSDL provided by Mini-service, as shown in:
"Note: Many applications run without problems in other containers, and once there is a problem under WebLogic, the main thing is that WebLogic as a business middleware that integrates too many Java EE specification packages and some third-party open source packages, which leads to conflicts with the Web app's package, Instead, WebLogic takes precedence over its own integrated package, so the Web app's own package is not used. Using the Prefer-application-packages configuration is primarily a package that lets WebLogic pre-use the app "
4. Command Deployment (Weblogic.deployer mode):
This way need to remember the relevant commands, since there is a autodeploy,console way, basic can be. However, it is also attached to the command deployment operation documentation, refer to:
Http://edocs.weblogicfans.net/wls/docs92/deployment/deploy.html
Http://edocs.weblogicfans.net/wls/docs92/deployment/wldeployer.html
In fact, the three deployment methods above will have the same result, that is, configuring CONFIG. Specific location: Weblogic11\user_projects\domains\example\config\config.xml.
Locate the App-deployment node:

Java Code

1. <app-deployment>

2. <name>_appsdir_mini-web_dir</name>

3. <target>AdminServer</target>

4. <module-type>war</module-type>

5. <source-path>autodeploy\mini-web</source-path>

6. <security-dd-model>DDOnly</security-dd-model>

7. <staging-mode>nostage</staging-mode>

8. </app-deployment>

9. <app-deployment>

Ten. <name>mini-service</name>

One. <target>AdminServer</target>

<module-type>war</module-type>

<source-path>D:\work\webapps\mini-service.war</source-path>

<security-dd-model>DDOnly</security-dd-model>

</app-deployment>.

Here is the question and answer channel, I answered about WebLogic related issues, perhaps for you, he has a reference:
http://www.iteye.com/problems/97706
http://www.iteye.com/problems/97628
http://www.iteye.com/problems/97376

WebLogic Cache Location:

If you are using IDE tools to integrate WebLogic for development, the cache file will be in the \user_projects\domains\base_domain\autodeploy folder

If you leave the IDE tool, the WebLogic cache file will be in the \user_projects\domains\base_domain\servers\adminserver\tmp\_wl_user folder

Deployment methods and caches for WebLogic

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.