Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ruchi dubey
Your request failed to complete
March 9, 2013 1:48 AM
Answer

ruchi dubey

Rank: New Member

Posts: 9

Join Date: February 25, 2013

Recent Posts

Hi
I am working on liferay 6.0 with service builder. Service.xml builds successfully, after adding portlet to liferay and on clicking on save button I got this error
"your request failed to complete."
Can somebody please explain here why this error coming and the actual cause of this error.
Thanks
Ruchi
Jay Trivedi
RE: Your request failed to complete
March 9, 2013 4:02 AM
Answer

Jay Trivedi

Rank: Junior Member

Posts: 78

Join Date: November 23, 2012

Recent Posts

Ruchi,
Better you Put down piece of codes. emoticon
Manish Yadav
RE: Your request failed to complete
March 9, 2013 5:07 AM
Answer

Manish Yadav

Rank: Expert

Posts: 372

Join Date: May 26, 2012

Recent Posts

can you provide log file ..what exception its showing
Hitoshi Ozawa
RE: Your request failed to complete
March 9, 2013 11:39 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

This is happening because you have a bug in your portlet code. The portlet is not working properly because of this bug.
The actual root of this error is the person who wrote the portlet did not write the program correctly.
Raja Nagendra Kumar
RE: Your request failed to complete
March 10, 2013 6:44 AM
Answer

Raja Nagendra Kumar

Rank: Expert

Posts: 484

Join Date: March 1, 2006

Recent Posts

Which liferay bundle are you using.

If Tomcat Version, enable liferay debug logs at server using the details at http://www.liferay.com/community/wiki/-/wiki/Main/How+to+configure+the+logs+in+Liferay

When you are seeing "your request failed to complete." at browser, look at server logs, which should give the stack trace, which may have errors such as NullPointerException etc.. That should give the clues on what is wrong with the portlet you have developed

Regards,
Raja Nagendra Kumar,
www.tejasoft.com
ruchi dubey
RE: Your request failed to complete
March 10, 2013 11:26 PM
Answer

ruchi dubey

Rank: New Member

Posts: 9

Join Date: February 25, 2013

Recent Posts

Below I m putting code.
Service.xml

 1<service-builder package-path="com.liferay.book">
 2    <namespace>Book</namespace>
 3    <entity name="Book" local-service="true" remote-service="false">
 4
 5        <!-- PK fields -->
 6
 7        <column name="bookId" type="long" primary="true" />
 8
 9        <!-- Other fields -->
10
11        <column name="bookName" type="String" />
12        <column name="isbn" type="String" />
13        <column name="companyId" type="long" />
14        <column name="groupId" type="long" />
15       
16        <order by="asc">
17            <order-column name="bookName" />
18        </order>   
19
20        <finder name="G_PN" return-type="Collection">
21            <finder-column name="groupId" />
22            <finder-column name="bookName" />
23        </finder>
24        <finder name="GroupId" return-type="Collection">
25            <finder-column name="groupId" />
26        </finder>
27        <finder name="CompanyId" return-type="Collection">
28            <finder-column name="companyId" />
29        </finder>
30    </entity>
31</service-builder>


BookLocalServiceImpl.java

 1public class BookLocalServiceImpl extends BookLocalServiceBaseImpl {
 2   
 3    public Book addBook(Book book, long userId) throws SystemException, PortalException{
 4        Book l = BookUtil.create(CounterLocalServiceUtil.increment(Book.class.getName()));
 5        resourceLocalService.addResources(book.getBookId(), book.getGroupId(), userId, Book.class.getName(), book.getPrimaryKey(), false, true, true);
 6        l.setIsbn(book.getIsbn());
 7        l.setBookName(book.getBookName());
 8        l.setCompanyId(book.getCompanyId());
 9        l.setGroupId(book.getGroupId());
10        return bookPersistence.update(l, false);
11        //return BookUtil.update(l, false);
12    }
13}


liberary1.java
 1public class Liberary1 extends MVCPortlet {
 2
 3    public void addBook(ActionRequest request, ActionResponse response) throws SystemException, PortalException {
 4        String title = request.getParameter("bookName");
 5        String isbn = request.getParameter("bookSerial");
 6        ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
 7            Book book = ActionUtil.productFromRequest(request);
 8            ArrayList<String> errors = new ArrayList<String>();
 9            if (BookRegValidator.validateProduct(book, errors)) {
10                //BookLocalServiceUtil.addBook(title, isbn);
11                BookLocalServiceUtil.addBook(title, isbn);
12                //BookLocalServiceUtil.addBook(book, themeDisplay.getUserId());
13                SessionMessages.add(request, "product-saved-successfully");
14            }
15            else {
16                SessionErrors.add(request, "fields-required");
17            }
18    }
19}


portal.xml

 1<?xml version="1.0"?>
 2
 3<portlet-app
 4    version="2.0"
 5    xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
 6    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 7    xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
 8>
 9    <portlet>
10        <portlet-name>library</portlet-name>
11        <display-name>Library</display-name>
12        <portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class>
13        <init-param>
14            <name>view-jsp</name>
15            <value>/view.jsp</value>
16        </init-param>
17        <expiration-cache>0</expiration-cache>
18        <supports>
19            <mime-type>text/html</mime-type>
20        </supports>
21        <portlet-info>
22            <title>Library</title>
23            <short-title>Library</short-title>
24            <keywords>Library</keywords>
25        </portlet-info>
26        <security-role-ref>
27            <role-name>administrator</role-name>
28        </security-role-ref>
29        <security-role-ref>
30            <role-name>guest</role-name>
31        </security-role-ref>
32        <security-role-ref>
33            <role-name>power-user</role-name>
34        </security-role-ref>
35        <security-role-ref>
36            <role-name>user</role-name>
37        </security-role-ref>
38    </portlet>
39    <portlet>
40        <portlet-name>liberary1</portlet-name>
41        <display-name>Liberary1</display-name>
42        <portlet-class>com.test.Liberary1</portlet-class>
43        <init-param>
44            <name>view-jsp</name>
45            <value>/html/liberary1/view.jsp</value>
46        </init-param>
47        <init-param>
48            <name>add-process-action-success-action</name>
49            <value>false</value>
50        </init-param>
51        <expiration-cache>0</expiration-cache>
52        <supports>
53            <mime-type>text/html</mime-type>
54            <portlet-mode>view</portlet-mode>
55        </supports>
56        <portlet-info>
57            <title>Liberary1</title>
58            <short-title>Liberary1</short-title>
59            <keywords></keywords>
60        </portlet-info>
61        <security-role-ref>
62            <role-name>administrator</role-name>
63        </security-role-ref>
64        <security-role-ref>
65            <role-name>guest</role-name>
66        </security-role-ref>
67        <security-role-ref>
68            <role-name>power-user</role-name>
69        </security-role-ref>
70        <security-role-ref>
71            <role-name>user</role-name>
72        </security-role-ref>
73    </portlet>
74</portlet-app>


where is the problem please let me know...
Manish Yadav
RE: Your request failed to complete
March 11, 2013 12:12 AM
Answer

Manish Yadav

Rank: Expert

Posts: 372

Join Date: May 26, 2012

Recent Posts

can you please provide log files what. exception you are getting in console
ruchi dubey
RE: Your request failed to complete
March 11, 2013 4:06 AM
Answer

ruchi dubey

Rank: New Member

Posts: 9

Join Date: February 25, 2013

Recent Posts

No Exception coming at log.
However I resolved it as I forgot to put userId column at service builder.

well Thanks for all suggestions :-)