1 Reply Latest reply on Jan 12, 2011 5:49 AM by aeternitas

    java.lang.NoSuchFieldError: STRING

    ohmygod

      Running jbpm 3.1.4 and following error reports when running to

      sessionFactory = getConfiguration().buildSessionFactory();

       

      Any idea?  In Jboss 6.0.0.CR1. Let me know if you want more details.

       

      17:19:07,484 ERROR [STDERR] Exception in thread "Thread-46" java.lang.NoSuchFieldError: STRING
      17:19:07,484 ERROR [STDERR]     at org.jbpm.identity.hibernate.PermissionUserType.<clinit>(PermissionUserType.java:44)
      17:19:07,484 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      17:19:07,484 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      17:19:07,484 ERROR [STDERR]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      17:19:07,484 ERROR [STDERR]     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      17:19:07,484 ERROR [STDERR]     at java.lang.Class.newInstance0(Class.java:355)
      17:19:07,484 ERROR [STDERR]     at java.lang.Class.newInstance(Class.java:308)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.type.TypeFactory.customComponent(TypeFactory.java:144)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.type.TypeFactory.customComponent(TypeFactory.java:135)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.type.TypeFactory.byClass(TypeFactory.java:95)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.type.TypeResolver.heuristicType(TypeResolver.java:130)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:297)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:290)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.mapping.Collection.validate(Collection.java:313)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.mapping.Set.validate(Set.java:42)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.cfg.Configuration.validate(Configuration.java:1336)
      17:19:07,484 ERROR [STDERR]     at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1835)
      17:19:07,484 ERROR [STDERR]     at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)

        • 1. java.lang.NoSuchFieldError: STRING
          aeternitas

          just yesterday got the same exception. I even updated my jbpm to last available stable version (3.2.9), but that was not a reason. The reason was quite simple: jbpm 3.2.9 was buil against Hibernate 3.2.4, and JBoss 6 Final uses Hibernate 3.6.0. This is what I did to fix the issue:

           

          1) I took jbpm-distribution-3.2.9-installer.jar and installed it (I used Eclipse as IDE)

          2) in installation, in src folder there is jbpm-identity-sources.jar with sources, which I used to create project from

          3) resolved dependencies (created JBoss 6.0 Runtime to check jbpm identity sources agains libraries used by JBoss 6, added jbpm-jpdl.jar, and probably that's all)

          4) In Eclipse you will see few warnings ".... is deprecated"

           

          And that's the root, jbpm 3.x uses deprecated API. Issue with STRING field is that PermissionUserType uses depricated field STRING from Hibernate class, change it to StandardBasicTypes.STRING (org.hibernate.type.StandardBasicTypes). And there will be one more "deprecated" issue related to sessionFactory.evict method in IdentitySessionFactory class. I just found in Internet where to switch -> sessionFactory.getCache().evictEntityRegion.

          Seems that's all, I built new jar and out it to my project, everything works well.

           

          Hope it helps (if you still need it, cause one month was passed...)

           

          PS. Maybe you need also this information - at least written where to get last build, what to change in configuration (I already had it), and how to change enterprise.jar (I don't use it, so I didn't do it).