I manually created a site in Liferay, and want to get its object from a Java Liferay module. If I understand correctly, a site is represented by the Group class. So I wrote this:
Group group = GroupLocalServiceUtil.getFriendlyURLGroup(
Utils.getCompanyId(), "site1");
Problem: I get this exception:
com.liferay.portal.kernel.exception.NoSuchGroupException: No Group exists with the key {companyId=20116, friendlyURL=site1}
at com.liferay.portal.service.persistence.impl.GroupPersistenceImpl.findByC_F(GroupPersistenceImpl.java:3563)
at com.liferay.portal.service.impl.GroupLocalServiceImpl.getFriendlyURLGroup(GroupLocalServiceImpl.java:1141)
I am 100% sure that site1 exists. The exception still happens after I reindex all in "Server Administration".
What am I doing wrong?
Everything is perfect but when you lookup with friendly URL. You should pass friendly URL in param like "/site1"
Group group = GroupLocalServiceUtil.getFriendlyURLGroup(
Utils.getCompanyId(), "/site1");
Related
I'm trying to log-in in the login page of Liferay but It's showing UserEmailAddressException while calling authenticateByEmailAddress method in LoginUtil class of portal-Impl.jar.
I'm also getting the following warning.
No Group exists with the key {companyId=10113, classNameId=10039, classPK=10116} liferay
Here classPk is UserId but everytime it's taking the same value of classPk i.e 10116 instead It should take the logged in person's UserId from USER_ table.
I tried to find the implementation(code) of authenticateByEmailAddress method in portal-Impl.jar but couldn't find it. I failed to find how it's getting classPk=10116 that's where problem lies.
String authResult = UserLocalServiceUtil.authenticateByEmailAddress(company.getCompanyId(), login, password, headerMap, parameterMap);
When all the valid parameters are passed in authenticateByEmailAddress method. It should return 1. i.e successful authentication but UserEmailAddressException exception is being thrown.
"No Group exists with the key" error will occur when there is no corresponding entry in the group_ table .
in Latest versions of liferay, after successful login, an entry will created in the group_ table.
in this case, it may be corrupted/deleted. please check that way.
Thanks
It seems due to a recent SharePoint Online update that their lists (when selected using the left navigation) now adds a ViewPath query parameter by default. With this change, it seems like the Provider Hosted App redirect now sends a different ListId and not the Id for the actual list. When I use CSOM to resolve the ListId it results in a "Site Pages" and not the list at all.
clientContext.Web.Lists.GetById(ListId);
This code base did work before the recent SharePoint Online update but now I cannot call my list. If I manually remove the ViewPath query parameter from the list then the redirect shows the correct ListId and CSOM resolves the correct List. The problem is I cannot expect users to manually remove that query parameter.
If I navigate to the list by using the Site Content page and not the left navigation then this query parameter is not present and my application works.
Does anyone have context or direction into how to handle this new change?
I have a similar issue on our site. Instead of modifying the list, a script web part on the initial page seems to bleed through. I have ammended the links in the lefthand nav bar in an attempt to circumvent the viewpath query being added. I put in 2 url carriage returns on the end of the link. So far so good for me.
Client need SEF URL for e-commerce site (ISS 6). We tried IonicIsapiRewriter and it works good.
Now consider the below url,
www.store.com/product/12345/men_tshirt.html
This works fine. I write the rule to pass the id as query string (product.action?prt_id=12345)
But client wants the URL to be
www.store.com/product/men_tshirt.html
How to do this? Without passing product id how to identify the product?
In order to get this working as expected, the men_tshirt part needs to be the new ID to identify the resource that was formerly identified by 12345. So men_tshirt needs to be a unique value in that context.
Then you just need a mapping of those textual IDs onto numeric ID.
I am getting this error:
List does not exist
The page you selected contains a list that does not exist. It may have been deleted by another user. at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListsWithCallback...
Unfortunately it's not the unpublished masterpage manifestation of the error - the list GUID in the query string leads to one of several lists in the root web that are used to display user settings in controls on the master page.
The list is being accessed using the following code:
_RootWeb = SPContext.Current.Site.RootWeb;
storageList = _RootWeb.GetList(_RootWeb.Url + "/Lists/" +
LocalStrings.TimeZoneStorageList.ListName);
SPListItemCollection result = list.GetItems(query);
SPListItem StorageItem = result[0];
xmlDoc.LoadXml(StorageItem[LocalStrings.TimeZoneStorageList.Fields.UserXML]
.ToString());
Is there anything that could cause that code to throw an AccessDeniedException while the user is able to access the list through the UI?
Alternatively, is it possible for SharePoint to report a list as the source of the error when the permissions issue is actually somewhere else entirely?
Is there anything that could cause
that code to throw an
AccessDeniedException while the user
is able to access the list through the
UI?
This might not apply in your case, but yes, I have had this happen with:
Lookup fields where the user did not have permissions to the lookup list
People fields filtered to a chosen SharePoint Group where the user did not have permissions to view the membership of the group.
In both cases, these fields were not included in the views or forms normally used by the user so the problem was not immediately discovered.
Can you try getting your list as
_RootWeb.Lists[strListName]
where strListName is the Title of the list.
The List ID in the query string on AccessDenied.aspx can in fact be unrelated to the actual error.
The relevant code was something like
try {
throw new AccessDeniedException();
}
catch (Exception ex) {}
storageList = _RootWeb.GetList(ListUrl);
If CatchAccessDeniedException is not disabled, SharePoint will see the exception despite the catch and abort the thread. Since this is controlled on another thread, it's not synchronous and the code continues to run long enough that the thread aborts in the middle of accessing the list.
Both parts of the error message are technically correct - There was an AccessDeniedException, and the last operation was trying to open the list - but there is no actual connection between the two.
The actual problem turned out to be service account permissions on mysites, which naturally never appeared in any logs or error messages.
The issue for me was quite simple. I had a user who had permissions to the current site, which was fine. However, there was a list web part on the page I got the error that accessed items from a sub site in which the current user didn't have access.
In my case the error should have read "access denied for list".
I've made a custom content type based on the "Page publishing".
In this content type, I've also made a lookup field that lists all items in a list (nothing special with that list though)
When I use my own user to look at a page made with my custom content type, no problem.
When the site is crawled, the crawler doesn't want to index it giving me the error :
“ Content for this URL is excluded by the server because a no-index attribute.”
So I logged in with the same user as the crawler, and when I try to see the page, I get this error :
The page you selected contains a list that does not exist. It may have been deleted by another user.
Still, with that user, I can see the list that is used in the lookup field without any problem...
Any idea?