3 Replies Latest reply: Nov 4, 2010 4:29 PM by Kosta-Oracle RSS

    EAR project facet and APP-INF/lib

    412740
      Hello,

      I have four Workshop 10.3 projects which comprise an EAR. The projects are like this:

      - MyCommonLib (Project Facets: EAR 5.0, WebLogic EAR Extensions 5.0)
      - MyCommonLibControls (Project Facets: Utility Module 1.0, WebLogic Utility Module Extensions 10.3, ...)
      - MyCommonLibSchemas (Project Facets: Utility Module 1.0, WebLogic Utility Module Extensions 10.3, ...)
      - MyCommonLibExtraControls (Project Facets: Utility Module 1.0, WebLogic Utility Module Extensions 10.3, ...)

      Basically, I am bundling 3 utility-jars into an EAR to be deployed collectively as a shared library. The problem is that I need to define at least one module in application.xml, otherwise deployment fails. Workshop however places all the jars in APP-INF/lib and leaves the application.xml empty.

      I tried to "hack my way around this" by creating an empty "dummy.jar" file and placing it in the EarContent folder of the "MyCommonLib" project and editing application.xml by hand. However, when I export an EAR, it does not make it into the archive (even if I add it to the J2EE Module Dependencies of the EAR project MyCommonLib) and therefore deployment fails because the dummy.jar referenced in my application.xml does not exist.

      What project settings do I need to achieve what I need?

      Edited by: akarypid on Nov 4, 2010 2:29 AM
        • 1. Re: EAR project facet and APP-INF/lib
          Kosta-Oracle
          A plain jar is not a Java EE module. I would recommend creating a dynamic web project instead. It doesn't need to have any interesting content, but you may want to include an about page. Just keep in mind that the web app's content will be visible in the consuming app so pick context root accordingly.
          • 2. Re: EAR project facet and APP-INF/lib
            412740
            Hello,

            Thank you for your input; the WAR approach works, although I don't like the idea of publishing web pages by importing the shared library.

            However, I was hoping for an approach that would use the "standard J2EE" jar packaging approach whereby a project that is marked as a utilitiy module is not placed in the APP-INF/lib (thisi is weblogic-specific) but rather placed in the EAR's root and published in the standard application.xml as:
            <application ...>
                <module>
                    <java>dummy.jar</java>
               </module>
            </application>
            This way I could bundle everything into the EAR, without having to include a web application in the shared library (and every app that uses it)... Could this be done using some project setup in Workshop?
            • 3. Re: EAR project facet and APP-INF/lib
              Kosta-Oracle
              I think you can do that in Eclipse/Workshop if you create an app client project, but I don't think that's going to give you a valid EAR from Java EE spec perspective. You need to have a web or an ejb module.

              - Konstantin