8 Replies Latest reply on Apr 6, 2006 2:52 PM by asack

    EAR packaging issue with classpaths and optional libraries (

    asack

      I have an EAR file packaged like this:

      my.ear:
      my.ear/META-INF/MANIFEST.MF
      my.ear/META_INF/application.xml
      my.ear/lib/ibatis-common-2.jar
      my.ear/lib/ibatis-sqlmap-2.jar
      my.ear/lib/ibatis-map-2.jar
      my.ear/my.jar

      my.jar:
      my.jar/com/blah/blah
      my.jar/META-INF/MANIFEST.MF

      my.ear's MANIFEST file has a Class-Path entry with lib/ibatis* etc. so iBatis can seen within the entire EAR deployment.

      However, now within my.jar, when I try to load a map file, I get a IOExcetion claiming iBatis can not find a map file in the current classpath.

      com.blah.org/ibatis/dao/maps/Map.xml

      Can someone please explain to me what's going on here?

      Thanks!

        • 1. Re: EAR packaging issue with classpaths and optional librari
          asack

          I would like to add taht yes, I checked, the map files are there and the correct path is specified.

          • 2. Re: EAR packaging issue with classpaths and optional librari
            asack

            Whoops, no my my.jar MANIFEST file has the reference to ibatis libaries. But either way doesn't work (I tried the first way for S&G's and that doesn't even find them).

            This is so weird...I'm using 404RC1...

            • 3. Re: EAR packaging issue with classpaths and optional librari
              asack

              Another update, no matter where I put my Map and/or Config.xml file within my.jar, I can't see it and its not on my runtime classpath.

              Has anyone experienced this before? After reading Chapter 8 more closely of the J2EE spec, putting the lib/ibatis* entries in the Class-Path MANFEST attribute of my.jar seems correct. I don't understand why though classes and files within that jar are not part of my context classpath during runtime.

              If I package this as a standalone jar file with iBatis libraries in default/lib, everything works.

              • 4. Re: EAR packaging issue with classpaths and optional librari
                starksm64

                There is a testcase for this so create a jira issue with the last version of the ear with the jars referenced by the my.jar manifest.

                http://jira.jboss.com/jira/browse/JBAS

                • 5. Re: EAR packaging issue with classpaths and optional librari
                  asack

                   

                  "scott.stark@jboss.org" wrote:
                  There is a testcase for this so create a jira issue with the last version of the ear with the jars referenced by the my.jar manifest.

                  http://jira.jboss.com/jira/browse/JBAS


                  Scott, thanks. I'm going bald and I already don't have a lot of hair...

                  I will try to do this...though I've never done this before so bare with me...this is definitely a bug in 404RC1. I'm actually going to try 404RC2 as well as 403SP1 to see if its already been addressed.

                  • 6. Re: EAR packaging issue with classpaths and optional librari
                    asack

                    This works now in 404CR2 though I'm having a rollback issue with iBatis (I'm debugging now). It definitely does not work on 403SP1. I can't believe I'm the only one running into this....maybe I'm doing something wrong though my example is simple enough...

                    • 7. Re: EAR packaging issue with classpaths and optional librari
                      asack

                       

                      "asack" wrote:
                      This works now in 404CR2 though I'm having a rollback issue with iBatis (I'm debugging now). It definitely does not work on 403SP1. I can't believe I'm the only one running into this....maybe I'm doing something wrong though my example is simple enough...


                      I lie. By default 403 was turning on EAR isolation and 404 had it off unless you really do put a checkmark during install.

                      So...now it seems that the EAR does find the XML file but iBatis can't find the config file during runtime. This may be an iBatis issue but doc says it gets it from the current Classpath.

                      • 8. Re: EAR packaging issue with classpaths and optional librari
                        asack

                         

                        "asack" wrote:
                        "asack" wrote:
                        This works now in 404CR2 though I'm having a rollback issue with iBatis (I'm debugging now). It definitely does not work on 403SP1. I can't believe I'm the only one running into this....maybe I'm doing something wrong though my example is simple enough...


                        I lie. By default 403 was turning on EAR isolation and 404 had it off unless you really do put a checkmark during install.

                        So...now it seems that the EAR does find the XML file but iBatis can't find the config file during runtime. This may be an iBatis issue but doc says it gets it from the current Classpath.


                        Nope its still not right. I don't understand. I'm trying to load this from a DAO constructor to get a SqlMapClient. It just can't find my file. I'm wondering if I need to grab the paraet classloader() or this is abug in the iBatis call to get the file (though turing EAR isolation off fixes this obviously).