6 Replies Latest reply on Sep 5, 2008 4:26 AM by skajotde

    CNF on Exploded Jar in app.ear/lib

    skajotde

      I have commented issue with exploded jar from <jar-file> in persitence.xml.

      Exploded jar (inside EAR) containing persistence.xml with jar-file element fails to deploy - https://jira.jboss.org/jira/browse/EJBTHREE-1254?focusedCommentId=12428289#action_12428289

      Is exploded jar in app.ear/lib on classpath this app.ear ?

        • 1. Re: CNF on Exploded Jar in app.ear/lib
          skajotde

          Like jakiran mention in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=131914 simplest solution is to move to flat ear. So I comment maven-ear-plugin and is ok.

           <!--<defaultLibBundleDir>lib</defaultLibBundleDir>-->
           <!--<defaultJavaBundleDir>lib</defaultJavaBundleDir>-->


          I hope new vfs will be more powerful solution to that problems ;> Good job folks.

          • 2. Re: CNF on Exploded Jar in app.ear/lib
            skajotde

            When I move to flat ear I have CNF from three jars. It is strange. I checked these Classes are in Jars and it looks that it is random jars..

            All jar from root ear are on classpath ? and how to easy check ear classpath ? (jmx way ?) When these jars was in app.ear/lib there is no problem with these jars.

            My ear is exploed and flat.

            • 3. Re: CNF on Exploded Jar in app.ear/lib
              jaikiran

               

              "skajotde" wrote:


              All jar from root ear are on classpath ?


              No, they are not. Unless you add a java module in the application.xml to point to the jar at the root of EAR.

              All jars in the EAR/lib folder are in classpath by default. The "lib" folder in the EAR is the default folder from which the jars will be added to classpath. You can name the "lib" to anything else and then add an library-directory element in the jboss-app.xml to point to your folder containing the jars.

              • 4. Re: CNF on Exploded Jar in app.ear/lib
                skajotde

                 

                "jaikiran" wrote:
                [You can name the "lib" to anything else and then add an library-directory element in the jboss-app.xml to point to your folder containing the jars.


                But then is problem with exploded jar in lib (or something else direcotry) pointed from <jar-file> like in https://jira.jboss.org/jira/browse/EJBTHREE-1254?focusedCommentId=12428289#action_12428289

                Thanks, I'll try java module in our maven build.

                • 5. Re: CNF on Exploded Jar in app.ear/lib
                  jaikiran

                   

                  "skajotde" wrote:


                  But then is problem with exploded jar in lib (or something else direcotry)


                  When i had tested it, the jar file was exploded and at the root of the EAR. In your case, is the jar file in zip format or is it exploded? And are you seeing issues if you place a zipped jar file in the lib folder of the EAR (this is something i had not tried)?

                  "skajotde" wrote:

                  Thanks, I'll try java module in our maven build.


                  Let us know how it goes.

                  • 6. Re: CNF on Exploded Jar in app.ear/lib
                    skajotde

                     

                    "jaikiran" wrote:

                    When i had tested it, the jar file was exploded and at the root of the EAR. In your case, is the jar file in zip format or is it exploded? And are you seeing issues if you place a zipped jar file in the lib folder of the EAR (this is something i had not tried)?


                    In https://jira.jboss.org/jira/browse/EJBTHREE-1254?focusedCommentId=12428289#action_12428289 I think my case is explained ;>

                    After patch mentioned in forum thread (thanks jakiran ;>) On JBoss 4.2.1 there is additional problem (but close so comment here):

                    If library from <jar-file> is also exploded and is situated in lib directory there is problem CNF from this library.

                    Application.ear\lib\exploded-library-with-persistence-ob.jar has persistence.xml with

                    {quote}
                    <jar-file>../exploded-library-lib-ob.jar</jar-file>
                    <jar-file>../../exploded-library-ob.jar</jar-file>
                    <jar-file>../library-ob.jar</jar-file>
                    {quote}

                    Structure jars:

                    Application.ear\lib\exploded-library-lib-ob.jar
                    Application.ear\exploded-library-ob.jar
                    Application.ear\lib\library-ob.jar

                    On scanning persistence unit from exploded-library-with-persistence-ob.jar there is CNF while addind entity from Application.ear\lib\exploded-library-lib-ob.jar to PU. Scanning Application.ear\lib\library-ob.jar and Application.ear\exploded-library-ob.jar is OK.

                    So Workaround is to move Application.ear\lib\exploded-library-lib-ob.jar to Application.ear. Any other options ?


                    It is default structure for our project so I don't want be too invasive. Now I'm testing exploded deployment to boost developing. We are using maven2.

                    My ear is exploded (Application.ear)

                    My persistence library is in lib and is exploded (Application.ear\lib\exploded-library-with-persistence-ob.jar)

                    When library is in lib and not exploded and referenced from <jar-file> there is no problem (Application.ear\lib\library-ob.jar).

                    When library is in lib and exploded and referenced from <jar-file> there is CNF (Application.ear\lib\exploded-library-lib-ob.jar)


                    When library is in root and exploded and referenced from <jar-file> there is no problem (Application.ear\exploded-library2-ob.jar)

                    "jaikiran" wrote:

                    "skajotde" wrote:

                    Thanks, I'll try java module in our maven build.


                    Let us know how it goes.


                    Thanks for clue ;> It resolved problem ;>

                    For the moment I need only two jarModule exploded (ejb, war are exploded with no problem and are situated in root) so I revert to lib directory and I add Application.ear\lib\exploded-library-lib-ob.jar as java module to application.xml.

                    Application deploys successful.

                    <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-ear-plugin</artifactId>
                     <configuration>
                     <unpackTypes>ejb,war,sar,rar</unpackTypes>
                     <workDirectory>${basedir}/target/30-${project.build.finalName}.${packaging}</workDirectory>
                     <modules>
                     <!-- required changes from https://jira.jboss.org/jira/browse/EJBTHREE-1254 -->
                     <jarModule>
                     <groupId>pl.skajotde.tests</groupId>
                     <artifactId>exploded-library-with-persistence-ob.jar</artifactId>
                     <unpack>true</unpack>
                     </jarModule>
                     <jarModule>
                     <groupId>pl.skajotde.tests</groupId>
                     <artifactId>exploded-library-lib-ob.jar</artifactId>
                     <unpack>true</unpack>
                     <includeInApplicationXml>true</includeInApplicationXml>
                     </jarModule>
                     </modules>
                     </configuration>
                     </plugin>