`
chourentang
  • 浏览: 56536 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

jbpm中java.lang.NoSuchFieldError: STRING 错误的解决

阅读更多
在使用jbpm3.2整合ssh时遇到了
java.lang.NoSuchFieldError: STRING at org.jbpm.identity.hibernate.PermissionUserType.错误。经过不懈努力,终于解决了。
参考文章:https://community.jboss.org/thread/159874

问题原因:jbpm3.2引用了过期的方法

问题解决:参考文章中给出的解决方法是修改jbpm-identity.jar并重新打包为jar文件替换原有的jbpm-identity.jar.
但是我在打包出现了错误,于是我采用的方法是将重新编译的class文件替换原有的class文件:
1.在北风oa项目中建立一个org.jbpm.identity.hibernate包将jbpm-jpdl-3.2.3\src\identity\org\jbpm\identity\hibernate包中的代码复制到其中
2.修改IdentitySessionFactory.java和PermissionUserType.java类
  1)将org/jbpm/identity/hibernate/IdentitySessionFactory中
javaevictCachedIdentities()方法里面的evict 全改为getCache().evictEntityRegion(有3处)
  public void evictCachedIdentities() {
    sessionFactory.getCache().evictEntityRegion(User.class);
    sessionFactory.getCache().evictEntityRegion(Membership.class);
    sessionFactory.getCache().evictEntityRegion(Group.class);
  }

   2)在org/jbpm/identity/hibernate/PermissionUserType.java中将Hibernate.STRING改为StandardBasicTypes.STRING(有3处)
  private static final Type[] PROPERTY_TYPES = new Type[]{StandardBasicTypes.STRING, 
	  StandardBasicTypes.STRING, StandardBasicTypes.STRING};
  public Type[] getPropertyTypes() {
    return PROPERTY_TYPES;
  }

3.将北风oa项目导出为jar文件,将其中的IdentitySessionFactory.class和PermissionUserType.class替换原jbpm-identity.jar中相同名字的文件
4.将修改后的的jbpm-identity.jar替换项目中的jbpm-identity.jar
重新运行项目便不会在出现错误。
如果需要修改后的jbpm-identity.jar后面我上传了,需要的话请下载。


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics