Forums de discussion

[urg]ntext data type cannt be selected as DISTINCT because it is not compar

Ram A, modifié il y a 11 années.

[urg]ntext data type cannt be selected as DISTINCT because it is not compar

Junior Member Publications: 76 Date d'inscription: 16/01/13 Publications récentes
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
thumbnail
Hitoshi Ozawa, modifié il y a 11 années.

RE: The ntext data type cannot be selected as DISTINCT because it is not co

Liferay Legend Publications: 7942 Date d'inscription: 24/03/10 Publications récentes
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, modifié il y a 11 années.

[urg]The ntext data type can't be selected as DISTINCT because it is not co

Junior Member Publications: 76 Date d'inscription: 16/01/13 Publications récentes
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, modifié il y a 9 années.

RE: [urg]The ntext data type can't be selected as DISTINCT because it is no

New Member Publications: 5 Date d'inscription: 09/01/12 Publications récentes
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, modifié il y a 9 années.

RE: [urg]The ntext data type can't be selected as DISTINCT because it is no

New Member Publications: 5 Date d'inscription: 09/01/12 Publications récentes
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.


ALTER TABLE BlogsEntry ALTER COLUMN content NVARCHAR(MAX);
ALTER TABLE BlogsEntry ALTER COLUMN trackbacks NVARCHAR(MAX);
ALTER TABLE CalEvent ALTER COLUMN recurrence NVARCHAR(MAX);
ALTER TABLE Company ALTER COLUMN key_ NVARCHAR(MAX);
ALTER TABLE DDMContent ALTER COLUMN xml NVARCHAR(MAX);
ALTER TABLE DDMStructure ALTER COLUMN xsd NVARCHAR(MAX);
ALTER TABLE DDMTemplate ALTER COLUMN script NVARCHAR(MAX);
ALTER TABLE DLFileEntry ALTER COLUMN extraSettings NVARCHAR(MAX);
ALTER TABLE DLFileVersion ALTER COLUMN extraSettings NVARCHAR(MAX);
ALTER TABLE ExpandoColumn ALTER COLUMN typeSettings NVARCHAR(MAX);
ALTER TABLE Image ALTER COLUMN text_ NVARCHAR(MAX);
ALTER TABLE JournalArticle ALTER COLUMN content NVARCHAR(MAX);
ALTER TABLE JournalStructure ALTER COLUMN xsd NVARCHAR(MAX);
ALTER TABLE JournalTemplate ALTER COLUMN xsl NVARCHAR(MAX);
ALTER TABLE KaleoAction ALTER COLUMN script NVARCHAR(MAX);
ALTER TABLE KaleoCondition ALTER COLUMN script NVARCHAR(MAX);
ALTER TABLE KaleoDefinition ALTER COLUMN content NVARCHAR(MAX);
ALTER TABLE KaleoInstance ALTER COLUMN workflowContext NVARCHAR(MAX);
ALTER TABLE KaleoLog ALTER COLUMN workflowContext NVARCHAR(MAX);
ALTER TABLE KaleoNotification ALTER COLUMN template NVARCHAR(MAX);
ALTER TABLE KaleoTaskAssignment ALTER COLUMN assigneeScript NVARCHAR(MAX);
ALTER TABLE KaleoTaskInstanceToken ALTER COLUMN workflowContext NVARCHAR(MAX);
ALTER TABLE KaleoTimerInstanceToken ALTER COLUMN workflowContext NVARCHAR(MAX);
ALTER TABLE Layout ALTER COLUMN typeSettings NVARCHAR(MAX);
ALTER TABLE LayoutRevision ALTER COLUMN typeSettings NVARCHAR(MAX);
ALTER TABLE Mail_Message ALTER COLUMN to_ NVARCHAR(MAX);
ALTER TABLE Mail_Message ALTER COLUMN cc NVARCHAR(MAX);
ALTER TABLE Mail_Message ALTER COLUMN bcc NVARCHAR(MAX);
ALTER TABLE Mail_Message ALTER COLUMN body NVARCHAR(MAX);
ALTER TABLE MBMessage ALTER COLUMN body NVARCHAR(MAX);
ALTER TABLE MDRAction ALTER COLUMN typeSettings NVARCHAR(MAX);
ALTER TABLE MDRRule ALTER COLUMN typeSettings NVARCHAR(MAX);
ALTER TABLE OpenSocial_OAuthConsumer ALTER COLUMN consumerSecret NVARCHAR(MAX);
ALTER TABLE PortalPreferences ALTER COLUMN preferences NVARCHAR(MAX);
ALTER TABLE PortletPreferences ALTER COLUMN preferences NVARCHAR(MAX);
ALTER TABLE Repository ALTER COLUMN typeSettings NVARCHAR(MAX);
ALTER TABLE ServiceComponent ALTER COLUMN data_ NVARCHAR(MAX);
ALTER TABLE Ticket ALTER COLUMN extraInfo NVARCHAR(MAX);
ALTER TABLE UserNotificationEvent ALTER COLUMN payload NVARCHAR(MAX);
ALTER TABLE WebDAVProps ALTER COLUMN props NVARCHAR(MAX);
ALTER TABLE WikiPage ALTER COLUMN content NVARCHAR(MAX);
ALTER TABLE WSRP_WSRPConsumer ALTER COLUMN wsdl NVARCHAR(MAX);
ALTER TABLE WSRP_WSRPConsumer ALTER COLUMN registrationContextString NVARCHAR(MAX);