Friday, July 26, 2013

Liferay 6.1/weblogic 12.1.1 java.lang.ClassCastException: com.liferay.portal.kernel.servlet.NonSerializableObjectHandler cannot be cast to java.lang.String

If you get this exception, don't try to debug, especially if you are using Weblogic with closed servlet code.
It is just as simple as problems with having not the same Servlet name in your web.xml as in your portlet.xml.

Liferay wants to have servlets name conteain portlet name in web.xml. Example
<servlet>
     <servlet-name>ListPortlet Servlet</servlet-name>
     .....
</servlet>

<portlet>
  <portlet-name>ListPortlet</portlet-name>
  <display-name>Highcharts List portlet</display-name>
....
</portlet>

So be aware, if your Portlet names don't match, you get this nasty exception. And it means that you need to reconsider your web.xml again.

Monday, July 8, 2013

Configure Weblogic 12 Cluster on Windows and run it locally (Weblogic 12.1.1)

    Here is a scenario how to configure Cluster locally on Windows
  • Start Node Manager (${WEBLOGIC_HOME}/wlserver_12.1/server/bin/startNodeManager.bat {.sh})

  • Start your Weblogic domain (we'll reference it as default domain, that is located at ${WEBLOGIC_HOME/user_projects/domains/base_domain/startWebLogic.cmd {.sh}})

  • Go to weblogic console and log in (if you haven't changed the port for your domain server, than it is http://localhost:7001/console)

  • Go to Environment (Umgebung) -> Computer (Rechner) and add new "Machine"

  • Don't forget to register here your NodeManager correctly. My nodemanager port number is 5556. And my nodeManager runs at localhost and uses SSl Listener Type.

  • Think about giving more memory to your server, otherwise it might be hard to deploy anything on it.

  • After you are done with it, go to Environment (Umgebung) -> Server and Add a new "server", that you will name ManagedServer.

  • After you are done with it, go to Environment (Umgebung) -> Cluster and create a new "Cluster". Then add your newly created ManagedServer to your Cluster.

  • Restart your NodeManager and your weblogic base_domain.

  • Now you are done and you can start your ManagedServer. After you started your ManagedServer, wait until the ManagedServer will get into the "Running status". Running status means that it's done and ready to be used.

    Happy Testing!

Monday, July 1, 2013

Liferay 6.x and IPC (Intra Portlet Communication)

In order to activate IPC for your portlets, you need to define value for portlet.event.distribution={YOUR_VALUE} in your {LIFERAY_HOME}/WEB-INF/classes/portal-ext.properties. I defined it as
portlet.event.distribution=ALL

Otherwise events for your portlets would not be propagated to the portlets that are on the other pages, and you might need it really desperately.

Liferay 6.x database reset

I came across an issue that made me start looking for a Liferay database reset. It turned out to be pretty simple, but it was not that easy to find

So here is what to do when you are using your hypersonic default database:

  • Stop your liferay application
  • Go to ${LIFERAY_HOME}/data/hsql folder
  • Remove your liferay.script and lportal.properties from that folder

And if you have already configured your Liferay to use Mysql or whatever other database, than just remove and recreate your custom liferay database again.

  • drop database lportal;
  • create database lportal character set utf8;