1 Reply Latest reply on Aug 31, 2015 11:26 PM by jaikiran

    Static method from dependency aren't reachable.

    dansofinskiy

      Hello, I have module with class like this:

       

      public class Context {
         public static <T> T doLookup(String jndiName) throws JndiLookupException {
         /*...*/
        }
      } 

      ,
      which I use like context provider. This module is static (with module.xml)
      But when I call static method from another static module, I have ClassNotFoundException:

       

      Caused by: java.lang.NoClassDefFoundError: our/packag/Context
       at our.packag.AbstractTask.<init>(AbstractTask.java:36)
       at our.packag.AbstractTask.<init>(AbstractTask.java:18)
       at our.packag.ConcreteTask.<init>(ConcreteTask.java:14)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_45]
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_45]
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_45]
       at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_45] 

       

      When I make this method non-static, all works correct.

      Does classloader should load module in static case?