JBPM(四)---SSH框架整合JBPM

jar包引入
如果没有使用maven,为防止jar包冲突,需要将JBPM中多余的jar包删除,如:
cglib.jar
commons-collections.jar
commons-logging.jar
freemarker.jar
hibernate-core.jar
hsqldb.jar
javassist.jar
jta.jar
junit.jar
log4j.jar
mail.jar
mysql-connector-java.jar
等。

如果使用maven坐标导入jar包
pom坐标:


		
		
			Jboss-JBPM-Repositories
			JbossJBPM
			https://repository.jboss.org/nexus/content/repositories/releases
		

	

		
			org.jbpm.jbpm4
			jbpm-api
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-jpdl
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-pvm
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-log
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-bpmn
			4.4
		 

配置文件整合

将JBPM解压目录下examples/src/jbpm.cfg.xml 复制到resources
替换掉jbpm.cfg.xml 文件中的

建立JBPM18张表,在spring配置文件 applicationContext-common.xml 引入 hbm


		
			
				jbpm.repository.hbm.xml
				jbpm.execution.hbm.xml
				jbpm.history.hbm.xml
				jbpm.task.hbm.xml
				jbpm.identity.hbm.xml
			
		

修改 mysql方言 : org.hibernate.dialect.MySQL5InnoDBDialect

在spring配置文件中配置processEngine


	
	  
	

  	

整合常见错误:
1.发布流程时报Caused by: java.lang.ClassNotFoundException:
javax.mail.Message$RecipientType
解决方式:JBPM 运行,需要依赖 javamail的 jar 包

		
		
			javax.mail
			mail
			1.4
		

2.将JBPM整合后项目,在tomcat运行起来报javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method “javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;” the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/index_jsp, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature

原因: jar包冲突
Juel-api.jar 和 tomcat中el-api.jar 冲突

如果是外部Tomcat,解决方法: 将juel三个jar包放入tomcat /lib 下替换 el-api.jar
删除原来项目中 juel三个jar 包

使用maven内置Tomcat,解决方法:
将工程内部 juel三个jar 包 设置 provided


  	
  		
  			juel
  			juel-api
  			2.2.1
  			provided
  		
  		
  			juel
  			juel-impl
  			2.2.1
  			provided
  		
  		
  			juel
  			juel-engine
  			2.1.0
  			provided
  		
  	

在内置tomcat中 引入juel的jar 包

				
				
					
						de.odysseus.juel
						juel-api
						2.2.6
					
					
						de.odysseus.juel
						juel-impl
						2.2.6
					
				

3.slf4j 日志冲突错误 ,slf4j-log4j 和 slf4j-jdk 冲突


			org.jbpm.jbpm4
			jbpm-pvm
			4.4
			
				
					slf4j-jdk14
					org.slf4j
				
			
		


pom.xml示例:


	4.0.0
	com.my.bos
	mavenbos
	0.0.1-SNAPSHOT
	war
	mavenbos
	
		
		
			Jboss-JBPM-Repositories
			JbossJBPM
			https://repository.jboss.org/nexus/content/repositories/releases
		
	
	
		
		
			org.springframework
			spring-context
			3.2.0.RELEASE
		
		
			org.springframework
			spring-orm
			3.2.0.RELEASE
		
		
			org.springframework
			spring-aspects
			3.2.0.RELEASE
		
		
			org.springframework
			spring-web
			3.2.0.RELEASE
		
		
			org.springframework
			spring-test
			3.2.0.RELEASE
		
		
		
			org.apache.struts
			struts2-core
			2.3.7
		
		
			org.apache.struts
			struts2-json-plugin
			2.3.7
		
		
			org.apache.struts
			struts2-spring-plugin
			2.3.7
		
		
		
			org.hibernate
			hibernate-core
			3.6.10.Final
		
		
		
			org.hibernate.javax.persistence
			hibernate-jpa-2.0-api
			1.0.1.Final
		
		
		
			javax.servlet
			servlet-api
			2.5
			provided 
		
		
			javax.servlet
			jsp-api
			2.0
			provided
		
		
		
			org.slf4j
			slf4j-log4j12
			1.7.2
		
		
			log4j
			log4j
			1.2.16
		
		
		
			c3p0
			c3p0
			0.9.1.2
		
		
		
			mysql
			mysql-connector-java
			5.1.6
		
		
		
			junit
			junit
			4.9
			test 
		
		
		
			pinyin4j
			pinyin4j
			1.0
			D:\work\javaee20130711\mavenbos\src\main\webapp\WEB-INF\lib\pinyin4j-2.5.0.jar
			system
		
		
		
			org.apache.poi
			poi
			3.9
		
		
		
			com.caucho
			hessian
			4.0.33
		
		
		
			org.jbpm.jbpm4
			jbpm-api
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-jpdl
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-pvm
			4.4
			
				
					slf4j-jdk14
					org.slf4j
				
			
		
		
			org.jbpm.jbpm4
			jbpm-log
			4.4
		
		
			org.jbpm.jbpm4
			jbpm-bpmn
			4.4
		
		
		
			javax.mail
			mail
			1.4
		
	
	
		
		mavenbos
		
			
				maven-compiler-plugin
				
					1.6
					1.6
				
			
			
			
				org.codehaus.mojo
				tomcat-maven-plugin
				1.1
				
					
					9090
					
					http://localhost:8080/manager/text
					myserver
				
				
				
					
						de.odysseus.juel
						juel-api
						2.2.6
					
					
						de.odysseus.juel
						juel-impl
						2.2.6
					
				
			
		
	
	
		
			
				juel
				juel-api
				2.2.1
				provided
			
			
				juel
				juel-impl
				2.2.1
				provided
			
			
				juel
				juel-engine
				2.1.0
				provided
			
		
	

你可能感兴趣的:(JBPM)