(1) [Avatar] Offline

I am leanrning Liferay.
I run the sample code that from source code for the book Liferay_in_Action.
I got errors below:

editJSP = null
viewJSP = null

Those errors come from the 2 lines below from the cole from

editJSP = getInitParameter("edit-jsp");
viewJSP = getInitParameter("view-jsp");

Therefore, the program produces error: "null is is not a valid include." That come from teh code below in

if (portletRequestDispatcher == null) {
_log.error(path + " is not a valid include");

That eror cause program stop process.

Please help me how do I fix this problem?

My email address is

Thanks a lot for your help
afshing (4) [Avatar] Offline
Re: Error on
I have the same problem, and since you didn't get any answer for more than 1 year, I have no hope to get the answer!
Very poor written book!
richard.sezov (279) [Avatar] Offline
Re: Error on
Hey guys,

Don't know why I didn't see this thread before, but thanks for posting in it again, afshing!

The Liferay in Action code was built for Liferay 6.0, as the book was released several months before Liferay 6.1 came out. If you're using Liferay 6.1, use a Plugins SDK for Liferay 6.1, and just generate the project as described in the book, and it will work.

The reason the one in the Liferay in Action doesn't work is that Liferay changed the parameters between 6.0 and 6.1. Instead of view-jsp, etc., the parameters are now view-template, edit-template; etc.

I hope this helps!

afshing (4) [Avatar] Offline
Re: Error on
Quick response!

I just found the problem and came to respond to it!
You were faster author! smilie
336032 (2) [Avatar] Offline
Dear all,

I am desperate with this same very first exercise in the book, on chapter 2.4.1.

It says "type create.bat hello-world "Hello World" and you will get "BUILD SUCCESSFUL" but I don't, it does not work. Coming from Windows development, I am new to Java, so I don't exactly understand this first exercise that is supposed to be so simple smilie ... I spent the day on this, I noticed a better behaviour with Windows Firewall off, in which case in .ivy cache it creates several folders and files, but still shows BUILD FAILED :

I try to get help elsewhere too, but as it's very first exercise, I don't really understand what it is supposed to do behing the scene, so it's hard to understand and debug. I understand you mean that "hello-world" is an already existing portlet somewhere available and that the apache ant is going to search it for me, and does not find it, am I correct? If yes, do you know what can prevent to find it and how to move on, and if not, could you please explain what I should do? Should I create the file myself, copy it from the source code you provide?

Here is the result I get:

F:\COEProjects\plugins\liferay-plugins-sdk-6.2\portlets>create.bat hello-world "
Hello World"
Buildfile: F:\COEProjects\plugins\liferay-plugins-sdk-6.2\portlets\build.xml
[ivy:resolve] :: Apache Ivy 2.3.0 - 20130110142753 ::
[ivy:resolve] :: loading settings :: file = F:\COEProjects\plugins\liferay-plugi
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
[ivy:resolve] module not found: biz.aQute#bnd;2.3.0
[ivy:resolve] ==== asu-gibson: tried

[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:

[ivy:resolve] ==== jboss-nexus: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== jboss-thirdparty: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== maven2: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== ow2-public: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== primefaces: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== liferay-public: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== pentaho: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ==== soapui: tried
[ivy:resolve] -- artifact biz.aQute#bnd;2.3.0!bnd.jar:
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: biz.aQute#bnd;2.3.0: not found
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :::: ERRORS
[ivy:resolve] Server access Error: handshake alert: unrecognized_name url=htt
[ivy:resolve] Server access Error: handshake alert: unrecognized_name url=htt
[ivy:resolve] SERVER ERROR: Proxy Error url=
[ivy:resolve] SERVER ERROR: Service Temporarily Unavailable url=http://reposit

F:\COEProjects\plugins\liferay-plugins-sdk-6.2\portlets\build.xml:5: The followi
ng error occurred while executing this line:
F:\COEProjects\plugins\liferay-plugins-sdk-6.2\build-common-plugins.xml:5: The f
ollowing error occurred while executing this line:
F:\COEProjects\plugins\liferay-plugins-sdk-6.2\build-common.xml:47: The followin
g error occurred while executing this line:
F:\COEProjects\plugins\liferay-plugins-sdk-6.2\build-common-ivy.xml:34: The foll
owing error occurred while executing this line:
F:\COEProjects\plugins\liferay-plugins-sdk-6.2\build-common-ivy.xml:50: impossib
le to resolve dependencies:
resolve failed - see output for details

Total time: 2 minutes 7 seconds

Thank you so much if you can help ...
336032 (2) [Avatar] Offline

You need to add this stupid biz.aQute jar in your code, otherwise it won't work, I lost hours on same issue. Not easy at all for unexperienced users in Java & LR to work with the Liferay in Action book; the book is great, but the code evolved so much that nothing works / compiles directly, so you lose more time trying to understand and make smth work than learning, it's a pity.

I hope author will be able to update the book to a recent version of LR and update code sources as well.

265701 (1) [Avatar] Offline
Errors on the - Fixed
To anybody that would like to get this code working in the Chapter 2 example with Version 7 of Liferay, there are several changes required either due to a spelling mistake or a change to the Liferay API.

Item 1: Change the view.jsp code to downcase username in two places.
- <jsp:useBean id="username" class="java.lang.String" scope="request" />
- <p>Hello <% username %>!</p>

This will match the parameter name in the portlet code.

Item 2: Change the edit.jsp code to add a namespace for the "username" item in the form.
- <td> <input type="text" name="<portlet:namespace /> username"></td>

This is necessary due to a change in Version 6.2 of Liferay.

Item 3: Change a couple of lines in
- String addName = actionRequest.getParameter("username") [ change to username from addName]
- prefs.setValue("name", addName); [remove the actionRequest.getParameters as you already have this value in addName]

With these changes, I was able to get the portlet deployed in Liferay and complete the exercise. I was using the Eclipse (Oxygen Release) with the Liferay Plugin SDK from Liferay CE Version 7.0.3.

Hope this helps out anyone.