InputStream in = new FileInputStream("src/config.files/jbpm.cfg.xml");
ProcessDefinition processDefinition = ...;
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseInputStream(in);
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
GraphSession graphSession = jbpmContext.getGraphSession();
graphSession.deployProcessDefinition(processDefinition);
每次执行:
GraphSession graphSession = jbpmContext.getGraphSession();
的时候都会报错,看不出来哪错了,很郁闷!知道怎么回事的朋友,请帮忙解答下,谢谢!
执行结果如下:
15:23:22,593 INFO Environment : Hibernate 3.1
15:23:22,625 INFO Environment : hibernate.properties not found
15:23:22,625 INFO Environment : using CGLIB reflection optimizer
15:23:22,640 INFO Environment : using JDK 1.4 java.sql.Timestamp handling
15:23:22,812 INFO Configuration : configuring from resource: hibernate.cfg.xml
15:23:22,812 INFO Configuration : Configuration resource: hibernate.cfg.xml
15:23:23,218 INFO Configuration : Reading mappings from resource: org/jbpm/identity/User.hbm.xml
15:23:23,546 INFO HbmBinder : Mapping class: org.jbpm.identity.User -> JBPM_ID_USER
15:23:23,656 INFO HbmBinder : Mapping collection: org.jbpm.identity.User.permissions -> JBPM_ID_PERMISSIONS
15:23:23,656 INFO Configuration : Reading mappings from resource: org/jbpm/identity/Group.hbm.xml
15:23:23,781 INFO HbmBinder : Mapping class: org.jbpm.identity.Group -> JBPM_ID_GROUP
15:23:24,000 INFO HbmBinder : Mapping collection: org.jbpm.identity.Group.permissions -> JBPM_ID_PERMISSIONS
15:23:24,000 INFO Configuration : Reading mappings from resource: org/jbpm/identity/Membership.hbm.xml
15:23:24,109 INFO HbmBinder : Mapping class: org.jbpm.identity.Membership -> JBPM_ID_MEMBERSHIP
15:23:24,109 INFO HbmBinder : Mapping collection: org.jbpm.identity.Membership.permissions -> JBPM_ID_PERMISSIONS
15:23:24,109 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/ProcessDefinition.hbm.xml
15:23:24,218 INFO HbmBinder : Mapping class: org.jbpm.graph.def.ProcessDefinition -> JBPM_PROCESSDEFINITION
15:23:24,296 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/Node.hbm.xml
15:23:24,359 INFO HbmBinder : Mapping class: org.jbpm.graph.def.Node -> JBPM_NODE
15:23:24,390 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/Transition.hbm.xml
15:23:24,546 INFO HbmBinder : Mapping class: org.jbpm.graph.def.Transition -> JBPM_TRANSITION
15:23:24,546 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/Event.hbm.xml
15:23:24,609 INFO HbmBinder : Mapping class: org.jbpm.graph.def.Event -> JBPM_EVENT
15:23:24,609 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/Action.hbm.xml
15:23:24,656 INFO HbmBinder : Mapping class: org.jbpm.graph.def.Action -> JBPM_ACTION
15:23:24,703 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/SuperState.hbm.xml
15:23:24,843 INFO HbmBinder : Mapping subclass: org.jbpm.graph.def.SuperState -> JBPM_NODE
15:23:24,859 INFO Configuration : Reading mappings from resource: org/jbpm/graph/def/ExceptionHandler.hbm.xml
15:23:24,906 INFO HbmBinder : Mapping class: org.jbpm.graph.def.ExceptionHandler -> JBPM_EXCEPTIONHANDLER
15:23:24,906 INFO Configuration : Reading mappings from resource: org/jbpm/instantiation/Delegation.hbm.xml
15:23:24,968 INFO HbmBinder : Mapping class: org.jbpm.instantiation.Delegation -> JBPM_DELEGATION
15:23:25,000 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/StartState.hbm.xml
15:23:25,015 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.StartState -> JBPM_NODE
15:23:25,031 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/EndState.hbm.xml
15:23:25,203 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.EndState -> JBPM_NODE
15:23:25,203 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/ProcessState.hbm.xml
15:23:25,250 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.ProcessState -> JBPM_NODE
15:23:25,265 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/Decision.hbm.xml
15:23:25,312 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.Decision -> JBPM_NODE
15:23:25,312 INFO HbmBinder : Mapping collection: org.jbpm.graph.node.Decision.decisionConditions -> JBPM_DECISIONCONDITIONS
15:23:25,312 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/Fork.hbm.xml
15:23:25,359 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.Fork -> JBPM_NODE
15:23:25,359 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/Join.hbm.xml
15:23:25,406 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.Join -> JBPM_NODE
15:23:25,406 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/State.hbm.xml
15:23:25,500 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.State -> JBPM_NODE
15:23:25,515 INFO Configuration : Reading mappings from resource: org/jbpm/graph/node/TaskNode.hbm.xml
15:23:25,546 INFO HbmBinder : Mapping subclass: org.jbpm.graph.node.TaskNode -> JBPM_NODE
15:23:25,578 INFO Configuration : Reading mappings from resource: org/jbpm/graph/action/Script.hbm.xml
15:23:25,609 INFO HbmBinder : Mapping subclass: org.jbpm.graph.action.Script -> JBPM_ACTION
java.lang.NoClassDefFoundError: bsh/EvalError
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at org.hibernate.property.BasicPropertyAccessor.getterMethod(BasicPropertyAccessor.java:317)
at org.hibernate.property.BasicPropertyAccessor.getGetterOrNull(BasicPropertyAccessor.java:297)
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:280)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.util.ReflectHelper.getter(ReflectHelper.java:86)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:77)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
at org.hibernate.cfg.HbmBinder.createProperty(HbmBinder.java:2065)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2050)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1940)
at org.hibernate.cfg.HbmBinder.bindSubclass(HbmBinder.java:786)
at org.hibernate.cfg.HbmBinder.handleSubclass(HbmBinder.java:2111)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:117)
at org.hibernate.cfg.Configuration.add(Configuration.java:385)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:426)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:481)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1443)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1411)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1392)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1368)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1288)
at org.jbpm.db.hibernate.HibernateHelper.createConfiguration(HibernateHelper.java:90)
at org.jbpm.persistence.db.DbPersistenceServiceFactory.getConfiguration(DbPersistenceServiceFactory.java:68)
at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:217)
at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:537)
at com.sample.Deploy.main(Deploy.java:24)
Exception in thread "main"