Liferay in Action now has all its chapters

The Liferay in Action MEAP was updated today and now includes all the chapters that will be a part of the book. I still have some editing to do, but we're getting pretty close now. From the Manning announcement: 
 
What's new:
Chapter 1, "Liferay is a different portal," has been revised.
Chapter 2, "Appray: Development at light speed," has been revised.
Chapter 3, "A data-driven portlet made easy," has been revised.
Chapter 4, "MVC the Liferay way," has been revised.
Chapter 5, "Providing your own site design with themes and layout templates," has been revised.
Chapter 9, "Liferay architecture and extension points," has been revised.
Chapter 10, "A tour of Liferay APIs," has been added.
 
The new chapter 10 provides a tour of Liferay APIs that you'll want to use in your applications. You can give your applications friendly URLs, organize larger applications with ActionCommands, use the message bus, schedule jobs, index your data, and more. Chapters 1-5 and 9 have been updated in response to reader and reviewer feedback.
 
Next, the book will be moving into production, where it will get a copy edit and will be typeset for printing.
 
What's next:
I have to get the manuscript for its final technical review. Once that's done, there will be another batch of revised chapters in the next update. So you can still subscribe to the MEAP, and now is a great time to do it, since the book now has all its chapters. You can get a 35% discount on it by clicking here or on any of the banners for it that you see on liferay.com. 
 
To anyone who's been reading, thank you for your valuable comments and feedback. We're on the home stretch now! 
Blogs
Hi Richard,

I read before that in Liferay 6.1 overriding struts action methods will be possible in hooks. Are you going to update the chapter on hooks respectively or do you want to keep it specific to liferay 6.0?
Puj, I don't know about plans for the book but I've blogged about the struts action hooks here http://www.liferay.com/web/mika.koivisto/blog/-/blogs/overriding-and-adding-struts-actions-from-hook-plugins

I'll blog later about servlet filter hooks which is also possible in 6.1.
Hi Puj,

I won't be able to get that in, but I am planning a last minute appendix on an important feature in 6.1...stay tuned....

:-)
Where may I download the book's sample source code from?

Also, it would be good for Liferay to have a site for sample project source code that members could add to.
In addition to more focus on more current UI frameworks such as JSF, the samples in the book should provide examples of portal interfacing with other applications via web services. Accessing database from a portal is somewhat not aligned with strength of portal, which is integrating applications.
Hi Richard,
I am trying to get your hook to actually deploy using IDE and 6.0.6 as I am having problems with my own hooks. Sure enough you r code gets the same error in th ecategories.jsp file:

"Only a type can be imported. com.inkwell.internet.shopping.sb.model.ShoppingCategoryImage resolves to a package"
this then spawns other cannot resolve issues when using ShoppingCategoryImage and the LocalServiceUtil.

This has been a problem for 9 months now so I would have thought there was a known work around.

I have tried copying the service jar file to the ROOT/web-INF/lib folder which I think has worked before but not this time.

Any ideas?
Richard,
can you call or email me about the deployment of the inkwell shopping image hook.
I cannot get it to run without deleting the service jar file.
Have posted to LIA forum on Manning's site as well.
I cannot deploy any hooks that use service builder
Hi Dave,

Please see my reply over on the Manning forums. The service.jar needs to be moved from the hook to the global classpath, because hooked Liferay JSPs need access to those classes. I will make this more clear in the chapter.

--Rich
Typo in Page 90 of the PDF: shouldn't "getRegistrations()" be "getUserRegistrations()" based on the column name "userRegistration"....
I can't find the source code in http://www.liferay.com/web/richard.sezov/documents
Anyone can help?
Dear Richard,

Your book is not available in Indian Edition in India.

Your book has very HIGH demand in INDIA.

Thanks!
-NIrvan
Hi Richard,

I am interested with your coming book. Hope it is beginner and intermediate friendly on how to build apps or portlets at liferay 6.0.6 or newer version. Is it step by step to get things around or more to academic book?

I notice in amazon i can pre-order way cheaper than manning site after the 35% discounts - check here http://www.amazon.com/Liferay-Action-Official-Portal-Development/dp/193518282X/ref=sr_1_6?ie=UTF8&qid=1312887487&sr=8-6

so should i buy from amazon instead? Any help? if i buy from amazon, can you send me the pdf copy too? maybe i can show you the amazon receipt or something? any help? thanks.
Hi Chua,

I can't give you advice on where to purchase the book. You should purchase it from wherever you are most comfortable purchasing it. I can't give out PDFs of the book, as I'm not involved so much with the selling of the book, but one benefit of buying from Manning is that you get both the print book and the ebook in multiple formats.

I'm assuming that since Manning will be selling a Kindle / epub version of the book that they will also be available direct from Amazon / B&N as well.

--Rich
Hi Richard,

This is a great book. I have been reading Chapters 3 and 8 (Hooks) to add a new field (named "AddInfo") to the user portlet. I created the following service.xml and saved it to docroot\WEB-INF under the hook I created.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">

<service-builder package-path="com.liferay.sampuser">
<namespace>sampuser</namespace>
<entity name="AddInfo" table="AddInfo" local-service="true" remote-service="true">
<column name="statusId" type="long" primary="true" />
<column name="userId" type="long" />
<column name="status" type="boolean" />
<column name="user" type="Collection" entity="com.liferay.portal.User" mapping-key="userId" />

<order by="asc">
<order-column name="userId" />
</order>

<reference package-path="com.liferay.portal" entity="User" />
<reference package-path="com.liferay.portlet.expando" entity="ExpandoValue" />
<reference package-path="com.liferay.portlet.expando" entity="ExpandoRow" />

</entity>
</service-builder>

Following the instructions in Chapters 3 and 8, I also created other files including AddInfoLocalServiceImpl.java (\docroot\WEB-INF\src\com\liferay\sampuser\service\impl) and SampuserInfoLocalServiceImpl.java (\docroot\WEB-INF\src\com\liferay\sampuser\service) together with the necessary .jsp files.

After I ran service builder without any question, I ran ant deploy. However, I received a lot of errors. One part of the errors are related to "AddInfo" such as the following:

docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:37: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] public AddInfo addAddInfo(boolean Stat, long userId)

In this case, the entity "AddInfo" defined in service.xml cannot be found.

The other type of error is related to classes in the automatically generated file AddInfoPersistenceImpl.java. The error is like the following:

[javac] \docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:522: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl

I am relatively new to liferay , but have been stuck at this point for a while. Can you please advise what were the mistakes that I might have made? Any help to fix the errors is greatly appreciated!!

Also, it will be great if you can have some training courses available online.
Hi Li Dong,

Please see my reply to Dave above. The issue is that you need to move the service .jar that Service Builder generated to your global class path, if you're customizing a Liferay JSP that needs to call one of your services.

--Rich
Thank you, Rich, for your prompt response. In my case, I didn't see the error message like Dave's, that is, "Only a type can be imported. com.inkwell.internet.shopping.sb.model.ShoppingCategoryImage resolves to a package". I did try your suggestion, and moved my *-service.jar ("*" represents the name of the hook) located in docroot/WEB-INF/lib in the hook to ROOT.war/WEB-INF/lib/ (I used jboss). It seemed the problem didn't get fixed. Instead, I got more errors. Did I move the correct service .jar to the correct place??

Hope this won't be tiring you out...I am including the whole version of errors below generated before I moved the *-service.jar to the global path. Not sure if I am on the right track or I am totally off-track. Greatly appreciate your advice.
Buildfile: C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\build.xml

compile:

merge:

compile-java:
[javac] Compiling 10 source files to C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\classes
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:46: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] public AddInfo addAddInfo(boolean Stat, long userId)
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:58: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] public AddInfo getAddInfoByUser(long userId)
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:71: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] public AddInfo getEmptyStatus() {
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:77: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] public AddInfo updateInfo(AddInfo info)
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:77: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] public AddInfo updateInfo(AddInfo info)
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:47: cannot find symbol
[javac] symbol : method getExpandoBridgeAttributes()
[javac] location: class org.omg.IOP.ServiceContext
[javac] boolean status=(boolean) serviceContext.getExpandoBridgeAttributes().get("status");
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:47: inconvertible types
[javac] found : org.omg.IOP.ServiceContext.getExpandoBridgeAttributes.get
[javac] required: boolean
[javac] boolean status=(boolean) serviceContext.getExpandoBridgeAttributes().get("status");
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:49: cannot find symbol
[javac] symbol : method addUser(long,boolean,java.lang.String,java.lang.String,boolean,java.lang.String,java.lang.String,java.lang.String,java.util.Locale,java.lang.String,java.lang.String,java.lang.String,int,int,boolean,int,int,int,java.lang.String,long[],long[],long[],long[],boolean,org.omg.IOP.ServiceContext)
[javac] location: class com.liferay.portal.service.UserLocalServiceWrapper
[javac] User user=super.addUser(companyId, autoPassword, password1, password2,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:56: cannot find symbol
[javac] symbol : method addAddInfo(boolean,long)
[javac] location: class com.liferay.sampuser.service.AddInfoLocalServiceUtil
[javac] AddInfoLocalServiceUtil.addAddInfo(status,user.getUserId());
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:66: cannot find symbol
[javac] symbol : variable serviceContent
[javac] location: class com.liferay.portal.model.SampuserInfoLocalServiceImpl
[javac] boolean status=(boolean) serviceContent.getExpandoBridgeAttributes().get("status");
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:66: inconvertible types
[javac] found : serviceContent.getExpandoBridgeAttributes.get
[javac] required: boolean
[javac] boolean status=(boolean) serviceContent.getExpandoBridgeAttributes().get("status");
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:68: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.SampuserInfoLocalServiceImpl
[javac] AddInfo info=AddInfoLocalServiceUtil.getAddInfoByUser(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:68: cannot find symbol
[javac] symbol : method getAddInfoByUser(long)
[javac] location: class com.liferay.sampuser.service.AddInfoLocalServiceUtil
[javac] AddInfo info=AddInfoLocalServiceUtil.getAddInfoByUser(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:71: cannot find symbol
[javac] symbol : method addAddInfo(boolean,long)
[javac] location: class com.liferay.sampuser.service.AddInfoLocalServiceUtil
[javac] AddInfoLocalServiceUtil.addAddInfo(status,userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\SampuserInfoLocalServiceImpl.java:82: cannot find symbol
[javac] symbol : method deleteInfo(long)
[javac] location: class com.liferay.sampuser.service.AddInfoLocalServiceUtil
[javac] AddInfoLocalServiceUtil.deleteInfo(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:49: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] AddInfo info = AddInfoPersistence.create(
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:51: cannot find symbol
[javac] symbol : class info
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] info.class.getName()));
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:49: cannot find symbol
[javac] symbol : variable AddInfoPersistence
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] AddInfo info = AddInfoPersistence.create(
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:55: cannot find symbol
[javac] symbol : variable AddInfoPersistence
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] return AddInfoPersistence.update(info, false);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:61: cannot find symbol
[javac] symbol : class List
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] List<AddInfo> stat=getAddInfoByuserID(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:61: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] List<AddInfo> stat=getAddInfoByuserID(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:61: cannot find symbol
[javac] symbol : method getAddInfoByuserID(long)
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] List<AddInfo> stat=getAddInfoByuserID(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:72: cannot find symbol
[javac] symbol : class AddInfo
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] AddInfo info=AddInfoPersistence.create(0);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:72: cannot find symbol
[javac] symbol : variable AddInfoPersistence
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] AddInfo info=AddInfoPersistence.create(0);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:79: cannot find symbol
[javac] symbol : variable AddInfoPersistence
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] info=AddInfoPersistence.update(info);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\impl\AddInfoLocalServiceImpl.java:87: cannot find symbol
[javac] symbol : variable AddInfoPersistence
[javac] location: class com.liferay.portal.model.AddInfoLocalServiceImpl
[javac] AddInfoPersistence.remove(userId);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:409: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl
[javac] public static final FinderPath FINDER_PATH_GET_USERS = new FinderPath(com.liferay.portal.model.impl.UserModelImpl.ENTITY_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:410: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl
[javac] com.liferay.portal.model.impl.UserModelImpl.FINDER_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:411: cannot find symbol
[javac] symbol : class UserPersistenceImpl
[javac] location: package com.liferay.portal.service.persistence
[javac] com.liferay.portal.service.persistence.UserPersistenceImpl.FINDER_CLASS_NAME_LIST,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:409: internal error; cannot instantiate FinderPath(boolean,boolean,java.lang.String,java.lang.String,java.lang.String[]) at com.liferay.portal.kernel.dao.orm.FinderPath to ()
[javac] public static final FinderPath FINDER_PATH_GET_USERS = new FinderPath(com.liferay.portal.model.impl.UserModelImpl.ENTITY_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:447: cannot find symbol
[javac] symbol : class UserImpl
[javac] location: package com.liferay.portal.model.impl
[javac] com.liferay.portal.model.impl.UserImpl.class);
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:476: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl
[javac] public static final FinderPath FINDER_PATH_GET_USERS_SIZE = new FinderPath(com.liferay.portal.model.impl.UserModelImpl.ENTITY_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:477: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl
[javac] com.liferay.portal.model.impl.UserModelImpl.FINDER_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:478: cannot find symbol
[javac] symbol : class UserPersistenceImpl
[javac] location: package com.liferay.portal.service.persistence
[javac] com.liferay.portal.service.persistence.UserPersistenceImpl.FINDER_CLASS_NAME_LIST,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:476: internal error; cannot instantiate FinderPath(boolean,boolean,java.lang.String,java.lang.String,java.lang.String[]) at com.liferay.portal.kernel.dao.orm.FinderPath to ()
[javac] public static final FinderPath FINDER_PATH_GET_USERS_SIZE = new FinderPath(com.liferay.portal.model.impl.UserModelImpl.ENTITY_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:522: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl
[javac] public static final FinderPath FINDER_PATH_CONTAINS_USER = new FinderPath(com.liferay.portal.model.impl.UserModelImpl.ENTITY_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:523: cannot find symbol
[javac] symbol : class UserModelImpl
[javac] location: package com.liferay.portal.model.impl
[javac] com.liferay.portal.model.impl.UserModelImpl.FINDER_CACHE_ENABLED,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:524: cannot find symbol
[javac] symbol : class UserPersistenceImpl
[javac] location: package com.liferay.portal.service.persistence
[javac] com.liferay.portal.service.persistence.UserPersistenceImpl.FINDER_CLASS_NAME_LIST,
[javac] ^
[javac] C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java:522: internal error; cannot instantiate FinderPath(boolean,boolean,java.lang.String,java.lang.String,java.lang.String[]) at com.liferay.portal.kernel.dao.orm.FinderPath to ()
[javac] public static final FinderPath FINDER_PATH_CONTAINS_USER = new FinderPath(com.liferay.portal.model.impl.UserModelImpl.ENTITY_CACHE_ENABLED,
[javac] ^
[javac] Note: C:\webapps\edu-sc-asph-mysph-1p\plugins\hooks\sample-hook\docroot\WEB-INF\src\com\liferay\sampuser\service\persistence\AddInfoPersistenceImpl.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 39 errors
Hi Rich,

Could you please provide some advice on my question? Am I totally off track? What is the possible problem (or problems) that the entity "AddInfo" specified in service.xml cannot be recognized? Your help is highly highly appreciated!!

Li
Hi Li,

Sorry; I've been traveling and have had sporadic Internet access. It looks like you've moved the service .jar to the wrong place. It needs to be on the GLOBAL classpath, not Liferay's classpath, which is where you've put it. This is the same place you'd find portlet.jar or portal-service.jar.

Hope this helps!

--Rich
Hi Rich,

Thank you for your response. I greatly appreciated your time and help. I now did move it to the global classpath. However, this didn't change my fortune. I still received the same error message as above. Is it possible that I wrote my service.xml wrong or I put it in a wrong place (currently it is in /docroot/WEB-INF of the hook)? I included the service.xml codes below.

Thank you for your help!!

Li
The service.xml codes:
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">

<service-builder package-path="com.liferay.sampuser">
<namespace>sampuser</namespace>
<entity name="AddInfo" table="AddInfo" local-service="true" remote-service="true">
<column name="statusId" type="long" primary="true" />
<column name="userId" type="long" />
<column name="status" type="boolean" />
<column name="user" type="Collection" entity="com.liferay.portal.User" mapping-key="userId" />

<order by="asc">
<order-column name="userId" />
</order>

<reference package-path="com.liferay.portal" entity="User" />
<reference package-path="com.liferay.portlet.expando" entity="ExpandoValue" />
<reference package-path="com.liferay.portlet.expando" entity="ExpandoRow" />

</entity>
</service-builder>
Richard,

Thanks for the book, it is very helpful.

Just to let you know, the code download on the Manning site is out of date, and the one here in your doc library produces an error when unzipping.

Thanks