Drools 流持久性 - 未找到命名查询:ProcessInstancesWaitingForEvent

发布于 2024-11-01 04:41:48 字数 9677 浏览 6 评论 0原文

我在 drools 流持久性(MySQL)方面遇到问题,出现以下异常:

2011-04-15 14:38:27,244 INFO  [STDOUT] (http-0.0.0.0-8000-5) Hibernate: insert into ProcessInstanceInfo (externalVariables, lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?, ?)

2011-04-15 14:38:27,244 INFO  [STDOUT] (http-0.0.0.0-8000-5) Hello World

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5) java.lang.RuntimeException: Could not commit session

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:193)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:184)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at com.servlet.Servlet.doGet(Servlet.java:101)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at java.lang.Thread.run(Thread.java:619)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5) Caused by: java.lang.IllegalArgumentException: Named query not found: ProcessInstancesWaitingForEvent

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:455)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.processinstance.JPASignalManager.getProcessInstancesForEvent(JPASignalManager.java:32)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.processinstance.JPASignalManager.signalEvent(JPASignalManager.java:21)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:270)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.nodeInstanceCompleted(WorkflowProcessInstanceImpl.java:421)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.EndNodeInstance.internalTrigger(EndNodeInstance.java:62)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:178)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:144)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:62)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:58)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:178)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:144)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:32)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:192)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1644)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:306)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:99)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:38)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:279)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    ... 24 more

我到处都读到必须将 orm.xml 文件放置在我的 META-INF 文件夹中(我已经这样做了),其中包含以下内容:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
               version="1.0">
      <named-query name="ProcessInstancesWaitingForEvent">
          <query>
select
    processInstanceInfo.processInstanceId
from
    ProcessInstanceInfo processInstanceInfo
where
    :type in elements(processInstanceInfo.eventTypes)
          </query>
      </named-query>
</entity-mappings>

但它仍然抛出该异常,您可以在我昨天问的上一个问题中查看我的配置文件, 这里

这让我发疯,任何帮助或想法表示赞赏。

I have a problem with drools flow persistence (MySQL), I get the following exception:

2011-04-15 14:38:27,244 INFO  [STDOUT] (http-0.0.0.0-8000-5) Hibernate: insert into ProcessInstanceInfo (externalVariables, lastModificationDate, lastReadDate, processId, processInstanceByteArray, startDate, state, OPTLOCK) values (?, ?, ?, ?, ?, ?, ?, ?)

2011-04-15 14:38:27,244 INFO  [STDOUT] (http-0.0.0.0-8000-5) Hello World

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5) java.lang.RuntimeException: Could not commit session

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:292)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:193)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.impl.CommandBasedStatefulKnowledgeSession.startProcess(CommandBasedStatefulKnowledgeSession.java:184)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at com.servlet.Servlet.doGet(Servlet.java:101)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at java.lang.Thread.run(Thread.java:619)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5) Caused by: java.lang.IllegalArgumentException: Named query not found: ProcessInstancesWaitingForEvent

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:455)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.processinstance.JPASignalManager.getProcessInstancesForEvent(JPASignalManager.java:32)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.processinstance.JPASignalManager.signalEvent(JPASignalManager.java:21)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.setState(WorkflowProcessInstanceImpl.java:270)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.nodeInstanceCompleted(WorkflowProcessInstanceImpl.java:421)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.EndNodeInstance.internalTrigger(EndNodeInstance.java:62)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:178)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:144)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.ActionNodeInstance.triggerCompleted(ActionNodeInstance.java:62)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.ActionNodeInstance.internalTrigger(ActionNodeInstance.java:58)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerConnection(NodeInstanceImpl.java:178)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:144)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:49)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:41)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:117)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:32)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:192)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:309)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1644)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:306)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:99)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.command.runtime.process.StartProcessCommand.execute(StartProcessCommand.java:38)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    at org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:279)

2011-04-15 14:38:27,244 ERROR [STDERR] (http-0.0.0.0-8000-5)    ... 24 more

I've read everywhere that a orm.xml file must be placed in my META-INF folder (which I've done) with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
               version="1.0">
      <named-query name="ProcessInstancesWaitingForEvent">
          <query>
select
    processInstanceInfo.processInstanceId
from
    ProcessInstanceInfo processInstanceInfo
where
    :type in elements(processInstanceInfo.eventTypes)
          </query>
      </named-query>
</entity-mappings>

But it still throws that exception, you can have a look at my configuration files in a previous question I asked yesterday, HERE

This is driving me crazy, any help or ideas appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄居者 2024-11-08 04:41:48

当您部署到应用程序服务器时,默认情况下它可能并不总是能够获取 META-INF 目录中的 orm.xml。解决这个问题的最佳方法通常是创建一个自定义 orm 文件(在本例中是 META-INF 目录中的 JBPMorm.xml)并将映射直接添加到 persistence.xml:

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jdbc/testDS1</jta-data-source>        
    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    ...

When you deploy to an application server, it might not always be able to pick up your orm.xml in the META-INF directory by default. The best way is to solve this is usually create a custom orm file (in this case a JBPMorm.xml in the META-INF directory) and add the mapping directly to your persistence.xml:

<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jdbc/testDS1</jta-data-source>        
    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    ...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文