3 Replies Latest reply on Apr 11, 2017 4:44 PM by Harry Reid

    Not able to read all the classes of an external jar file.

    Harry Reid Newbie

      Hi,

            I have created a module with all the external jar files and added the module as a dependency in the ejb jar file. I get the below error during run time when I call a class from my ejb jar file.

       

      2017-04-10 16:39:42,268 ECDS_Worker-8 WARN  [org.jboss.modules                                           ] Failed to define class com.crystaldecisions.thirdparty.com.ooc.OB.TenantCategoryPolicy_impl in Module "com.bo41.ebus:main" from local module loader @629f0666 (finder: local module finder @1bc6a36e

      (roots: G:\DEV\wildfly-10.1.0.Final\modules,G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base\.overlays\base-wildfly-picketlink-patch,

      G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base\.overlays\base-wildfly-dom4j-patch,G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base))

      java.lang.NoClassDefFoundError: Failed to link com/crystaldecisions/thirdparty/com/ooc/OB/TenantCategoryPolicy_impl (Module "com.bo41.ebus:main" from local module loader @629f0666

      (finder: local module finder @1bc6a36e (roots: G:\DEV\wildfly-10.1.0.Final\modules,G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base\.overlays\base-wildfly-picketlink-patch,

      G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base\.overlays\base-wildfly-dom4j-patch,G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base))):

      Failed to link com/crystaldecisions/thirdparty/com/ooc/OB/TenantCategoryPolicy (Module "com.bo41.ebus:main" from local module loader @629f0666 (finder: local module finder @1bc6a36e

      (roots: G:\DEV\wildfly-10.1.0.Final\modules,G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base\.overlays\base-wildfly-picketlink-patch,

      G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base\.overlays\base-wildfly-dom4j-patch,G:\DEV\wildfly-10.1.0.Final\modules\system\layers\base))): org/omg/CORBA/portable/IDLEntity

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

        at java.lang.reflect.Constructor.newInstance(Unknown Source)

        at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:446)

        at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:274)

        at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:78)

        at org.jboss.modules.Module.loadModuleClass(Module.java:606)

        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

        at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initializeDefaultPolicies(ORB_impl.java:369)

        at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initialize(ORB_impl.java:196)

        at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.setParameters(ORB_impl.java:804)

        at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.init(ORB_impl.java:1305)

        at com.crystaldecisions.enterprise.ocaframework.idl.helper.ORBHelper.init(ORBHelper.java:57)

        at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.<init>(ServiceMgr.java:383)

        at com.crystaldecisions.enterprise.ocaframework.ServiceMgrFactory.getServiceMgr(ServiceMgrFactory.java:66)

        at com.crystaldecisions.sdk.occa.security.internal.LogonService.ensureServiceStub(LogonService.java:651)

        at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:838)

        at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:815)

        at com.crystaldecisions.sdk.occa.security.internal.LogonService.userLogon(LogonService.java:211)

        at com.crystaldecisions.sdk.occa.security.internal.SecurityMgr.userLogon(SecurityMgr.java:177)

        at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody0(SessionMgr.java:454)

        at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon_aroundBody1$advice(SessionMgr.java:512)

        at com.crystaldecisions.sdk.framework.internal.SessionMgr.logon(SessionMgr.java:1)

       

       

      TenantCategoryPolicy_impl  class which is having a problem is located in ebus405.jar file and so as ORB_impl.  I am not sure why is it able to find the other classes in that jar but not the failing class.

       

      Any help is appreciated.

        • 1. Re: Not able to read all the classes of an external jar file.
          Tomaz Cerar Master

          did you add appropriate depenancies to your module?

           

          looks like your are missing dependency to module org.omg.api

          1 of 1 people found this helpful
          • 2. Re: Not able to read all the classes of an external jar file.
            Harry Reid Newbie

            Hi Tomaz,

                                As per your suggestion I added org.omg.api in the dependencies, but still got the same error.

             

            Caused by: java.lang.NoClassDefFoundError: com/crystaldecisions/thirdparty/com/ooc/OB/TenantCategoryPolicy_impl

              at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initializeDefaultPolicies(ORB_impl.java:369)

              at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.initialize(ORB_impl.java:196)

              at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.setParameters(ORB_impl.java:804)

              at com.crystaldecisions.thirdparty.com.ooc.OBCORBA.ORB_impl.init(ORB_impl.java:1305)

              at com.crystaldecisions.enterprise.ocaframework.idl.helper.ORBHelper.init(ORBHelper.java:57)

              at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.<init>(ServiceMgr.java:402)

             

            What I do not understand is all the above classes are in on jar file ebus405.jar and why is my app able to access only some of the classes during run time.

             

            Thanks

            HR

            • 3. Re: Not able to read all the classes of an external jar file.
              Harry Reid Newbie

              HI Tomaz,

                                I am not sure why but I moved ecbus405.jar out from the rest of the jar file and added this module as dependent module in my main module as below.

               

              <dependencies>

                        <module name="bo.ebus405" export="true"/>

              </dependencies>

               

              Also In my bo.ebus405 module I added dependencies for org.omg.api as below

               

              <?xml version="1.0" encoding="UTF-8"?>

              <module xmlns="urn:jboss:module:1.3" name="bo.ebus405">

                     <resources>

                      <resource-root path="ebus405.jar"/>

                  </resources>

                 <dependencies>

                       <module name="org.omg.api"/> 

              </dependencies>

              </module>

               

              Finally I was able to get thru the errors. Thank you for your help.