Hello, I am studing JPA ,but met some problems.Followings are the background. JPA : activiti-jpa-pu, no domain model is used. main error message:Entity does not exist: example.Point - 1 There is one entity in the DB,but after the program aborted,the item is deleted from the Table. Anybody can help me? Thanks in advance.
import java.io.Serializable; import javax.persistence.*; @Entity @Table(name="POINT") public class Point implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue private long id; private int x; private int y; public Point() { } Point(int x, int y) { this.x = x; this.y = y; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public int getX() { return x; } public int getY() { return y; } public void setY(int y){ this.y = y; } public void setX(int x){ this.x = x; } }
4 Main function fragments Point Pt = new Point(0,0); Pt.setId((long)1); Variables.put("POINT",Pt);
5 One entity has existed in the DB before the program started. But after the program aborted, the entity was deleted from the DB.
6 Console messages:2012-5-21 16:17:17 org.activiti.engine.impl.interceptor.CommandContext close 严重: Error while closing command context org.activiti.engine.ActivitiException: Error while evalutaing expression at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:61) at org.activiti.engine.impl.bpmn.behavior.ServiceTaskExpressionActivityBehavior.execute(ServiceTaskExpressionActivityBehavior.java:39) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:65) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:115) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:365) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:102) at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:51) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44) at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36) at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:46) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:45) at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56) at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:77) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:530) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:525) at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:319) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:72) at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:31) at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42) at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:54) at example.Test.main(Test.java:91) Caused by: org.activiti.engine.ActivitiException: Entity does not exist: example.Point - 1 at org.activiti.engine.impl.variable.JPAEntityMappings.findEntity(JPAEntityMappings.java:130) at org.activiti.engine.impl.variable.JPAEntityMappings.getJPAEntity(JPAEntityMappings.java:119) at org.activiti.engine.impl.variable.JPAEntityVariableType.getValue(JPAEntityVariableType.java:77) at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.getValue(VariableInstanceEntity.java:158) at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.getVariable(VariableScopeImpl.java:93) at org.activiti.engine.impl.el.VariableScopeElResolver.getValue(VariableScopeElResolver.java:65) at org.activiti.engine.impl.javax.el.CompositeELResolver.getValue(CompositeELResolver.java:231) at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:81) at org.activiti.engine.impl.juel.AstMethod.invoke(AstMethod.java:79) at org.activiti.engine.impl.juel.AstMethod.eval(AstMethod.java:75) at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50) at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26) at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114) at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33) at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:3error end! 7) at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25) at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50) … 58 more