运行 life ray 上的服务生成器发出

Issue while running the service builder on life ray

参考以下教程,https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/generating-your-service-layer-liferay-portal-6-2-dev-guide-04-en我已经创建并部署了服务生成器。现在视图页面按预期显示,单击添加位置按钮时,新表单显示相应的字段,我正在输入一些数据并尝试保存数据。保存时(点击保存按钮)出现错误,日志如下,

15:45:10,445 ERROR [RuntimePageImpl-14][JDBCExceptionReporter:82] invalid ORDER BY expression
15:45:10,529 ERROR [RuntimePageImpl-14][BasePersistenceImpl:244] Caught unexpected exception org.hib
ernate.exception.SQLGrammarException
15:45:10,530 ERROR [RuntimePageImpl-14][EventLocalServiceImpl:168] null
com.liferay.portal.kernel.exception.SystemException: org.hibernate.exception.SQLGrammarException: co
uld not execute query
        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePers
istenceImpl.java:251)
        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.findWithDynamicQuery(Base
PersistenceImpl.java:144)
        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.countWithDynamicQuery(Bas
ePersistenceImpl.java:105)
        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.countWithDynamicQuery(Bas
ePersistenceImpl.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:320
)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:183)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:150)
        at com.liferay.portal.dao.shard.advice.ShardPersistenceAdvice.invoke(ShardPersistenceAdvice.
java:54)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationIn
terceptor.java:90)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy471.countWithDynamicQuery(Unknown Source)
        at com.rivetlogic.event.service.impl.EventLocalServiceImpl.getUpcomingEventsCount(EventLocal
ServiceImpl.java:166)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvoca
tion.java:115)
        at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransacti
onExecutor.java:62)
        at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionIntercepto
r.java:51)
        at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvoca
tion.java:111)
        at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:175)
        at $Proxy470.getUpcomingEventsCount(Unknown Source)
        at com.rivetlogic.event.service.EventLocalServiceUtil.getUpcomingEventsCount(EventLocalServi
ceUtil.java:349)
        at org.apache.jsp.html.eventManagementPortlet.view_jsp._jspService(view_jsp.java:420)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilt
erChain.java:116)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.ja
va:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
        at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.ja
va:331)
        at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.jav
a:112)
        at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:371)
        at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:387)
        at com.liferay.util.bridges.mvc.MVCPortlet.doView(MVCPortlet.java:144)
        at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:213)
        at com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:323)
        at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
        at com.rivetlogic.event.portlet.EventsManagementPortlet.render(EventsManagementPortlet.java:
220)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilt
erChain.java:116)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.ja
va:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:583)
        at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656)
        at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362)
        at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java
:1233)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:5
7)
        at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequ
estDispatcherWrapper.java:78)
        at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequest
DispatcherWrapper.java:53)
        at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655)
        at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138)
        at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrappe
r.java:141)
        at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrappe
r.java:126)
        at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:1
56)
        at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:
125)
        at com.liferay.portal.layoutconfiguration.util.PortletRenderer.access(PortletRenderer.java
:107)
        at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCal
l(PortletRenderer.java:180)
        at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCal
l(PortletRenderer.java:1)
        at com.liferay.portal.kernel.executor.CopyThreadLocalCallable.call(CopyThreadLocalCallable.j
ava:69)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExe
cutor.java:682)
        at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor
.java:593)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        at org.hibernate.loader.Loader.doList(Loader.java:2545)
        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.liferay.portal.dao.orm.hibernate.DynamicQueryImpl.list(DynamicQueryImpl.java:94)
        at com.liferay.portal.dao.orm.hibernate.DynamicQueryImpl.list(DynamicQueryImpl.java:88)
        at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.findWithDynamicQuery(Base
PersistenceImpl.java:141)
        ... 91 more
Caused by: java.sql.SQLException: invalid ORDER BY expression
        at org.hsqldb.jdbc.Util.sqlException(Util.java:232)
        at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(JDBCPreparedStatement.java:3893)
        at org.hsqldb.jdbc.JDBCConnection.prepareStatement(JDBCConnection.java:643)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:162)

        at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocatio
nHandler.invoke(LazyConnectionDataSourceProxy.java:376)
        at $Proxy4.prepareStatement(Unknown Source)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
        at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
        at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)
        at org.hibernate.loader.Loader.doQuery(Loader.java:801)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
        at org.hibernate.loader.Loader.doList(Loader.java:2542)
        ... 99 more

我是否遗漏了任何配置?我需要在任何配置文件中添加任何数据源吗?为什么我会遇到上述问题有什么建议吗?

Caused by: java.sql.SQLException: invalid ORDER BY expression
        at org.hsqldb.jdbc.Util.sqlException(Util.java:232)
        at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(JDBCPreparedStatement.java:3893)
        at org.hsqldb.jdbc.JDBCConnection.prepareStatement(JDBCConnection.java:643)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.prepareStatement(NewProxyConnection.java:162)

从上面的异常来看,它看起来像 无效的 ORDER BY 表达式,所以您的查询出了问题。 您能否提供您正在使用的 示例查询service.xml 代码?