Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ram A
[urg]ntext data type cannt be selected as DISTINCT because it is not compar
February 20, 2013 4:28 AM
Answer

Ram A

Rank: Junior Member

Posts: 76

Join Date: January 16, 2013

Recent Posts

Hi ,

I am using Liferay 6.0.6.
I need ro restict the folder in Document Library to the peticular user group only.

For this I created a usergroup 'Editor1' and assigned a Role 'EditorRole'.
And i have defined the Permissions for the folder 'TestFolder' to the role 'EditorRole'.

When the user having the role 'EditorRole' logged into the application and when he navigated to the document library in Control Panel only that folder 'TestFolder' is visible to him and he can add document and sub folders in it.

He is able to delete the documents in those folders.
But when he tried to delete the subfolders in 'TestFolder' he is getting the error 'Document Library is temporarily unavailable' .But the user having "Administrator" Role can delete the sub folders in it and he is not getting any error.

Is it related to DB issue or anything i have missing while defining the permissions?


Below is the error stacktrace when user having 'EditorRole' role tries to delete the subfolder.
15:43:16,367 ERROR [JDBCExceptionReporter:234] The ntext data type cannot be selected as DISTINCT because it is not comparable.
15:43:16,424 ERROR [jsp:154] com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: could not execute query
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:190)
at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistenceImpl.filterFindByG_F(DLFileEntryPersistenceImpl.java:3115)
at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistenceImpl.filterFindByG_F(DLFileEntryPersistenceImpl.java:2998)
at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl.getFileEntries(DLFileEntryServiceImpl.java:163)

at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:86)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portlet.documentlibrary.service.impl.DLFolderServiceImpl.lockFolder(DLFolderServiceImpl.java:347)
at com.liferay.portlet.documentlibrary.service.impl.DLFolderServiceImpl.lockFolder(DLFolderServiceImpl.java:318)
at com.liferay.portlet.documentlibrary.service.impl.DLFolderServiceImpl.deleteFolder(DLFolderServiceImpl.java:98)
at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:86)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portlet.documentlibrary.service.DLFolderServiceUtil.deleteFolder(DLFolderServiceUtil.java:67)
at com.liferay.portlet.documentlibrary.action.EditFolderAction.deleteFolder(EditFolderAction.java:116)
at com.liferay.portlet.documentlibrary.action.EditFolderAction.processAction(EditFolderAction.java:63)
Caused by: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.GenericJDBCException: could not execute query
at com.liferay.portal.dao.orm.hibernate.ExceptionTranslator.translate(ExceptionTranslator.java:30)
at com.liferay.portal.dao.orm.hibernate.SQLQueryImpl.list(SQLQueryImpl.java:96)
at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:60)
at com.liferay.portal.kernel.dao.orm.QueryUtil.list(QueryUtil.java:52)
at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistenceImpl.filterFindByG_F(DLFileEntryPersistenceImpl.java:3112)
at com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistenceI


Can anybody please help me to fix this issue.

Thanks in advance
Ram A
Hitoshi Ozawa
RE: The ntext data type cannot be selected as DISTINCT because it is not co
February 19, 2013 4:14 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Are you using MS SQL Server by any chance? I think they changed data type. I think new version of Liferay support recent version of MS SQL Server data type.

http://msdn.microsoft.com/en-us/library/ms187993.aspx
Ram A
[urg]The ntext data type can't be selected as DISTINCT because it is not co
February 20, 2013 2:33 AM
Answer

Ram A

Rank: Junior Member

Posts: 76

Join Date: January 16, 2013

Recent Posts

Hitoshi Ozawa:
Are you using MS SQL Server by any chance? I think they changed data type. I think new version of Liferay support recent version of MS SQL Server data type.

http://msdn.microsoft.com/en-us/library/ms187993.aspx



Thanks Hitishi for the reply.

Yes i am using Liferay 6.0.6 and SQL Server 2008.
If it is a DB issue ,the error should come every time when we try to delete the sub folder right?

I mean when user having Admin Role tries to delete the subfolder he is not getting any error and that sub folder is deleting.
But when the user having the custom role tries to delete the folder it is giving the error.


Does anyone faced this issue earlier?
Anyone please help me to come out of this issue.


Thanks in advance
Ram A
Julien GRESSE
RE: [urg]The ntext data type can't be selected as DISTINCT because it is no
May 12, 2014 8:50 AM
Answer

Julien GRESSE

Rank: New Member

Posts: 4

Join Date: January 9, 2012

Recent Posts

Hi

I'm having the same issue when creating shortcuts: it's ok with admin but not with normal user.
I looked into the Liferay code and the error is not thrown for admin because I think that there is no permission check on group / folder.
I searching for a convenient way to update datatype to avoid the problem. I'll post solution if I found one.
Julien GRESSE
RE: [urg]The ntext data type can't be selected as DISTINCT because it is no
June 13, 2014 12:54 AM
Answer

Julien GRESSE

Rank: New Member

Posts: 4

Join Date: January 9, 2012

Recent Posts

It seems that upgrading Liferay to 6.1.2 GA3 from previous version does not change column type.

So just use ALTER TABLE to update columns. Here's my script that worked.

 1
 2ALTER TABLE BlogsEntry ALTER COLUMN content NVARCHAR(MAX);
 3ALTER TABLE BlogsEntry ALTER COLUMN trackbacks NVARCHAR(MAX);
 4ALTER TABLE CalEvent ALTER COLUMN recurrence NVARCHAR(MAX);
 5ALTER TABLE Company ALTER COLUMN key_ NVARCHAR(MAX);
 6ALTER TABLE DDMContent ALTER COLUMN xml NVARCHAR(MAX);
 7ALTER TABLE DDMStructure ALTER COLUMN xsd NVARCHAR(MAX);
 8ALTER TABLE DDMTemplate ALTER COLUMN script NVARCHAR(MAX);
 9ALTER TABLE DLFileEntry ALTER COLUMN extraSettings NVARCHAR(MAX);
10ALTER TABLE DLFileVersion ALTER COLUMN extraSettings NVARCHAR(MAX);
11ALTER TABLE ExpandoColumn ALTER COLUMN typeSettings NVARCHAR(MAX);
12ALTER TABLE Image ALTER COLUMN text_ NVARCHAR(MAX);
13ALTER TABLE JournalArticle ALTER COLUMN content NVARCHAR(MAX);
14ALTER TABLE JournalStructure ALTER COLUMN xsd NVARCHAR(MAX);
15ALTER TABLE JournalTemplate ALTER COLUMN xsl NVARCHAR(MAX);
16ALTER TABLE KaleoAction ALTER COLUMN script NVARCHAR(MAX);
17ALTER TABLE KaleoCondition ALTER COLUMN script NVARCHAR(MAX);
18ALTER TABLE KaleoDefinition ALTER COLUMN content NVARCHAR(MAX);
19ALTER TABLE KaleoInstance ALTER COLUMN workflowContext NVARCHAR(MAX);
20ALTER TABLE KaleoLog ALTER COLUMN workflowContext NVARCHAR(MAX);
21ALTER TABLE KaleoNotification ALTER COLUMN template NVARCHAR(MAX);
22ALTER TABLE KaleoTaskAssignment ALTER COLUMN assigneeScript NVARCHAR(MAX);
23ALTER TABLE KaleoTaskInstanceToken ALTER COLUMN workflowContext NVARCHAR(MAX);
24ALTER TABLE KaleoTimerInstanceToken ALTER COLUMN workflowContext NVARCHAR(MAX);
25ALTER TABLE Layout ALTER COLUMN typeSettings NVARCHAR(MAX);
26ALTER TABLE LayoutRevision ALTER COLUMN typeSettings NVARCHAR(MAX);
27ALTER TABLE Mail_Message ALTER COLUMN to_ NVARCHAR(MAX);
28ALTER TABLE Mail_Message ALTER COLUMN cc NVARCHAR(MAX);
29ALTER TABLE Mail_Message ALTER COLUMN bcc NVARCHAR(MAX);
30ALTER TABLE Mail_Message ALTER COLUMN body NVARCHAR(MAX);
31ALTER TABLE MBMessage ALTER COLUMN body NVARCHAR(MAX);
32ALTER TABLE MDRAction ALTER COLUMN typeSettings NVARCHAR(MAX);
33ALTER TABLE MDRRule ALTER COLUMN typeSettings NVARCHAR(MAX);
34ALTER TABLE OpenSocial_OAuthConsumer ALTER COLUMN consumerSecret NVARCHAR(MAX);
35ALTER TABLE PortalPreferences ALTER COLUMN preferences NVARCHAR(MAX);
36ALTER TABLE PortletPreferences ALTER COLUMN preferences NVARCHAR(MAX);
37ALTER TABLE Repository ALTER COLUMN typeSettings NVARCHAR(MAX);
38ALTER TABLE ServiceComponent ALTER COLUMN data_ NVARCHAR(MAX);
39ALTER TABLE Ticket ALTER COLUMN extraInfo NVARCHAR(MAX);
40ALTER TABLE UserNotificationEvent ALTER COLUMN payload NVARCHAR(MAX);
41ALTER TABLE WebDAVProps ALTER COLUMN props NVARCHAR(MAX);
42ALTER TABLE WikiPage ALTER COLUMN content NVARCHAR(MAX);
43ALTER TABLE WSRP_WSRPConsumer ALTER COLUMN wsdl NVARCHAR(MAX);
44ALTER TABLE WSRP_WSRPConsumer ALTER COLUMN registrationContextString NVARCHAR(MAX);