10 Replies Latest reply on Feb 21, 2012 5:52 PM by ctomc

    Problem in AS 7 not having server/xxx/lib directory

    mboul

      We have an ear deployment with ear/lib and war/web-inf/lib directories containing most of the external jars used by our application. But, since we run in production, company policy requires us to have some jars and .properties files to be located in the server_inscance/lib directory because developers don't have access to production and production personnel modifies some settings themselves. I have no choice but to have an external folder that will be part of classpath when the server starts up because those files won't be part of the deployment. Not everything can become a module. So, how can I deploy my application on jboss 7 without creating external modules from lots of external jars and property files that used to be in the server_instance/lib directory.

        • 1. Re: Problem in AS 7 not having server/xxx/lib directory
          gonne

          Have a look at this thread: http://community.jboss.org/message/617442#617442

           

          Kind regards,

          Gonne

          • 2. Re: Problem in AS 7 not having server/xxx/lib directory
            mboul

            Thanks a lot for your help. It seems like this will help us out of this AS 7 mess. I don't think these guys ever think about corporate clients and corporate deployments.

            • 3. Re: Problem in AS 7 not having server/xxx/lib directory
              alesj

              I don't think these guys ever think about corporate clients and corporate deployments.

              A? Not really a fair statement ...

               

              What's different from putting your lib into server/lib or

              modifying (or even hacking) some existing module?

               

              Not to mention the ease of creating a new module and ref it.

              • 4. Re: Problem in AS 7 not having server/xxx/lib directory
                brandondash


                What's different from putting your lib into server/lib or

                modifying (or even hacking) some existing module?

                 

                Not to mention the ease of creating a new module and ref it.

                 

                Easy answer:

                -- One requires dragging and dropping files into a directory. This (a) takes about 5 seconds, and (b) is the way libraries have been handled as long as Java has been around.

                -- The other requires hours of research to understand a fundamentally different way of doing things from every other version of JBAS.

                 

                Look, I'm sure the module system works swimmingly, but in the dozen or so threads I've read discussing this issue I have yet to see ONE good justification for dumping the old system. All I see in every thread is "why not do it the new way?" I'm sorry, but that simply isn't a good enough answer. Is it faster? Is it less likely to crash? It certainly isn't more intuitive!

                 

                Many of us developers have to spend ungodly amounts of  time just to keep up with all the changes INSIDE OUR OWN APPS. It has left a sour taste in my mouth that I now have to spend more time learning a fix for something that wasn't broken.

                 

                I don't expect a productive response since this was not a productive post, but in the future please do not equate the ease of using a lib directory to the time it takes to learn the module system from scratch.

                1 of 1 people found this helpful
                • 5. Re: Problem in AS 7 not having server/xxx/lib directory
                  mboul

                  That was exactly my frustration with jboss 7. Because of that we probably will never move to it. Currently running jboss 5.1 that probably will be the last jboss. It seems like these guys are on the wrong track. They can never make full java ee 6 compliant production server when java ee 7 is on its way. On top of that this new module vs lib difference. Instead of focusing to complete full java ee 6 certified server they spend time on the wrong priorities fixing something that worked like a charm before.

                  • 6. Re: Problem in AS 7 not having server/xxx/lib directory
                    ctomc

                    Hi,

                     

                    On top of that this new module vs lib difference. Instead of focusing to complete full java ee 6 certified server they spend time on the wrong priorities fixing something that worked like a charm before.

                     

                    The biggest problems in previous version of AS ware all classpath based becuse of "big pool of mud" problems in classpath approach.

                    Nothing actually worked like a charm, Ales can testify to this as he wrote classloader for as5 and 6. big part of this classpath problem added to long boot of application server.

                     

                    Java 8 is bringing project jigsaw which is actually modularized of java. Jboss modules is what as7 uses and uses quite similar principle that java 8 will bring.

                     

                    As for EE7 goes you can see in spec that is shaping up, that app servers will have to provide modular classloader system. But as it looks EE7 will be out much earlier than java SE8 will be done.

                    If you look at it from this prospective you will see that AS7 is a big step into future.

                     

                    Maybe the first look of migration to as7 looks like lots of work as you are used to big server\lib(had same problem myself) , but when you get the grip of it you will see that actually solves lots of problems that now cannot occur and you can have predictable behavior.

                    Maybe one trick you can do is create one module and put all of your jars into it and then just reference it in your application, besides writing the xml descriptor of module there is not much more work than it used to be.

                     

                    I would recommend some general reading on this subject

                    http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/

                    http://tech.puredanger.com/2009/06/04/javaone-jigsaw/

                    http://www.slideshare.net/arungupta1/the-java-ee-7-platform-developing-for-the-cloud-fisl-12

                     

                    --

                    tomaz

                    • 7. Re: Problem in AS 7 not having server/xxx/lib directory
                      brandondash

                      Now THAT is an answer. Do us all a favor and put your response as the preamble to the Modules section of the documentation, and DEFINITELY put it in the Migration section.

                      Maybe one trick you can do is create one module and put all of your jars into it and then just reference it in your application, besides writing the xml descriptor of module there is not much more work than it used to be.

                      On topic, this is the best and most straightforward response to the OP. Thanks!

                      • 8. Re: Problem in AS 7 not having server/xxx/lib directory
                        kazaag

                        The module system is a clear improvement on the manageability of the system.  The unique lib folder method lead to lot of jar version hell leading production to have a different lib folder and then a different application server for each ear/war.  So every time a server need to be set up operation need to get the app zip the correct lib content and the correct ear/war (in my experience dev need to provide the correct modified JBoss package, making operation scaling over several application impossible).

                         

                        If you put the needed external jar and configuration file in a different module, the corresponding ear/war can reference the correct module name.  This way operation will need the standard app server archive put the correct module and ear/war.  They can even put several module/ear/war couple in the same server without any incompatibility concerns.  This is a HUGE improvement.

                         

                        In a cloud Paas environment the lib folder method is simply impossible...

                         

                        Yes this change will requirer some review dev/operation procedure (and intercomunication between the teams; not the easies thing), but you better start now step by step than having to go to the clouded environment (private or public) in one giant step.

                        • 9. Re: Problem in AS 7 not having server/xxx/lib directory
                          brandondash

                          Tangential question... since the "lib directory" paradigm has gone away in favor of modules, why does standalone.bat still have it as part of it's endorsed dirs?

                          • 10. Re: Problem in AS 7 not having server/xxx/lib directory
                            ctomc

                            Endorsed dir is jvm thingy that supports overriding jdk provided classes with your own.

                            As jvm itself does not have support for modular classloader yet, this lib must still remain.

                             

                            for more see http://docs.oracle.com/javase/6/docs/technotes/guides/standards/index.html

                             

                            --

                            tomaz