Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why

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)
commerce_system.jar
content_system.jar
groupspace_system.jar
netuix_system-full.jar
nf-jspcmods.jar
nf-system.jar
wlp-schemas.jar
wps_system.jar
wsrp-client.jar
    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 “release.properties” file and rename it to “release.{ USERNAME}.properties” example mine is “release.jisacw3.properties” 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
##
 
    lp.source.dir=${project.dir}/../source
 
##
## Extension Environment
##
 
    lp.ext.dir=${project.dir}/../ext
    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 ‘app.server.properties’ and then rename it to ‘app.server.{USERNAME}.properties’
    3. Append the entry below underneath the TOMCAT settings in the original app.server.properties
##
## WebLogic
##
 
# version of the app server, doesn't look like it is used in the build script
app.server.weblogic.version=9.2
# used in build script in several places, place to put files?
app.server.weblogic.dir=c:/bea/weblogic-out
 
# 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.

app.server.weblogic.bin.dir=${app.server.weblogic.dir}/server/bin

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

app.server.weblogic.lib.endorsed.dir=${app.server.weblogic.dir}/common/endorsed

app.server.weblogic.lib.global.dir=${app.server.weblogic.dir}/common/lib/ext
 
app.server.weblogic.deploy.dir=/anthill/lr-packs/applications/${env}
app.server.weblogic.portal.dir=${app.server.weblogic.deploy.dir}/ROOT

app.server.weblogic.classes.portal.dir=${app.server.weblogic.portal.dir}/WEB-INF/classes
app.server.weblogic.lib.portal.dir=
${app.server.weblogic.portal.dir}/WEB-INF/lib
app.server.weblogic.lib.support.dir=
${app.server.weblogic.dir}/server/lib

app.server.weblogic.log.dir=${app.server.weblogic.dir}/user_projects/domains/liferay/logs
app.server.weblogic.temp.dir=${app.server.weblogic.dir}/temp
app.server.weblogic.work.dir=${app.server.weblogic.dir}/work
 
# 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
app.server.weblogic.zip.name=liferay-portal-weblogic-9.2-${downloads.version}.zip
app.server.weblogic.zip.url=${sourceforge.mirror}/${app.server.weblogic.zip.name}
 
    1. Update your app.server.{USERNAME}.properties. This will owerride the properties in app.server.properties file. Those properties files are included in build-common.xml
app.server.type=weblogic
app.server.weblogic.dir=d:/temp/bea-temp
app.server.weblogic.deploy.dir=d:/temp/bea-war
#  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="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
 
<servlet>
    <servlet-name>JSPClassServlet</servlet-name>
    <servlet-class>weblogic.servlet.JSPClassServlet</servlet-class>
</servlet>
 
<servlet-mapping>
    <servlet-name>JSPClassServlet</servlet-name>
    <url-pattern>*.jsp</url-pattern>
</servlet-mapping>
 
</web-app>
 
    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
<if>
                           <equals arg1="${app.server.type}" arg2="weblogic" />
                           <then>
                                       <if>
                                                   <available file="${app.server.applications.war.location}" />
                                                   <then>
                                                               <delete failonerror="false" file="${app.server.applications.war.location}" />
                                                   </then>
                                       </if>    
                                      
                                       <!-- 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}"/>
                                       </war>
 
                                       <if>
                                                   <available file="${app.server.parent.dir}" />
                                                   <then>
                                                               <delete failonerror="false" dir="${app.server.parent.dir}" />
                                                   </then>
                                       </if>
                                       <if>
                                                   <available file="${app.server.weblogic.dir}" />
                                                   <then>
                                                               <delete failonerror="false" dir="${app.server.weblogic.dir}" />
                                                   </then>
                                       </if>    
                                       <if>
                                                   <available file="${app.server.weblogic.deploy.dir}" />
                                                   <then>
                                                               <delete failonerror="false" dir="${app.server.weblogic.deploy.dir}" />
                                                   </then>
                                       </if>    
                           </then>
               </if>
    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">

 <classpath>

 <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" />

 </fileset>

 </classpath>

 <jvmarg value="-Xms384m"/>

 <jvmarg value="-Xmx384m"/>

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

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

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

 <jvmarg value="-Dweblogic.jsp.windows.caseSensitive=true"/>

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

 </java>

<echo message="Successfully Compiled"/>

</target>

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
52619 Views
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Comments
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">
<classpath>
<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"/>
</fileset>
</classpath>
<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}" />
</java>
<echo message="Successfully Compiled" />
Posted on 8/23/09 8:55 AM.