Sunday, May 3, 2015

Fix bug Eclipse hangs Tomcat "starting" status nonstop when using proxy

If you have configured a proxy that does not resolves "localhost", the Tomcat startup will hang in Eclipse. To fix it, go to:

Window -> Preferences -> General -> Network Connections

and see if one of the boxes is checked. Change Active Provider to Direct (it unchecks all boxes) will resolved the problem.

References:
http://stackoverflow.com/questions/11371393/tomcat-not-starting-through-eclipse-timeout

Tuesday, March 17, 2015

Fix DB Network Adapter could not establish

Fist, make sure you configure listener.ora correctly:

# listener.ora Network Configuration File: C:\Oracle\Database\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\Oracle\Database\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\Database\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 301KhiemTT-W7)(PORT = 1521))

    )
  )

ADR_BASE_LISTENER = C:\Oracle\Database

Run lsnrctrl start to start Listener.

Hope that help!

Monday, March 16, 2015

Receive parameter from AJAX call in Liferay

One very important thing you should noted is set these property in portlet definition (in liferay-portlet.xml) at the end of <portlet> tag:

<add-default-resource>true</add-default-resource>

and

<requires-namespaced-parameters>false</requires-namespaced-parameters>

under <icon> tag.

If not, you can not get parameter's value out in  Portlet Implementation.

Liferay Scheduler

Very good Liferay Scheduler post:
http://itsliferay.blogspot.com/2012/08/implement-scheduler-in-liferay-61.html
https://liferayazam.wordpress.com/2012/06/10/create-a-scheduler-in-liferay-6/
http://pmkathiria.blogspot.com/2013/06/how-to-write-simplecron-scheduler-in.html