Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8310

Optional dependencies that are not present for classes in a bean archive can cause the deployment to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • No Release
    • 6.0.0.M4
    • Weld/CDI
    • None

      If you have a class with optional dependencies that are not present in a bean archive it can cause the deployment to fail if these they are part of the classes external schema (i.e. method parameters or return values, field types).

      This is because the NoClassDefFoundError will not be thrown when the class is loaded, but at the first call to getMethods() or getFields(). This causes introspection to fail and the deployment will abort.

      The best solution would probably be to call getDeclaredMethods/Fields on the class and all parent classes early, so the NoClassDefFoundError can be caught and handled.

      If the optional dependency is used by the class but not part of the schema the deployment will work as expected.

              marius.bogoevici Marius Bogoevici (Inactive)
              sdouglas1@redhat.com Stuart Douglas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated: