2016-10-27 16:34:10,931 [Appian Timer - 2] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 402, SQLState: S0001 2016-10-27 16:34:10,931 [Appian Timer - 2] ERROR org.hibernate.util.JDBCExceptionReporter - The data types ntext and nvarchar(max) are incompatible in the equal to operator. 2016-10-27 16:34:25,942 [Appian Timer - 2] DEBUG org.hibernate.util.JDBCExceptionReporter - could not execute query [select count(*) as y0_ from site this_ inner join site_page p2_ on this_.id=p2_.site_id left outer join site_rm rolemapent5_ on this_.id=rolemapent5_.site_id left outer join rm_entry rolemap1_ on rolemapent5_.rm_entry_id=rolemap1_.id where p2_.visibility=?] com.microsoft.sqlserver.jdbc.SQLServerException: The data types ntext and nvarchar(max) are incompatible in the equal to operator. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1515) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:404) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:350) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:180) at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:155) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:285) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) at org.hibernate.loader.Loader.doQuery(Loader.java:802) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347) at com.appiancorp.rdbms.hb.GenericDaoHbImpl.getCountByCriteria(GenericDaoHbImpl.java:428) at com.appiancorp.sites.backend.SiteDaoHbImpl.getCountBasedOnFilter(SiteDaoHbImpl.java:132) at com.appiancorp.sites.backend.SiteDaoHbImpl.getSitesStats(SiteDaoHbImpl.java:123) at sun.reflect.GeneratedMethodAccessor827.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.appiancorp.util.MethodInvocationReflectionImpl.proceed(MethodInvocationReflectionImpl.java:23) at com.appiancorp.security.authz.AuthorizationMethodInterceptor.invoke(AuthorizationMethodInterceptor.java:54) at com.appiancorp.rdbms.hb.DataSourceManagerHbImpl$DaoInvocationHandler.invoke(DataSourceManagerHbImpl.java:355) at com.sun.proxy.$Proxy234.getSitesStats(Unknown Source) at com.appiancorp.sites.backend.SiteTemplateServiceImpl.getSitesStats(SiteTemplateServiceImpl.java:208) at sun.reflect.GeneratedMethodAccessor826.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy254.getSitesStats(Unknown Source) at com.appiancorp.common.monitoring.AggregatedDataTimer$4.run(AggregatedDataTimer.java:421) at com.appiancorp.security.auth.SpringSecurityContextHelper.runAsAdmin(SpringSecurityContextHelper.java:110) at com.appiancorp.common.monitoring.AggregatedDataTimer.timeout(AggregatedDataTimer.java:418) at com.appiancorp.common.timer.AppianTimerSystem.run(AppianTimerSystem.java:59) 2016-10-27 16:34:25,944 [Appian Timer - 2] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 402, SQLState: S0001