Install To Weblogic


This is a walkthrough on how to install to Weblogic 9 With 5.1.2
  1. Notations Used In This Document
    1. {USERNAME}
                                                              i.      This is your windows login username without the {}’s.
    1. (For Precompile Only)
                                                              i.      One of the niceties of weblogic is that if you create a war without pre-compiling it first it loads each jsp dog slow for the first time. This circumvents that by attempting to compile all jsps into class files.
  1. Prerequisites
    1. Install Ant
    2. Install JDK
    3. Add ANT_HOME, and JAVA_HOME to environment variables in “My Computer”->”Properties”->”Advanced”->”Environment Variables” to where you installed Ant and JDK
    4. Add “%ANT_HOME%\bin” and “%JAVA_HOME%\bin” to PATH system variable in “Environment Variables”.
  2. Setup Folder Structure
    1. Create a folder for your version, “D:\devtools\LifeRay\5.1.2” for our usage
    2. Create a folder for source “D:\devtools\LifeRay\5.1.2\source”
    3. Create a folder for ext ‘“D:\devtools\LifeRay\5.1.2\ext”
  3. Server Setup
    1. Create a liferay weblogic domain.
    2. Remove or backup the jars below if they exist
(Located in %BEA_HOME%/weblogic92/platform/lib/wlp)
    1. Download “Liferay Portal 5.1.2 Dependencies:”
    2. Unzip them in to the server’s global classpath.
    3. If you are using weblogic 9.2SP2 add -Dfile.encoding=utf-8 to the JAVA_OPT.
    4. Additional files needed in that global classpath are
                                                               i.      annotations.jar
                                                             ii.      xercesImpl.jar
    1. JDK endorsed files
                                                               i.      These go in {PATH TO JDK}\jre\lib\endorsed
1.      serializer.jar
2.      xalan.jar
    1. Follow the rest of the instructions here
  1. Setup the EXT Environment (original instructions from here)
    1. Download the version of the source you are needing from liferay website
    2. unzip the source to the “source” folder
    3. Make a copy of the “” file and rename it to “release.{ USERNAME}.properties” example mine is “” this much match your login or it will not work. 
    4. Edit your “release.{USERNAME}.properties” file change or create the following lines
## Release Source
## Extension Environment
    1. Open a command window and go to the source folder and type “ant clean start build-ext” this will build your ext environment.
    2. Go to the ext directory and make a copy of ‘’ and then rename it to ‘app.server.{USERNAME}.properties’
    3. Append the entry below underneath the TOMCAT settings in the original
## WebLogic
# version of the app server, doesn't look like it is used in the build script
# used in build script in several places, place to put files?
# this directory used by build script, it is deleted, so don't point to your weblogic files. It doesn't look like this directory is used for anything in Weblogic. For other webservers it runs the setenv scripts from this directory.


# Didn't see it used in the build script, probably not needed.${app.server.weblogic.dir}/common/classes
# properties files will be copied here



# Theese variables are used in the build-dist.xml, but there is no section for weblogic there, so you need to write your own or deploy by yourself through console${downloads.version}.zip${sourceforge.mirror}/${}
    1. Update your app.server.{USERNAME}.properties. This will owerride the properties in file. Those properties files are included in build-common.xml
#  app.server.applications.war.location can be changed to the application directory of your domain
app.server.applications.war.location = D:/devtools/BEA/WebLogic/Server/9.2_MP3/Domains/MKT/applications/liferay-portal.war
    1. (For Precompile Only) edit the web.xml file under ext\ext-web\docroot\WEB-INF (if it doesn’t exist create it (there is an example attached to this wiki)
                                                               i.      add
<?xml version="1.0"?>
<web-app xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="2.4">
    1. edit the ext/build-parent.xml file (there is an example attached)
                                                               i.      insert the following afer the last </if> statement in the deploy target
                           <equals arg1="${app.server.type}" arg2="weblogic" />
                                                   <available file="${app.server.applications.war.location}" />
                                                               <delete failonerror="false" file="${app.server.applications.war.location}" />
                                       <!-- Copy ext-service.jar to the war this is needed for ext reports portlet to work -->
                                       <copy file="${app.server.weblogic.dir}/common/lib/ext/ext-service.jar" todir="${app.server.portal.dir}/WEB-INF/lib/"/>
                                       <antcall target="print-current-time" />
                                       <antcall target="precompile" />
                                       <antcall target="print-current-time" />
                                       <war destfile="${app.server.applications.war.location}" webxml="${app.server.portal.dir}/WEB-INF/web.xml">
                                        <fileset dir="${app.server.portal.dir}"/>
                                                   <available file="${app.server.parent.dir}" />
                                                               <delete failonerror="false" dir="${app.server.parent.dir}" />
                                                   <available file="${app.server.weblogic.dir}" />
                                                               <delete failonerror="false" dir="${app.server.weblogic.dir}" />
                                                   <available file="${app.server.weblogic.deploy.dir}" />
                                                               <delete failonerror="false" dir="${app.server.weblogic.deploy.dir}" />
    1. (For Precompile Only) After the deploy-properties target insert this  (You will need to updated the path elements and file sets to match your environment)


<target name="precompile" description="Precompiles all JSP's">

<echo message="This will take a few minutes"/>

<echo message="If this fails you will need to fix the problems in the ext environment to continue"/>

 <java classname="weblogic.jspc" fork="true" failonerror="true">


 <pathelement location="D:/devtools/BEA/WebLogic/Server/9.2_MP3/server/lib/weblogic.jar"/>

 <pathelement location="D:/devtools/Java/jdk1.5.0_15/lib/tools.jar"/>

 <fileset dir="D:/DevTools/BEA/WebLogic/Server/9.2_MP3/Domains/MKT">

 <include name="*/*.jar" />



 <jvmarg value="-Xms384m"/>

 <jvmarg value="-Xmx384m"/>

 <jvmarg value="-XX:NewRatio=2"/>

 <jvmarg value="-XX:PermSize=128m"/>

 <jvmarg value="-XX:MaxPermSize=512m" />

 <jvmarg value=""/>

 <arg line="-k -verbose -compileAll -webapp ${app.server.portal.dir} -d ${app.server.portal.dir}/WEB-INF/classes"/>


<echo message="Successfully Compiled"/>


Now when you run “ant clean deploy” in the ext folder it will create a war file that runs nicely on weblogic 9.2 MP3.
  1. Special Thanks To, For without their help/posts I wouldn’t have figured it out.
    1. Joe Bond
    2. Nikhil Francis
    3. Tobias Amon


4 Attachments
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Threaded Replies Author Date
For precompiling under weblogic 10.3 use the... Manuel Ledesma August 23, 2009 8:55 AM

For precompiling under weblogic 10.3 use the following:

<target name="precompile" description="Precompiles all JSP's">
<echo message="This will take a few minutes" />
<echo message="If this fails you will need to fix the problems in the ext environment to continue" />
<java classname="weblogic.appc" fork="true" failonerror="true">
<pathelement location="${env.WL_HOME}/server/lib/weblogic.jar" />
<pathelement path="${env.BEA_HOME}/modules/features/weblogic.server.modules_10.3.0.0.jar"/>
­ <pathelement location="${java.home}/lib/tools.jar" />
<fileset dir="${basedir}/lib/global">
<include name="**/*.jar"/>
<jvmarg value="-Xms384m" />
<jvmarg value="-Xmx384m" />
<jvmarg value="-XX:NewRatio=2" />
<jvmarg value="-XXemoticonermSize=128m" />
<jvmarg value="-XX:MaxPermSize=512m" />
<arg line="-verbose ${app.server.portal.dir}" />
<echo message="Successfully Compiled" />
Posted on 8/23/09 8:55 AM.