Thursday, June 27, 2013

HOWTO install Weblogic 12 and Liferay 6.1.1 on Windows

1) download Weblogic (for example version 12.1.1. http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html)

2) configure doamain (config.exe is in ${WL_HOME}/wlserver_12_1/common/bin)
 
3) start WebLogic. Start http://localhost:7001/console/ log in with your username and pssword that you configured in step2. Configure your datasources.

4) stop Weblogic and put the dependencies in your WebLogic domain folder ${WL_HOME}/${YOUR_DOMAIN}/lib. Dependencies are unpacked http://sourceforge.net/projects/lportal/files/Liferay Portal/6.1.1 GA2/ look for the file here liferay-portal-dependencies...zip These include hsql.jar , portal-services.jar and portlet.jar

5) Give your WebLogic more memory (setEnv.cmd), change to -Xmx11024m and -XX:MaxPermSize512m

6) Start your weblogic domain again. Go to http://localhost:7001/console/ log in and go to deployments. Install your liferay-war as application. Liferay.war can be downloaded for example http://sourceforge.net/projects/lportal/files/Liferay Portal/6.1.1 GA2/ (look for liferay-portal-6.1.1....war in this folder) Don't worry about the errors when parsing asset_publisher
21.06.2013 10:42 Uhr MESZ> <Warning> <HTTP> <BEA-101342> <liferay-portal-6.1.1: Error(s) encountered while precompiling JSP jspURI
 configuration.jsp:17:18: Error in "init.jsp" at line 249: The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65
535 bytes limit
<%@ include file="/html/portlet/asset_publisher/init.jsp" %>
                 ^--------------------------------------^
>



and don't worry about timeout exception
21.06.2013 10:45 Uhr MESZ> <Error> <Console> <BEA-240003> <Administration Console encountered the following error: java.lang.RuntimeException: Time
out waiting for completion
        at weblogic.management.provider.internal.ActivateTaskImpl.waitForCompletion(ActivateTaskImpl.java:402) 



6)
Start adding your portlet wars by putting them into deploy folder near your domain folder

7) If you are using spring with liferay and updating  to liferay 6.1.1, than you need to be aware, that your web applications won't start properly. You might wonder, why no matter what you do, your spring context is initilialized AFTER portlet context, so that your spring controler Portlets have nothing to work with.
Don't let yourself be fret with this. You need to patch liferay yourself. Just build it from sources and add the patch from  LIFERAY github repository
http://issues.liferay.com/browse/LPS-29103
https://github.com/brianchandotcom/liferay-portal 
It happens becasue when you are putting your web.xml packaged in war file in deploy folder, than liferay takes it and massages it. And due to that bug in 6.1.1 it doesn't put Spring listener before PortletContextListener. So Spring gets initiliazed, but only after portlets.

to build the patched war locally (from your checked out local folder {LIFERAY_FROM_SOURCES/portal}):
ant  -f build-dist.xml zip-portal-war

to build dependencies (from your checked out local folder
{LIFERAY_FROM_SOURCES/portal}):
ant  -f build-dist.xml zip-portal-dependencies




  

Tuesday, June 25, 2013

Configuration Weblogic 12.1.1 and liferay 6.1.1

LIBRARIES

The following libraries should be put into the ${WEBLOGIC_HOME}/${DOMAIN_HOME}/lib

  1. xercesImpl.jar (1336 KB)
  2. xml-apis-1.4.01.jar (216 KB)
  3. hsql.jar (if lifeary will be started with hsql Database)
  4. jaxen.jar (222 KB)
  5. log4j.jar (471 KB)
  6. log4j-extras.jar (339 KB)
  7. portal-services.jar
  8. portlet.jar

Most of those librires should be just copied from your exploded liferay-6.1.1 war in weblogic ${WEBLOGIC_HOME}/${DOMAIN_HOME}/AdminServer/tmp/_WL_user/${random}/liferay-portal-6.1.1/lib folder to your ${WEBLOGIC_HOME}/${DOMAIN_HOME}/lib folder.

JSF

Don't forget to install JSF library (2.0 version) in WebLogic after you are ready with liferay installation. You can find JSF library in ${WEBLOGIC_HOME}/wlserver_12.1/common/deployable-libraries

JPA

Weblogic uses EclipseLink as JPA Implementation. So when you are starting the Weblogic, it will validate all your JPA Entities and would miss some annotations that hibernate does not place, when you were generating Entities from the database with Hibernate ant task (for example @Temporal).

JNDI

Don't forget to assign your DataSources your AdminServer in WebLogic GUI and make Sure that WebLogic has Connection to them. Otherwise, in case if you are using JNDI to resolve the Datasources, you would get

15:48:12,120 ERROR [InfraProductionConfig:56] javax.naming.NameNotFoundException: While trying to lookup 'jdbc.MyDB' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/MyDB'