| |
| | This seemed to be a nice example, so I had to try it, but am I suprised ... it did not work  I might be stupid maybe, but now I am really tired of that nothing wont work for me in Liferay development. Now when I deploy this I get the answer that package com.liferay.util.services does not exist. Where do I get this and how do I get it into Netbeans? I have Liferay 5.2.1, Tomcat, Liferay SDK and Netbeans 6.5. It is not the only error I get either but the first. In CustomerPortlet_view.jsp there is an error on the first line. It says for "<%@page contentType="text/html"%>" that package com.example.customer.service and com.example.customer.model does not exist. How do I solve that? In CustomerPortlet.java there is errors in the processAction method. It says "Cannot find symbol" in CustomerDtls, and the same for setId, setName, setAge and so on. It would be most greatful if you have the time to give me a hint for what I am doing wrong. I have followed your instructions line by line for two times, so I dont think I have done anything wrong, but probably there is something missin in my installation. /Jane Posted on 4/1/09 2:52 AM. |
| |
| |
| | >>In CustomerPortlet_view.jsp there is an error on the first line. It says for "<%@page >>contentType="text/html"%>" that package com.example.customer.service and >>com.example.customer.model does not exist. How do I solve that? I hope you have done "Generate Service" . To make sure the services are generated properly, check in your file system if there's a directory called "services" under your project directory and also check the contents of that directory. It also generate some implementation classes under your source root, just check if those packages exist or not.
Ideally all the generated services classes are automatically added to the project's classpath. You can check the compile library of the project.
Let me know if that helps. If that doesn't work you can send me your project if possible. |
| |
| |
| | Yes I have done "Generate Service" and I have a directory called serivces with a lot of files in. I would be glad if you could take a look at my files, but where can I send them? Can I send them to you if I become your friend from your profile? Otherwise you can send an answer to my mailadress, jane.eriksson@miun.se, and I will post the files back to you. Is that ok?
/Jane |
| |
| |
| | I have the same problem. how to fixed it? |
| |
| |
| | Yap, I got the exact same problem. Any ideas? Posted on 4/3/09 9:45 AM. |
| |
| |
| | Are you facing the same "Cannot find Symbol" in java file ? If yes, did you try fixing import by fix import option. (Right click on editor > Fix Imports).
Have you selected the project's target runtime as Liferay Server ? Posted on 4/3/09 10:10 AM in reply to Rui Abreu. |
| |
| |
| | Hi Satya,
I just did what you suggested. The Fix Imports option doesn't do anything. And the project's runtime is a Liferay Server. I can deploy portlets to my Liferay instance.
Cheers |
| |
| |
| | If possible send me your sample project to me. I will check that. Also you can send me the screenshot of exact error. my mail id is ranjansatya at gmail dot com Posted on 4/4/09 8:19 AM in reply to Rui Abreu. |
| |
| |
| | The "Fix import" fixed one kind of error for me, but now get an other error about a missing package called com.liferay.util.service. Is there anyone who gets that error to? I have Netbeans 6.5.1 and Liferay Plugins SDK 5.2.2. Can it depend on Netbeans or what? Posted on 4/4/09 2:11 PM in reply to Rui Abreu. |
| |
| |
| | This is really great, it was working fine, I added the Columns then clicked on "Generate Services". It generated all the classes and I could see the newly generated source code in the folders although the Columns went blank and when I clicked "Add" in "Columns" section again nothing happened. The Design does not match the XML. I've attempted to make a new project then deleted them all and reinstalled several times and I still get the same result. I running this on a mac, any ideas? Posted on 4/5/09 9:47 AM. |
| |
| |
| | I have submitted a bug to NetBeans.org. I also tried this on a windows machine (vista) and it wouldn't let me click "Add" even the first time I tried it. PLEASE HELP. http://www.netbeans.org/issues/show_bug.cgi?id=162004 |
| |
| |
| | Jane,
Make sure you have selected the target runtime as "Liferay Portal Server" for the project. When you set the server as LR, then only portal-service.jar (required for com.liferay.util.service package) is added to the project's compile classpath.
Thanks !!! |
| |
| |
| | Brant,
Thanks for filing the issue. First you have to select any entity in "Entity" section and then you have to click "Add Column" in column section to add new columns. Sometime after adding columns, the focus goes away automatically from the selected entity and you see blank column section (it's a bug). You have to select a particular entity first to see the columns defined for that entity and then click add to add column. Hope that helps !! Let me know if it works for you.. |
| |
| |
| | Hi, do you mean that I must have "Liferay Portal Server" chosen as server for the project? If that is what you mean I already have that and have had so all the time for this project. The file portal-service.jar does not exist in my LiferaySDK environment at all. Is that wrong? I made a search in the Liferay portal environment and then I found it under \liferay-portal-5.2.1\tomcat-5.5.27\common\lib\ext. |
| |
| |
| | Me again ... I just want to add that in my project CustomerApp opened in NetBeans I can see the file portal-service.jar under Libraries/Liferay Portal Server 5.1.x/5.2.x, so that must be correct, or ... |
| |
| |
| | Jane,
Sorry for the confusion, the com.liferay.util.service package is there inside util-java.jar file. I tried with LR 5.2.2 (with Tomcat 5.5 bundle) and I could see the util-java.jar under the Libraries/Liferay Portal Server. You can expand util-java.jar to see the com.liferay.util.service package. But in someway if your IDE still doesn't recognize that package, I would suggest you to remove the liferay server from IDE and then reconfigure it again.
Let me know if that solves your issue. |
| |
| |
| | Hi, That did it as a matter of fact ...  I didn´t have any util-java.jar at all under Libraries/Liferay Portal Server, but when I did as you kindly told me, removed the Liferay server and added it again, and after a restart of Netbeans it was there. Strange, is´nt it? I was then able to Run the project and could finally test the new portlet. I have some questions thow: 1. Where does the information go that I add in the portlet? I cant find it. 2. When I run the project two pages of Liferay was opened. Why? 3. I still get some errors about zip-files that cant be opened and servlet default threw exception java.lang.NullPointerException and some warnings to. Is it possible to also send you the error-file and maybe get some tip again about what it can be. As I said I can run the project now, but it doesnt feel good with the errors. Thanks again! |
| |
| |
| | Well, the util-java.jar wasn't under Libraries/Liferay Portal Server, but I found in another location in the Liferay folder: /util-java. I imported it to the project and everything seems to work. Thanks a lot |
| |
| |
| | Jane,
Good to hear that it worked. Strange, how the util-java.jar got removed automatically first time. >>1. Where does the information go that I add in the portlet? I cant find it. Do you mean output ? If yes, then you need to add that portlet on your portal page using "Add Application".
>>2. When I run the project two pages of Liferay was opened. Why? Not sure. Sometime when the liferay is started in the developer mode it starts the browser automatically. Also netbeans launches browser after server restart from IDE. May be both are happening in your case. To avoid this, you can do only "Deploy" instead of "Run". And later go to the browser to see the output.
>>3. I still get some errors about zip-files that cant be opened and servlet default threw exception java.lang.NullPointerException
Send me the error log to my mail id. Thanks !!! |
| |
| |
| | I needed to select the "Entity" for it to work. Yay! Thanks for you help, it looks like it works fine. |
| |
| |
| | Okay, I had the same issue as above where I had to add in the java-util but after doing that I still get an issue with the added code: /Users/Brant/NetBeansProjects/CustomerApp/src/java/com/test/CustomerPortlet.java:21: cannot find symbol symbol : class CustomerDtls location: class com.test.CustomerPortlet CustomerDtls customer = CustomerDtlsLocalServiceUtil.createCustomerDtls(id);
I have CustomerDtlsServiceImpl but no CustomerDtlsLocalServiceUtil, was this supposed to be created? I am using the PortalPack 3.0.
Brant Posted on 4/6/09 1:09 PM. |
| |
| |
| | I meant "util-java.jar" opposed to "java-util". |
| |
| |
| | Fix Imports fixed this. |
| |
| |
| | Okay, this is hopefully the last issue. When I click deploy I get this in the console: init: deps-module-jar: deps-ear-jar: deps-jar: library-inclusion-in-archive: library-inclusion-in-manifest: compile: compile-jsps: /Users/Brant/NetBeansProjects/CustomerApp/nbproject/build-impl.xml:552: Problem: failed to create task or type nbdeploy Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef> declarations have taken place. BUILD FAILED (total time: 0 seconds) Posted on 4/6/09 4:06 PM. |
| |
| |
| | Brant,
Regarding your deploy issue, I am not sure why it's happening as it's not reproducible always. I could see some forum posts on that issue but got no answer http://forums.netbeans.org/post-29506.html http://forums.netbeans.org/ptopic4031.html
I will try to investigate what exactly is going wrong in your case ? (Looks like this issue is only on MAC sometimes)
Meanwhile could you please try to see if you can deploy a normal web application on Glassfish server from your NetBeans IDE ?
Thanks, |
| |
| |
| | Satya, >>1. Where does the information go that I add in the portlet? I cant find it. Maybe a stupid question ... I have added the portlet to my portal and have added a couple av names and can se that it works. The number of customers in the Database increases as it should, but I want to look in the Database and se the posts from there. Where is the Database so I can watch them? I will send the mail with my errors then. Thanks again! |
| |
| |
| | Jane, You could see the data using NetBeans's database explorer or if you are using MySQL DB then you could query mysql. But if you are using HSQL DB (default DB in Liferay) you need a HSQL DB explorer or you can configure your NetBeans's DB explorer to show your HSQL DB. |
| |
| |
| | I was able to take the war file created and copy it to the deploy folder. I'm quite dependent on Tomcat as I have a number of other webapps. |
| |
| |
| | I am not able to see the JSON service being generated. Is this supposed to be accessible during generation. How do I get access to the JSON service for using remote clients.
Regards, Brant |
| |
| |
| | Great tutorial on using the portalpack service utility.
Can you extend it and show us how to Update, Delete and View the data?
Thanks! |
| |
| |
| | Do you know how to show the list in a search container?
Like this one? "http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/SearchContainer" Posted on 4/24/09 5:35 PM in reply to Tony Lim. |
| |
| |
| | Currently the JSON services are not being generated for services in a stand alone portlet. But if you find any way to make the json service work in external portlet, please let me know. |
| |
| |
| | >>Great tutorial on using the portalpack service utility. >>Can you extend it and show us how to Update, Delete and View the data?
I will try to write a new blog which will cover these. Posted on 4/27/09 2:22 AM in reply to Tony Lim. |
| |
| |
| | This wiki explain everything about Search Container. Here is a sample code snppet where I am showing the list of movies from databse. Hope it will be useful for you.
<% List headers = new ArrayList(); headers.add("Movies"); headers.add("Release Date"); SearchContainer sc = new SearchContainer(); sc.setHeaderNames(headers); sc.setEmptyResultsMessage("No movies found");
List resultRows = sc.getResultRows();
Collection<Movie> movies = MovieLocalServiceUtil.getMovies(); Iterator it = movies.iterator(); int i =0; while (it.hasNext()) { Movie m = (Movie) it.next(); ResultRow row = new ResultRow(m.getName(), m.getName(), i++); PortletURL url = renderResponse.createActionURL(); url.setParameter("movie_name", m.getName()); row.addText(m.getName(), url); Date d = m.getReleaseDate(); String ds = ""; if(d != null) ds = d.toString(); row.addText(ds); resultRows.add(row); } %>
<ui:search-iterator searchContainer="<%=sc%>"/> Posted on 4/27/09 2:28 AM in reply to Tony Lim. |
| |
| |
| | Hi,
I've been following your tutorial and everything works great. But instead of letting the user specify the customer ID, I want to use the Counter Service. I'm able to deploy this version with no erros, but I always get execution errors. Have you ever used Counter Service? |
| |
| |
| | Hello again, Regarding my last post, the issue is fixed. Now, regarding your last post on SearchContainer, I have some doubts  Is the code you posted enough to display the table contents or is there something missing? Cheers mate Posted on 5/14/09 8:25 AM in reply to Rui Abreu. |
| |
| |
| | This example didnt work for me  for portalpack3.01) Allthough it worked for beta version. Don know what is the problem. Compiles successfully but doesnt get deployed on liferay 5.2.2 through netbeans. But if i copy the war file direcly to the tomcat depoy folder it works! Posted on 5/21/09 5:02 AM. |
| |
| |
| | Informative. Is there a similar set of instructions with eclipse? Posted on 6/9/09 1:37 AM. |
| |
| |
| | This I am looking forward to. Since I am not a programmer, this entire system is perfect to allow me to use Liferay as an important part of the MMO I work for.
I have now evaluated around 20 systems, and I am hoping that the easy portlet development you are championing will mean that Liferay is our final choice. |
| |
| |
| | Did not manage to generate service. I got this message:
classpath could not be modified please add $project_dir/service/glasses folder to your project classpath but don't pakage this folder in your webapp war |
| |
| |
| | used Glassfish ESB v2.1 (netbeans 6.5.1). Installed netbeans 6.5.1. Then "Generate Services worked. |
| |
| |
| | This is a great tutorial, it shows what I exactly needed to work with liferay database in my portlets with changing the ext environment.
Now I have 2 issues: - In the jsp file(view mode) the: out.println(CustomerDtlsLocalServiceUtil.getCustomerDtlsesCount()); is not showing the actual record count number. But i've tried to debug this inside the java code by simply System.out.println(CustomerDtlsLocalServiceUtil.getCustomerDtlsesCount()); and the value is correct there. Why isn't this value updated in the jsp ???
Other problem is about the database connection. I would like to have my portlets working with a different database different from the one that liferay uses. How can I specify that???
Thank you. Posted on 7/29/09 11:14 AM. |
| |
| |
| | using liferay 5.2.3 tomcat 6 bundle with netbeans 6.7.1, portal pack 3.0.1.
Got the service generation to work once, and managed to get this portlet deployed.
Tried to do it again and it failed with: Exception in thread "main" java.lang.NoClassDefFoundError: com/liferay/portal/tools/servicebuilder/ServiceBuilder
Any ideas why this has happened, and which jar ServiceBuilder is in. Posted on 8/9/09 12:09 PM. |
| |
| |
| | Just check if the target runtime for your application is still "Liferay Portal Server". The ServiceBuilder class is there inside portal-impl.jar which automatically gets added to the netbeans project classpath whenever Liferay Portal Server is selected as target runtime. |
| |
| |
| | Thanks for the reply.
From the look I got the portal auto deploy dir wrong so it was looking in the wrong place. |
| |
| |
| | Hi Satya,
I have follow all your instruction but it is not working at all.
In the jsp, there is no method "getCustomerDtlsesCount()". It is not generated in CustomerDtlsLocalServiceUtil. Same with the CustomerPortlet. No methods "addCustomerDtls(customer)" and "createCustomerDtls(id)" in CustomerDtlsLocalServiceUtil class.
However, I found the create() method in CustomerDtlsPersistenceImpl.class and the addCustomerDtls() and getCustomerDtlsesCount() in CustomerDtlsLocalService.class.
I believe this CustomerDtlsLocalServiceUtil is autogenerated and can't be edited like the Impl classes. Can you tell me whats wrong with the code?
I'm using Liferay 5.1.1 and netbeans 6.5.
Thanks Posted on 8/17/09 2:48 AM. |
| |
| |
| | Hi,
Do you have any sugestion on how to add a table column as a Foreign Key (Which is a Primary Key from other table) ?
Thanks. Posted on 8/18/09 10:14 AM in reply to N. Belo. |
| |
| |
| | Is there a way to expose the services generated within the plugin to Velocity via Web Content Portlet? Posted on 10/5/09 6:40 PM. |
| |
| |
| | hi satya,
i have created a portlet using netbeans. i had generated the service also, all the classes generated in service folder but not in project dir, and also no methods are created in ..LocalServiceUtil class.
see here http://www.liferay.com/web/guest/community/forums/-/message_boards/message/4146547 Posted on 10/15/09 11:00 PM. |
| |
| |
| | The Util classes are generated under services/ folder and the service.jar is created from that folder. And the implementation sources are there inside your project directory.
The Util class under services folder should have atleast setService() & getService() method initially. (Assuming you are using Liferay 5.2.3) Posted on 10/15/09 11:25 PM in reply to R charan. |
| |
| |
| | hi faizul, iam facing same problem. Methods in util class are not generated , only set and getService methods are present. iam also using netbeans 6.5, portal 5.1.1 and portal pack 3.0.1.
did u get the solution ? |
| |
| |
| | With Netbeans 6.5.1 and 6.8 beta the add column button does nothing. Is this an known issue. I would like to try this example. Does it work on any version Netbeans.? Posted on 11/3/09 1:25 AM in reply to R charan. |
| |
| |
| | Make sure you have selected entity name while clicking "add column" button. |
| |
| |
| | I have just gone to the Portal Pack website and it is now a blog aggregation called Planet Netbeans.
Where has the portal pack gone? Posted on 11/4/09 3:23 PM. |
| |
| |
| | The migration for netbeans.org is going on. It will be done by 9th Nov. Check this blog http://blogs.sun.com/lukas/entry/page_not_found_at_netbeans |
| |
| |
| | Thanks Satya, but I still cant find it - Do I assume that it has not been migrated yet?
Also, how are you going with the tutorial for update, delete, view and so on??? *Large cheesy hopeful grin* |
| |
| |
| | >>Thanks Satya, but I still cant find it - Do I assume that it has not been migrated yet?
Yes the portal pack migration is not done yet. It should be done by next week. I will post a message here once done. |
| |
| |
| | Thanks for this interesting article! In the design mode there are several options that I can't find : reference, mapping-table... Is it I didn't search well or are those options not supported yet? Portal pack sure seems amazing Posted on 11/27/09 2:54 PM. |
| |
| |
| | How I can chenge lenght of column. I create service.xml when i clikck is always for typ=String generate lenght 75. Can you give me instructions how I can change it?
Regards |
| |
| |
| | I'm getting an error using Netbeans 6.8.
I downloaded the Glassfish Bundle for Liferay 5.2.3.
I set up the bundled Glassfish as my Websynergy server.
When I click Generate Service I get the following dialog and error:
Classpath could not be modified. Please add $project/service/classes folder to your project class path But dont package this folder in your webapp war.
C:\LifeRayDev\UserExt\web\.service.properties build-service: C:\liferay-portal-5.2.3\glassfish\domains\domain1\applications\WEB-INF\lib C:\Users\usr29587\.netbeans\6.8\servicebuilder\build-service.xml:74: C:\liferay-portal-5.2.3\glassfish\domains\domain1\applications\WEB-INF\lib not found. BUILD FAILED (total time: 0 seconds)
Do you have any suggestions on what is going wrong? Posted on 12/16/09 7:05 AM. |
| |
| |
| | Thanks man, the Fix Imports netbeans feature has resolved the trouble. |