Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-1404

jBPM classloader does not define package information

XMLWordPrintable

      The jBPM ProcessClassLoader defines classes from within the par file but it does not define the associated package information.

      As a consequence the result of <class>.getPackage() is null and code which relies on this (such as JAXB for package annotations) will not work.

      A simple fix would be to add the following to the findClass method although it should be noted that this ignores the manifest/sealing information.

      if (fileDefinition!=null) {
      // Add the package information
      final int packageIndex = name.lastIndexOf('.') ;
      if (packageIndex != -1) {
      final String packageName = name.substring(0, packageIndex) ;
      final Package classPackage = getPackage(packageName) ;
      if (classPackage == null)

      { definePackage(packageName, null, null, null, null, null, null, null) ; }

      }

      With this fix in place the JAXB marshalling works as expected.

            tom.baeyens Tom Baeyens (Inactive)
            nmcl2001 Mark Little
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: