6 Replies Latest reply on Apr 5, 2017 8:41 AM by Hemanth K

    How to use third party JARs in Wildfly 8.2 during runtime.

    D P Apprentice

      Our application's EAR has War file for web application and JAR for EJB module. It uses apache, struts, json, pdf, xmls, etc dependencies from external directories (not part of code base).

      Currently these dependencies configured in run.bat using classpath references. It works find with JBoss 4.0.3 server.

       

      Can I refer these external JARs same way in wildfly.

       

      Thanks,

        • 1. Re: How to use third party JARs in Wildfly 8.2 during runtime.
          James Livingston Apprentice

          You can put them all in a module, and add the reference to jboss-deployment-structure.xml, or an EE subsystem global module (if you want them available to all applications.

           

          See https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly

          • 2. Re: How to use third party JARs in Wildfly 8.2 during runtime.
            D P Apprentice

            Is it possible to set all these dependencies in classpath before starting Wildfly server.

            • 3. Re: How to use third party JARs in Wildfly 8.2 during runtime.
              James Livingston Apprentice

              There is no "classpath" as such. Earlier versions of JBoss, some other EE servers and Tomcat use hierarchical classloading, where adding libraries to the initialclassloader would make them available everywhere. Wildfly uses modular classloading (as OSGi does too), so adding things to the initial classloader does not make them available everywhere.

               

              If you want the libraries available to all applications, you need to create a module and add it to the EE subsystem global modules list.

              1 of 1 people found this helpful
              • 4. Re: How to use third party JARs in Wildfly 8.2 during runtime.
                D P Apprentice

                Sorry for late reply.

                 

                Its working after creating a module and adding it to the EE subsystem global modules list.

                 

                Thanks

                • 5. Re: How to use third party JARs in Wildfly 8.2 during runtime.
                  ricardo matos Newbie

                  Hey D P.

                   

                  I'm running into the same exact problem: importing 3rdparty libs such as eclipse paho, milo, vert.x ...

                   

                  Can you make a brief explaination of your procedure?

                   

                  Thank you very much!

                  merry xmas,

                   

                  Ricardo

                  • 6. Re: How to use third party JARs in Wildfly 8.2 during runtime.
                    Hemanth K Newbie

                    Hi James,

                                     I have created Modules and added module dependencies for my subsystem. I get an error when trying to connect to a Business Objects system from my ejb submodule using 50+ jar files and windowsAD. I added all the jar files to one module and referenced that in the jboss-deployment-structure.xml file. Below is the error message I get.

                     

                    2017-04-05 03:25:33,614 DS_Worker-6 ERROR [stderr                                                      ] java.lang.ClassCastException: class sun.security.provider.ConfigFile

                    2017-04-05 03:25:33,614 DS_Worker-6 ERROR [stderr                                                      ] at java.lang.Class.asSubclass(Class.java:3404)

                    2017-04-05 03:25:33,614 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.Configuration$2.run(Unknown Source)

                    2017-04-05 03:25:33,615 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.Configuration$2.run(Unknown Source)

                    2017-04-05 03:25:33,615 DS_Worker-6 ERROR [stderr                                                      ] at java.security.AccessController.doPrivileged(Native Method)

                    2017-04-05 03:25:33,615 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.Configuration.getConfiguration(Unknown Source)

                    2017-04-05 03:25:33,615 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.LoginContext$1.run(Unknown Source)

                    2017-04-05 03:25:33,616 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.LoginContext$1.run(Unknown Source)

                    2017-04-05 03:25:33,616 DS_Worker-6 ERROR [stderr                                                      ] at java.security.AccessController.doPrivileged(Native Method)

                    2017-04-05 03:25:33,616 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.LoginContext.init(Unknown Source)

                    2017-04-05 03:25:33,616 DS_Worker-6 ERROR [stderr                                                      ] at javax.security.auth.login.LoginContext.<init>(Unknown Source)

                    2017-04-05 03:25:33,616 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.plugin.authentication.secwinad.internal.SecWinADAuthentication.startKerbLogin(SecWinADAuthentication.java:366)

                    2017-04-05 03:25:33,617 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.plugin.authentication.secwinad.internal.SecWinADAuthentication.startLogin(SecWinADAuthentication.java:161)

                    2017-04-05 03:25:33,617 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.occa.security.internal.LogonService.doLogon(LogonService.java:987)

                    2017-04-05 03:25:33,617 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:884)

                    2017-04-05 03:25:33,617 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.occa.security.internal.LogonService.doUserLogon(LogonService.java:815)

                    2017-04-05 03:25:33,617 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.occa.security.internal.LogonService.userLogon(LogonService.java:211)

                    2017-04-05 03:25:33,618 DS_Worker-6 ERROR [stderr                                                      ] at com.crystaldecisions.sdk.occa.security.internal.SecurityMgr.userLogon(SecurityMgr.java:177)

                     

                    I see that javax.security.auth.login is contained in rt.jar file from java and I thought the subdeployment was not able to read that and added that to a new module and still get the above error.

                     

                    Thanks,

                    Hemanth K