You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (Updated) (JIRA)" <ji...@apache.org> on 2011/10/12 23:07:11 UTC

[jira] [Updated] (OWB-468) Make BeansDeployer.deployFromClassPath(ScannerService) resilient to ClassNotFoundException and NoClassDefFoundError's

     [ https://issues.apache.org/jira/browse/OWB-468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg updated OWB-468:
------------------------------

    Fix Version/s:     (was: 1.2.0)
                   1.1.2
         Assignee: Mark Struberg  (was: Rohit Dilip Kelapure)
    
> Make BeansDeployer.deployFromClassPath(ScannerService) resilient to ClassNotFoundException and NoClassDefFoundError's
> ---------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-468
>                 URL: https://issues.apache.org/jira/browse/OWB-468
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Core, Java EE Integration, Lifecycle
>    Affects Versions: 1.0.1, 1.0.0, 1.1.0, 1.0.0-alpha-2
>         Environment: Windows Server 2003
>            Reporter: Rohit Dilip Kelapure
>            Assignee: Mark Struberg
>             Fix For: 1.1.2
>
>         Attachments: owb-468.patch
>
>
> In tiered  classloading environments, lifecycle start --> BeansDeployer deploy --> AnnotatedElementFactory.newAnnotatedType(Class<X>) sometimes throws ClassNotFoundException and NoClassDefFoundError's from the following methods 
>   Field[] fields = SecurityUtil.doPrivilegedGetDeclaredFields(annotatedClass);
>   Method[] methods = SecurityUtil.doPrivilegedGetDeclaredMethods(annotatedClass);
>   These exceptions and errors are typically due to incorrect or erroneous application packaging of classes and dependencies. 
> I would like OpenWebBeans to continue loading other classes even if one/few classes cannot be loaded correctly i.e. the assumption is that we don't punish the majority for the crimes of a few. We define Managed Beans ONLY for classes that yield a AnnotatedType. 
> At runtime, if the application exercises any CDI function on the "bad" classes, then the results are indeterminate.
> I will attach a patch that will explain my approach of fixing this. 
> java.lang.NoClassDefFoundError: com.example svt.acme.AnnuityMgmt
> 	at java.lang.ClassLoader.defineClassImpl(Native Method)
> 	at java.lang.ClassLoader.defineClass(ClassLoader.java:260)
> 	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
> 	at com.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:803)
> 	at com.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:718)
> 	at com.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:541)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:612)
> 	at com.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:539)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:612)
> 	at java.lang.Class.getDeclaredMethodsImpl(Native Method)
> 	at java.lang.Class.getDeclaredMethods(Class.java:674)
> 	at org.apache.webbeans.util.SecurityUtil$PrivilegedActionForClass.run(SecurityUtil.java:137)
> 	at java.security.AccessController.doPrivileged(AccessController.java:203)
> 	at org.apache.webbeans.util.SecurityUtil.doPrivilegedGetDeclaredMethods(SecurityUtil.java:84)
> 	at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:102)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira