Jump to: navigation, search

Hudson-ci/Containers/Oracle Weblogic

Hudson Continuous Integration Server
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse Source
Hudson-bust.png Using Oracle WebLogic as a Container











Installation of Hudson into Weblogic 10.3 server

A big thank you for this blog by Maxence Button for the Weblogic expertise to get Hudson running. Hudson can be downloaded from as a WAR file, however, it cannot be deployed to Weblogic 10.3 server without some changes. These are necessary because of Weblogic's proprietary class loaders.

Note.png
Relevance
this installation was tested using Hudson 1.391 and Weblogic 10.3. Help us by updating it


To correct Weblogic's class loader problems, we need to build an EAR file and put the weblogic-application.xml directives into it.

1. Create a directory to story the ear contents, with the following structure:

ROOT_Folder/
  META-INF/
    application.xml
    weblogic-application.xml
    hudson.war

Once you create the ROOT_Folder,

  • drop the hudson.war into the ROOT_Folder
  • create the META-INF dir
  • create the following XML files in that META_INF dir:

weblogic-application.xml

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application 
     xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-application"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd
                         http://www.bea.com/ns/weblogic/weblogic-application 
                         http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">

  <!-- server-version: 10.3 -->
  <wls:application-param>
    <wls:param-name>webapp.encoding.default</wls:param-name>
    <wls:param-value>UTF-8</wls:param-value>
  </wls:application-param>

  <wls:prefer-application-packages>
   <wls:package-name>org.apache.*</wls:package-name>
   <wls:package-name>org.dom4j.*</wls:package-name>
   <wls:package-name>javax.xml.stream.*</wls:package-name>
  </wls:prefer-application-packages>
</wls:weblogic-application>

Weblogic needs this because (unlike JBoss, Tomcat, Jetty et. al) Weblogic will not load the JARs in the WAR before the Weblogic installed JARs, and usually the resulting error is that there is an old version of Ant 1.7 in scope, instead of Ant 1.8.x as Hudson wants. There is also a conflict with stax-api-1.0.1.jar for the javax.xml package listed.


application.xml

Here is a simple application.xml that will work

<application xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                                 http://java.sun.com/xml/ns/javaee/application_5.xsd"
             version="5">
  <module id="hudson">
    <web>
     <web-uri>hudson.war</web-uri>
     <context-root>/hudson</context-root>
    </web> 
  </module>
</application>

2. Zip the files up to create the ear

You can use your favorite file zip tool to create the ear file, I used 7zip. Just verify that the file is named hudson.ear and that it has the original WAR file and the META-INF dir in its root.

3. Install the WAR to the Weblogic server

Use your favorite method to install the hudson.ear into the Weblogic server. Note: remember to delete any old Hudson WAR or EAR deployments first.

4. Use Hudson

The application will deploy to http://serverName:port/hudson.