-
Bug
-
Resolution: Unresolved
-
Major
-
6.0.0.M4
-
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.