Forum Stats

  • 3,837,038 Users
  • 2,262,222 Discussions
  • 7,900,186 Comments

Discussions

ADF Library usage and their library dependencies

Stuart Fleming
Stuart Fleming Member Posts: 391
edited Apr 26, 2017 11:47AM in JDeveloper and ADF

Jdeveloper 12.1.2

I have a question about how to properly manage all the libraries that both my consuming applications and my libraries depend on.  I am wondering if things are getting a bit too complicated.....

The goal is to have all the libraries reside in Weblogic.  They have manifest files etc, so they can be accessed.  They will not be deployed within the consuming application.

The consuming applications (even if they themselves are libraries) have weblogic.xml files that contain the references to find the library dependencies. For example, the consuming application, which uses the xxxRoleValidation ADF Library has this entry:

<library-ref>

    <library-name>xxxRoleValidation.shared.lib</library-name>

</library-ref>

However, the library xxxRoleValidation uses the following library: xxxUtilsVC.   xxxUtilsVC itself uses a library called xxxUtilsGeneral.  When I add the xxxUtilsVC to the xxxRoleValidation I see the ADF Library Dependencies Node created.

When I add the xxxRoleValidation to the main consuming application, I also see the ADF Library Dependencies File created.

How should I handle these dependencies? Should they all be added to the application Libraries? Or should they just be listed in the weblogic.xml? 

Or, since each library that has dependencies has a weblogic.xml file with the dependencies listed, do I need to do anything at all?

Thank you,

Stuart

Tagged:

Answers

  • amey g
    amey g Member Posts: 2,631 Gold Trophy
    edited Apr 24, 2017 11:48AM
  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,561 Red Diamond
    edited Apr 24, 2017 12:19PM

    In addition to amey I think that you mixing up two concepts. The ADFLibrary which is added to your library and classpath is needed to compile the application. This way the compiler knows where to look for hte needed classes or compile hte classes before they are needed.

    When you define a library reference in the weblogix.xml you tell the weblogic server, that your application needs to access a library which must be installed on hte server. This kind of dependencies are checked during deployment of the application, making sure that the library is present and can be used by the app. Libraries you have specified as library reference are not deployed as part of the application, because they are already deployed on the server. 

    Handling dependencies for complex application structures can be painful if you are using ANT as there is not build in dependency management. You have to to this yourself (compile hte projects in the right order). Here maven can be a big help. Depending on your jdev version you can use maven (12.2.1.2 works OK). For other version there are some things which make usage of maven complicated or impossible. There are tools you can use together with ANT (like IVY) but they are compilcated too.

    Timo

  • Stuart Fleming
    Stuart Fleming Member Posts: 391
    edited Apr 24, 2017 12:22PM

    Amey,

    Hi. Thank you for the reply.

    We are starting out with a new environment, and I don't have much control over it.  I don't think I can implement maven...what I really need to understand is how the libraries need to be treated.

    I have been working with libraries for quite a while now, so know the basics, but need to know how to configure it when one library is added to a consuming application, and that library depends on another, and that library isn't in the consuming application.

    Thanks,

    Stuart

  • amey g
    amey g Member Posts: 2,631 Gold Trophy
    edited Apr 24, 2017 12:26PM

    Hello,

    I have updated link in last post. It will work.

    Thanks,

    Amey

  • Stuart Fleming
    Stuart Fleming Member Posts: 391
    edited Apr 24, 2017 12:36PM

    Timo,

    As always, vielen dank.

    I probably can't use maven.  I am deploying from within Jdeveloper at this point using the application or project deployment features.

    I understand that if I am deploying an application that has an entry in the weblogic.xml and if that library is not present on the server, the deploy fails.

    The question is whether I need to configure the main consuming application with the entries in the weblogic.xml for the child-child libraries (the libraries that the libraries use).

    It just concerns me that the ADF Library Dependencies Node pops up when there are libraries that depend on libraries....

    Thanks,

    Stuart

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,561 Red Diamond
    edited Apr 24, 2017 2:23PM

    This function is a convenience for you, so that you don't have to add the missing jar files yourself. If you setup the jars in the other project to be deployed by default, they will end up in hte resulting war or ear file and the app will run.

    Timo

  • Stuart Fleming
    Stuart Fleming Member Posts: 391
    edited Apr 26, 2017 11:47AM

    I did some testing....I am somewhat displeased with the results:  I will try to explain this:

    Application A uses re-usable ADF Library b.jar.

    Application A has a weblogic.xml reference to the b.jar library and is configured to not deploy the b.jar inside the a.ear

        <library-ref>

            <library-name>b.shared.lib</library-name>

        </library-ref>

    b.jar uses c.jar.  It has a weblogic.xml listing c.jar, and it is configured to not deploy c.jar inside b.jar.

        <library-ref>

            <library-name>c.shared.lib</library-name>

        </library-ref>

    Both b.jar and c.jar are deployed to weblogic.

    Application A is deployed.  It only has a weblogic.xml listing b.jar.....and it fails with this error:

    oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/msgTFD/accessDenied-tfd.xml'.

    accessDenied-tfd.xml is a task-flow inside the c.jar.

    If I add c.jar to the Application A weblogic.xml file, then the application runs.

    What I don't understand is this:  b.jar is configured to look for c.jar in weblogic.  However, if b.jar is added to Application A, and application A is configured to look for b.jar in weblogic, then it should naturally just find c.jar -- since b.jar is configured to look for it in weblogic.

    Application A should look for b.jar (and use the deployed version) and b.jar should find c.jar (and use the deployed version).

    but It isn't working that way unless I add this to the weblogic.xml in Application  A:

        <library-ref>

            <library-name>c.shared.lib</library-name>

        </library-ref>

    This doesn't seem right....if I add a library to a library (to create some new functionality), and that library is already used in an application, then the application will fail, because it isn't configured to look for the new library.....

    Instead the library should look for the library -- and it wouldn't break that way.

    Is there a solution?  Maven?  does maven update the weblogic.xml of the consuming application if a library it uses has a new library added to it?

    Stuart

This discussion has been closed.