Deployment: Deploying external libraries from dependent projects

Hi,
i need some help for the following issue.
How do I deploy external libraries from dependent projects? I have one project for the model layer which references TopLink JPA library and an other project for view/controller based on JSF/ADF Faces. The view/controller project has the model project as dependency.
For the view/controller project i have created a WAR deployment profile. On deployment all classes and referenced libraries from view/controller project and all classes from model project were included. But not the referenced library for TopLink JPA.
My second approach was to create a JAR deployment profile for the model project. Again the referenced library for TopLink JPA was not included.
My third approach was to add a library file group to the JAR deployment profile. I tried to add the library to jar's root and to META-INF directory. But the application don't find the library (java.lang.NoClassDefFoundError).
The only way I got this running was adding all referenced libraries from dependent projects to the view/controller project which couldn't be the proper solution.
So how do I get this running? What are the best practices?
I would be glad to get some input on these issue. Thank you.
PS:
I'm using JDeveloper 10.1.3.2 and like to deploy on Tomcat 5.5.23.

I see your points.
Unless you have Java EE 5 there is no real standard way of including libraries in EAR files. Including the libs in the WAR files is the only standard supported way for file formats prior to Java EE 5. If you have to consider Tomcat as a possible platform, WAR files are your only option.
You reluctance to include the libs in the WEB-INF/libs structure is understandable but think of injected dependencies in the Entities you're not aware of. These might be needed in the view layer too.
--olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Libraries from dependent projects

    Hi there,
    I have created an application in Jdeveloper 10g comprising of 2 projects.
    Project 1 is a web app containing all the UI related content and a few java classes used for navigation related concerns.
    Project 2 is a core java app comprising all the business logic and using Toplink JPA for database interactions.
    Project 1 is the entry point project. We have created a project dependency in project 1 to include project2.
    For deployment, In project 1 we create a deployment profile ear file. It generates the deployment artifacts but somehow the libraries being used in project 2 are not being included in the web-inf lib folder of project1. I have selected the Export checkbox in the Libraries tab of Project2 properties.
    All the other artifacts from the dependent project 2 are correctly being included in the ear file
    Let me know your thoughts. Should I have to add the libraries being used in project 2 to project 1 libraries also ?
    Regards,

    Can anyone provide some info on this based on your empirical experience or alternate ways

  • Libraries of dependent project not deployed

    Hi,
    I have two projects, lets name it A and B. In Project A I defined some project libraries containing JAR's (Project Properties -> Libraries and Classpath -> Add Library).
    Project B depends on Project A.
    Now I created a deployment descriptor for a WAR in project B. Under the section "Library Dependencies" of the WAR profile I selected the option "Include Libraries from other projects" and I selected some libraries of project A for deployment. Under the section "WEB_INF/LIB -> Contributors" I selected these libraries as well, but under the section "WEB_INF/LIB -> Filters" the JAR's of these libraries don't appear! So when I create the WAR, these libraries are missing. The question is why??
    I figured out, that when I set the option "Deployed by Default" in the libraries of Project A, the JAR's appear in the deployment descriptor of Project B under "WEB_INF/LIB -> Filters". However these libraries cannot be deselected anymore in the deployment descriptor of project B! So this doesn't help me, because I use project A as dependency in several other projects, and each projectes needs a different set of libraries of project A.
    Is there a solution for this problem?
    Thanks for hints
    Thomas
    PS: I'm using JDeveloper 11.1.2.1.0 (Build JDEVADF_11.1.2.1.0_GENERIC_110907.2314.6081).
    Edited by: thmayr on 25.01.2012 06:10

    Since the forums are going up and down during USA business
    hours, I was forced to contact Tech Support. It was frankly the
    worse tech support experience of my life. The technician just
    didn't get what I was trying to tell him. A senior tech finally
    gave him a solution that worked. Here is that solution:
    Uninstall Flash Player and Reinstall it. However, you just
    can't use the Add/Remove Programs. You have to download a special
    uninstaller from the following web site:
    http://www.adobe.com/shockwave/download/alternates/
    Before running the uninstall, I recommend you restart your
    computer, then run the uninstaller after you have downloaded it.
    This 'unloads' Flash Player from any task and also unloads the
    ActiveX portion from memory.
    After uninstalling and reinstalling, the 'Flash' in my
    FlashHelp is back!
    Hope this helps someone else with this problem.
    Regards,
    Gilley

  • Not picking up Toplink Descripters or classes from dependant project

    Working w/ beta3 of the designer, and building a database adapter to do an insert, I've noticed that the BPEL process generates its own set of Offline Database Tables, Toplink Mappings and object classes, even though these offline tables, objects and mappings already exist in a project that I have set as a dependency. These mappings seem the same - am I missing something?
    Thanks.
    Dave

    Hi David,
    I don't think you can import one TopLink Project into another, or do it with a dependency.
    However I created a new BPEL process project and then I added the toplink_mappings.mwp and src/ directory from another project I created, then ran the DBAdapter wizard. I was able to generate the toplink_mappings.xml, the wsdl, and the xsd.
    To be safe you may want to copy these files into your new project first. The project should be named toplink_mappings.mwp.
    Thanks
    Steve

  • Deploying the java files from main project

    haii..
    i am using netbeans5.5 ...i started do all my programs in a single project...all these are small small programs using Jframes and all..now i want to run this programs separately from the IDE..like from the cmdline...so i go to tat netbeans installtn folder src and i find my programs there all the files are there in .java and .form etn...and wen i tried to compile the .java alone it gives me lot of errors ....
    what can i do ...plz help me

    If you use NetBeans you can extract the .class files
    and then get source from the .class files.Not necessarily. Presumably, then, Netbeans comes with a decompiler. All well and good, but of course what gets spat out of a decompiler is not necessarily what was compiled in the first place. How much that matters depends very much on why you want to see the source, of course, of course

  • Using external libraries with Actionscript Project

    Hi,
    I've hit a bit of a brick wall trying to do something that I figured would be a relatively simple task. I'm working on multiple projects and I'm trying to build a number of SWC libraries shared between a number of Actionscript projects using Flash Builder 4. The projects using the SWC's build just fine, but yield this error when run:
    VerifyError: Error #1014: Class <whatever> could not be found.
    Here's a simple example:
    1) Create a new library project.
    2) Add a new Actionscript file in the "testpackage" package.
    3) Slap this code into that file:
    package testpackage
        public class stuff
            public function Testing():void
                trace("Oh yeah!");
    4) Create a new Actionscript Project named Launcher
    5) In "Properties->Actionscript Build Path", hit "Add SWC Folder" and browse to wherever the library project gets built to.
    6) In the AS file that's generated, add code something like:
    package
        import flash.display.Sprite;
        import testpackage.*;
        public class Launcher extends Sprite
            public function Launcher()
                var s:stuff = new stuff();
                s.Testing();
    7) Run this bad boy.
    I get the above error and I have no idea why. Everything builds fine so I'm not sure what I'm doing wrong. I read somewhere that you can manually extract the .swf file from the generated .swc and load that explicitely in code. This is a pretty horrible workflow and I hope it's not the answer
    Thanks a ton in advance!
    -D

    Check  linkage type in Build Path for project Launcher when you add Swc folder. It has to be merged into code.
    If it is external, you'll see this error.
    That aside, why not do "add project" instead of "add swc folder"?
    -Anirudh

  • Using external libraries in desktop programs

    Hi everybody, i'm a bit newbie and i have some questions for you. Can I create a project in C# (VS2013) and use the exe as a desktop program? (I mean, if it's consider a desktop application). My main question is: Can i import external libraries on this
    project? I don't know this, because it's hard to know if the users have the library (or is it include in the program?)
    Thanks in advance :)

    You can write windows forms or wpf applications ( and some other types ) using visual studio.
    These are desktop applications which you can distribute.
    A library is a dll.
    Dynamic link library.
    To use one you add a reference to it in your solution.
    That dll is then a dependency for your application.
    You can later build an msi which someone would use to install that application or you can deliver by clickonce.
    http://msdn.microsoft.com/en-us/library/ms173084(v=vs.90).aspx
    You do that using an install project which will detect those dependencies and include them in the msi you give to people to install your application.
    There are a number of options:
    Installshield lite
    Wix
    Setup and deployment project
    https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • Configure external libraries as Glassfish modules

    I have several OSGI bundles and WAR packages which use external libraries:
    <dependencies>      
            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-web-api</artifactId>
                <version>6.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.2</version>
                <scope>test</scope>
            </dependency>       
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>4.2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>4.2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.glassfish</groupId>
                <artifactId>osgi-cdi-api</artifactId>
                <version>3.1-b41</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>Instead of building the libraries into every OSGI bundle and WAR package is it possible to copy these libraries into /modules directory of the Glassfish server. I suppose that it's possible to use only one copy without any problem?

    yes, you can but there are limitations when doing this which you already correctly identified.

  • Missing external libraries on deployment

    I have created a Web project under IBM Rational Application Developer 7 and a EAR project that deploys that web application under WebSphere v6.1.
    When I publish the web application on WebSphere, the external libraries are not found or not published with it. I have included the external libraries into the main Web project, but still it is not taken into account.
    Anyone know what the cause of this could be?
    In order to run my program I have to create the WAR file with Maven og install it manually on WebSphere. This has become tedious and wastes alot of time.

    The application probably thinks it's a camera drive. Post a screen shot if the root level of the partition. Look for folders with names like Private.

  • RE: How do I access deployed TOOL libraries from mycode?

    Hi Martin,
    sorry for the late answer but I hope it is still helpful.
    First: In the workspace you make your distribution from, check whether
    you really have library icons.
    Second: Make the distribution and run it from the partition workshop.
    Startup should fail when you do not have the libraries installed. If you
    install them later and you can run that distribution then, you can be
    sure that you use your library.
    Third: Sometimes it is difficult to import the library pex-file into
    your workspace when there are already plans with that name. To overwrite
    them you can use a traceflag (cfg:c4:14:14:1). But take care! this will
    overwrite!!! Do not overwrite them before you put your libraries sources
    into another repos. If you did it by accident, at least do not integrate
    until you saved the original code.
    Hope this helps. If you have more question please feel free to contact
    me.
    Uli
    Ulrich Beutenm&uuml;ller
    TechnoData GmbH
    Germany
    -----Original Message-----
    From: Martin G Nystrom [SMTP:[email protected]]
    Sent: Thursday, October 15, 1998 12:56 PM
    To: [email protected]
    Subject: Re: How do I access deployed TOOL libraries from my
    code?
    Excellent! Now can I be sure that my client application is using the
    deployed
    library, not bundling its own when I distribute the application?
    -Martin
    Karoly <[email protected]> on 10/14/98 05:55:43 PM
    To: Martin G Nystrom/AM/LLY
    cc:
    Subject: Re: How do I access deployed TOOL libraries from my code?
    Martin,
    Here is how it works:
    When you create a library distribution, part of the result is a
    'Library
    Definition' pex file (located under the 'appdist') like this:
    C:\forte\appdist\EnvName\LibName\cl0\generic\LibName\LibName.pex
    You would import this pex file into a workspace, after which it
    would
    appear
    as any other Forte library.
    Once integrated, the library can used by other plans as a supplier
    (remember
    to 'install' the library from E-Console).
    Hope this helps,
    Karoly Kojnok
    Martin G Nystrom wrote:
    We have a lot of plans that contain "business objects" that ourclient
    applications share. I'd like to deploy these plans as TOOLlibraries (not
    compiled) and then have my deployed applications use them. Myquestion is:
    How do I access the library?
    Some possible answers:
    1) Just include it as a supplier plan, it will automatically use thedeployed
    TOOL library
    2) You have to programmatically load it using task.part.findLibrary
    3) The help says I can "import it into my repository" -- how do I dothat?
    -Martin
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Excellent! Now can I be sure that my client application is using the deployed
    library, not bundling its own when I distribute the application?
    -Martin
    Karoly <[email protected]> on 10/14/98 05:55:43 PM
    To: Martin G Nystrom/AM/LLY
    cc:
    Subject: Re: How do I access deployed TOOL libraries from my code?
    Martin,
    Here is how it works:
    When you create a library distribution, part of the result is a 'Library
    Definition' pex file (located under the 'appdist') like this:
    C:\forte\appdist\EnvName\LibName\cl0\generic\LibName\LibName.pex
    You would import this pex file into a workspace, after which it would
    appear
    as any other Forte library.
    Once integrated, the library can used by other plans as a supplier
    (remember
    to 'install' the library from E-Console).
    Hope this helps,
    Karoly Kojnok
    Martin G Nystrom wrote:
    We have a lot of plans that contain "business objects" that our client
    applications share. I'd like to deploy these plans as TOOL libraries (not
    compiled) and then have my deployed applications use them. My question is:
    How do I access the library?
    Some possible answers:
    1) Just include it as a supplier plan, it will automatically use thedeployed
    TOOL library
    2) You have to programmatically load it using task.part.findLibrary
    3) The help says I can "import it into my repository" -- how do I do that?
    -Martin
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Deploy of Essbase Cube from EPMA to Shared Services Project is not possible

    We cannot deploy Essbase Cubes to shared services projects. The projects are not selectable in the box in the deploy dialog. Help is urgently needed. Our version is 11.1.1.3.
    Many thanks
    Michael

    Hi,
    It looks like a known issue
    When deploying an Essbase application, the Shared Services project drop-down is not populated as expected. (8239445)
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Import JSPs from one project to another (depends on or ??)

    I'd like to solve the large product problem: Broke up into several projects.
    The problem is most evident in unit testing with the internal container. Any jsp includes
    or forwards to JSP's in other projects just is not supported with local testing.
    I'd be very happy to live with the same solution I'm using for classes from other projects.
    I.E. a Project library that points to the output path of another project.
    The deployment config for project B who depends on project A's classes, includes the classes
    from A into the projB.ear.
    I can live with this. It supports use of Tester and Local running of JSPs.
    I'd like the same solution for JSPs too.
    I'm happy to forgo the URL distinction that's possible by deploying all modules to an
    external container. I'd be willing to live with all JSP's in proj A accessed as if they
    where local to proj B.
    Anybody have a solution?
    At present I'm living in HELL, with JSP src in both places. As the project grows into
    more modules, replication from A to B-->E just won't work. Plus, as JDev and SCM go,
    someone always screws up and adds these copied files to SCM and the project.
    It's currently a mess!
    Thanks, curt

    Although classes have the notion of a classpath, the HTML Root directories from several projects cannot be strung together like that. The OC4J server does not support multiple document roots for a single web module.
    There are a few possibilities for you though:
    1) Change the settings of each project so that they all point to the same HTML Root directory. In this configuration, a WAR profile in any one of the projects will deploy the entire contents of the HTML Root directory.
    2) If you can't put all the JSPs in the same HTML Root directory, formalize the boundaries between the web modules by defining a "J2EE Web Context Root" for each project according to your exact need. Then when JSPs include or forward to each other, use URIs that contain the context root as part of the URI.
    3) Keep everything in one project, but separate the JSPs into different directories. Then to get a filtered view of your JSPs in the JDev navigator. switch the navigator into "Category view" (Project | Show Categories). You can then selectively drill into a specific directory. If you select the project and then choose View | Display in New Navigator, you can get a separate navigator whose scope is narrowed onto your specific project.
    Hope that helps. If you have any specific suggestions on enhancements that would improve your productivity in this area, please let us know.

  • Question about dependent projects (and their libraries) in 11g-Oracle team?

    Hello everyone,
    I have a question about dependent projects. An example:
    In JDeveloper 10.1.3.x if you had for instance 2 projects (in a workspace): project 1 has one project library (for instance a log4j library) and project 2 is a very simple webapplication which is dependent on project 1. Project 2 has one class which makes use of log4j.
    This compiles fine, you can run project 2 in oc4j, and the libraries of project 1 (log4j) are added on the classpath and everything works fine. This is great for rapid testing as well as keeping management of libraries to a minimum (only one project where you would update a library e.g.)
    However in 11g this approach seems not to work at all anymore now that weblogic is used, not even when 'export library' is checked in project 1. The library is simply never exported at all - with a noclassdeffound error as result. Is this approach still possible (without having to define multiple deployment profiles), or is this a bug?
    Thanks!
    Martijn
    Edited by: MartijnR on Oct 27, 2008 7:57 AM

    Hi Ron,
    I've tried what you said, indeed in that .beabuild.txt when 'deploy by default' is checked it adds a line like: C:/JDeveloper/mywork/test2/lib/log4j-1.2.14.jar = test2-view-webapp/WEB-INF/lib/log4j-1.2.14.jar
    Which looks fine, except that /web-inf/lib/ is empty. I presume its a sort of mapping to say: Load it like it in WEB-INF/lib? This line is not there when the deploy by default is not checked.
    I modified the TestBean as follows (the method that references Log4j does it thru a Class.forName() now only):
    public String getHelloWorld() {
    try {
    Class clazz = Class.forName("org.apache.log4j.Logger");
    System.out.println(clazz.getName());
    catch(Exception e) {
    e.printStackTrace();
    return "Hello World";
    In both cases with or without line, it throws:
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:42)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at nl.test.TestBean.getHelloWorld(TestBean.java:15)
    Secondly I added weblogic.xml with your suggested code, in the exploded war this results in a weblogic.xml which looks like:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    <jsp-descriptor>
    <debug>true</debug>
    <working-dir>/C:/JDeveloper/mywork/test2/view/classes/.jsps</working-dir>
    <keepgenerated>true</keepgenerated>
    </jsp-descriptor>
    <library-ref>
    <library-name>jstl</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    </weblogic-web-app>
    The only thing from me is that container-descriptor tag, the rest is added to it during the deployment. Unfortunately, it still produces the same error. :/ Any clue?

  • Deployment of ADF application from Sub version

    Hi All,
    Using Jdeveloper 10.1.3.3. We have integarted SVN with our jdeveloper. Now we have to deploy the application. How I can do that, using my local working copy, or I have export the application from SVN and then open it with Jdeveloper and proceed with deployment?
    Regards,
    Vikram

    This depends on your needs.
    If you only deploy to a test server you are fine to use your local copy. If you need to go back to the exact copy of all sources of tge deployed version you have to go a different path.
    We normally do a fresh checkout of all projects needed to build the application into a fresh directory, build all projects (hopefully without error) make the needed jars, wars and ears. If all this goes without error, we first delploy it on the test server to see it the deployment is ok. Then we tag this version in svn (this enables us to do fixing in the exact version) and deploy it on the QS server for testing. If all tests went through we deploy the exact eras to the production server.
    When a user finds an error in the production version you have to decide if you fix the error right in the production version (hot fix) or if you fix it in the normal development cycle.
    Hot Fixes are done on the tagged version to make sure nothing else changes beside the error. The fix has to be ported to the development version too! If the error is already fixed you can backport it to the tagged version.
    Checking out the projects, building and deploying is done outside from jdev via ant (you can try maven if you want).
    Timo

  • Netbeans vwp+deploying to external Tomcat

    Hi all,
    I need to deploy my vwp-webapp to external Tomcat. It uses Mysql database.
    What are the main steps in this? I could'nt find any instructions for it.
    Thanks in advance.

    In JSC I have deployed webapp successfull copying common-beanutils.jar, common-digester.jar, standard.jar and jstl.jar from [creator]/modules/autoload/ext to [tomcat]/common/lib.
    Exporting WAR-file from JSC to [tomcat]/webapps/ and defining a db-connection in tomcat-admin-webapp.
    If I copy war-file from [netbeans-project-folder]/application-name/dist to [tomcat]/webapps and start server to deploy it. This is the same as above.
    I can see only first page, if I try to use link to another page, it crashes.
    This webapp works in Netbeans IDE.
    Anybody have a idea or experiences from this?
    Thanks.

Maybe you are looking for