Thursday, July 18, 2013

Hudson on WebLogic

I struggled a bit to get Hudson 3.0.1 running on a Weblogic server with Oracle SOA Suite installed. Besides some extra deployment descriptors, there were some issues with conflicting libraries, caused by the default behavior of the Weblogic classloader. Here's what you have to do:

1. Modify the "hudson.war" (e.g. with 7Zip): Add a file "weblogic.xml"  to the "Web-Inf" direcrory.

File Content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 10.3//EN"
"http://www.bea.com/ns/weblogic/920/weblogic-web-app.xsd">
<weblogic-web-app>
  <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
  </container-descriptor>
</weblogic-web-app>

2. Create a directory "META-INF" is the same directory, where you have the "hudson.war".

3. Create a "application.xml" file in the "META-INF" directory.

File Content:

<?xml version="1.0" encoding="UTF-8"?>
<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>

4. Create a "weblogic-application.xml" file in the "META-INF" directory.

File Content:

<?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">
  <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>javax.xml.stream.*</wls:package-name>
  </wls:prefer-application-packages>
</wls:weblogic-application>

5. Zip the  "hudson.war" and "META-INF" directory into a "hudson.ear" file (e.g. with 7Zip).

6. Deploy the ear file e.g. via Weblogic console as an application. Now Huson shold be accessible via http://...:7001/hudson

Have fun and great builds ;-) !

No comments:

Post a Comment