Urgen - refer external jars from tomcat container

Hey guys,
can any one help me how to refer external jars from tomcat.
In other words, one of the webapps is need external jar. However, we should not copy that jar into web-inf\lib rather we should refer that jar which is located in the same machine.
Appreciate your help.
Thank you,
Prithvi.

I am not sure if either of my suggestions will be helpful but you could put the jar files into tomcats shared\lib if that is appropriate. Another option is that you could put your jar files into some directory and then reference them in your WEB-INF\lib directories using symbolic links.

Similar Messages

  • Refer external Jars

    Hi All,
    Is there a way in which one could refer to external jars through the manifest of a jar file. For example, i have the following directory structure:-
    product
    |
    |- bin
    | |
    | |- myproduct.jar
    |
    |- lib
    | |
    | |- resource1.jar
    | |- resource2.jar
    Now, is it possible to set the resource1.jar and resource2.jar in the classpath of myproduct.jar so that myproduct.jar can use the classes in these jar files?
    For your information, myproduct.jar is an executable jar, which has a main class attribute defined in its manifest file.
    Thanks a lot in advance,
    Regards,
    Dev.

    I have the same problem, I think, but your solution did not work.
    I have a directory structure:
    java/com/bti/acecomm/syslogwatch
    I have my classes in syslogwatch and mail.jar and activation.jar in java directory.
    I went into the java directory and ran jar -cvmf SyslogWatch.mf syslogwatch.jar com
    The manifest has:
    Main-Class: com.bti.acecomm.syslogwatch.SyslogWatch
    Class-Path: activation.jar;mail.jar
    I complains:
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException
    at com.bti.acecomm.syslogwatch.SyslogWatch.main(SyslogWatch.java:95)
    javax/mail is in mail.jar.
    I am not sure what I am doing wrong.
    David

  • Migrating prject with external jars from 10g to 11g

    Hi..
    I am migrating a project which is using external jar files. I have included jar files in sca-inf/lib folder as well as on server directory. But i am getting error that the particular class in jar cannot be intialized. Error is given below:-
    Could not initialize class com.ge.realestate.ea.framework.util.FrameworkXMLUtils;

    Thanks for replying...
    I have already followed all the steps in that document. But i am unable to access classes in the jars included in the project. May be I have to recompile all the jars in 11g with ant. Because I am able to access only those classes which are not importing any classes. The imports used in the specific class are given below:-
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.StringWriter;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import oracle.xml.parser.v2.XMLLSSerializer;
    import org.apache.log4j.Logger;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.collaxa.xml.XMLHelper;
    import com.oracle.bpel.client.BPELFault;
    I am not sure if importing one of these is causing the problem.

  • How to access external jars from ejb jars

    All,
    This is my first visit/post to this group. What I'd like to know is how
    an external jar file with common, shared classes can be access by a
    session bean in an ejbc'd jar. I'm running WLS 6.1 and have some DAO
    and other classes in a common.jar that I'd like all my ejbc'd jars to
    have access to. Any help would be appreciated!
    -Keith

    Keith,
    "Keith" <[email protected]> wrote in message news:[email protected]..
    This is my first visit/post to this group. What I'd like to know is how
    an external jar file with common, shared classes can be access by a
    session bean in an ejbc'd jar. I'm running WLS 6.1 and have some DAO
    and other classes in a common.jar that I'd like all my ejbc'd jars to
    have access to. Any help would be appreciated!I'd recommend packaging your application as an EAR - than your
    ejbjars will have access to utility jars.
    Regards,
    Slava Imeshev

  • How to refer utitlity jar from EJB jar in ear?

    hi, all,
    I want to refer an existing jar file from EJB, but i do not know how to do it? please help!
    Thanks.

    I am using weblogic 6.1

  • Ref a jar from a nother jar

    i have an app the needs java mail it works fine but java mail is not standard so i need my IDE to reference the java mail jar file work all good and dandy but how once i make my app a jar file do i get it to reference the java mail jar file???
    thanks in adv
    nibur

    You can specify a class path in the manifest for a jar.
    This only works if you are running
    java -jar myjar.jar
    Search google for how to do this.

  • How to use a jar from a external library DC Project?

    I followed the steps of how to create DC, External Library Project, which contains the jar I want.
    I understood that this type of project can't be deployed so I build and deployed other DC Project from the type J2EE server component Library and added it to it's public part. What do I do next, to actually use the jar and it's imports?
    Thank you,
    Meytal.

    Hi,
    Check this:
    Making a JAR file publicly available
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/2ade3fc6c6ec06e10000000a1550b0/frameset.htm
    Greetings,
    Praveen Gudapati
    [Points are welcome for helpful answers]

  • Export JAR from NWDS does not include external JARs imported to project

    Hi.
    I'm need to develop and run a batch java program.  I'm having difficulty getting the application to find the 2 external JARs at runtime.
    For compile time, I have physically imported these 2 JARs into the project.  To add them to the build path, I selected "Add Jar".  I now see the JARs in the project.
    I've also update the Manifest file appropriately by adding this line.
    Class-Path: com.sap.security.api.jar logging.jar
    However, when running the program from the command line, I get class not found errors.
    I noticed that the exported application JAR does NOT contain the needed 2 JARs even though they clearly exist under the project.
    Am I going about this correctly?  Why do external JARs not get included in the application JAR that is created?  Can I somehow force them to be included?
    Thanks,
    Kevin

    Hi Kevin,
    why don´t you just add the two additional JAR files to the classpath at runtime:
    java -cp x1.jar;x2.jar -jar yourJar.jar
    This is the easiest way to start your Java app.
    Have a look at java - the Java application launcher for details.
    Regards Helmut

  • Using resources from an external JAR inside a JAR

    Hi,
    I'm trying to package all parts of my application into a JAR file so I can deploy my application using Java Web Start. However, I have an issue.
    I need to use the files from an external JAR, Ice.jar, with my application. Therefore, I included Ice.jar in my build, specifically in the lib/Ice.jar directory.
    This does not seem to be working; my application cannot read the information from the Ice.jar file when I launch my JAR file. It does work in one instance, however:
    I have a directory included in the same directory where my JAR file is. This directory is named lib, and contains Ice.jar. My directory structure is as follows:
    dist
    dist/NVAC.jar //my JAR
    dist/lib/Ice.jar //the external JARMy JAR file, NVAC.jar, will ONLY work if that lib directory is included in its directory. This is NOT what I want to do; I want to include the external JAR inside my JAR file, so a user will only have to download the JAR file. I have included the external JAR inside my JAR as I mentioned previously; at the path myJAR/lib/Ice.jar.
    Therefore, how do I use a resource from an external JAR inside my JAR? Do I have to use ClassLoader? ClassLoader.loadClass() perhaps?
    If I can provide any more information, please let me know.
    Thanks

    Seems to me it isn't practical to want to do things
    that don't work. Especially since you're using
    WebStart and it takes care of dependent jars
    automatically for you if you configure things
    correctly, so this absurd idea of jars inside jars
    isn't even helpful.Dang DrClap, you seem to be the go-to guy for destroying all my ridiculous ideas (no offense; I mean that in a good way).
    Seems I did not understand JWS fully when I thought of that idea. I researched it more after reading the replies here, and I see that I was indeed thinking absurdly.
    Thank you for the help,
    Dan

  • Read images from external jar file (Sun's Java L&F Graphics repository)

    Hi!
    I don't know how to read images from an external jar file. Sun has a Java Look and Feel graphics repository that contains a lot of good images that can be used on buttons and so on. This repository is delivered as a jar file, containing only images, and I want to read the image files from that jar file directly without including them inside my application jar file. The application and image jar files will be in the same directory.
    I have absolutely no clue how to solve this. Is it necessary to include the images inside my application jar file or is it possible to have them separate as I want.
    Would really appreciate some help!
    Best regards
    Lars

    Hi,
    There is two ways :
    1) Add your jarfile to the classpath.
    Use the class loader :
    URL url = ClassLoader.getSystemResource("your/package/image.gif");
    Image im = (new ImageIcon(url)).getImage();
    or
    Image im = Toolkit.getDefaultToolkit().getImage(url);2)If you don't want to add the jar to the classpath you can use this (under jdk 1.4):
    import java.util.*;
    import java.util.jar.*;
    import java.awt.*;
    import java.io.*;
    import java.awt.image.*;
    import javax.imageio.*;
    public class ImageUtilities {
         public static Image getImage(String jarFileName, String fileName) {
              BufferedImage image = null;
              try {
                   JarFile jar = new JarFile(new File(jarFileName), false, JarFile.OPEN_READ);
                   JarEntry entry = jar.getJarEntry(fileName);
                   BufferedInputStream stream = new BufferedInputStream(jar.getInputStream(entry));
                   image = ImageIO.read(stream) ;
              catch (Exception ex) {
                   System.out.println(ex);
              return(image);
    }I hope this helps,
    Denis

  • I dropped my external hard drive which contained my iTunes library and it is no longer readable. I attempted to upload my library from iPod and while all the songs appear to be in iTunes I get a message telling me that the original file can't be located.

    I dropped my external hard drive that contained my iTues library and the disk is no longer readable. I figured I would simply transfer my music back from my iPod to my MacBook Pro and it loks like it worked. All the songs are there, but I receive a message that the original file can't be found when I try to play anything. ANy help would be greatly appreciated.

    A Couple of questions..
    Is the location shown under preferences/Advanced/General still showing the correct location?
    Is the check boxes under this checked or unchecked?

  • Calling external programs from within a Tomcat application

    I've got a fairly complex existing Tomcat application (which is packaged and built as a .war file) which I'm trying to edit so that it calls a Perl script part way through the processing, which will generate an XML file used later on. I think I've worked out how to call external scripts from within Java, but at the moment when I try and access the application via Tomcat the application either hangs or bails out (I don't know which, as the log files unhelpfully don't give any error messages).
    The code which is causing the problem looks like this:
    System.err.println("Calling runtime...");
    Runtime runtime = Runtime.getRuntime();
    System.err.println("Executing process...");
    Process process = runtime.exec("/path/to/ysearch.pl 'News' '\"search query\"' 'file");
    System.err.println("Waiting for process...");
    int exitVal = process.waitFor();
    System.out.println("Exited with error code: " + exitVal);The code gets as far as "Executing process..", beyond that there is nothing in the log file so I presume the runtime.exec() call is where the problem is. I'm not interested in reading the output from the script (there shouldn't be any), so that's not an issue, and the permissions on it allow anyone to read or execute ysearch.pl so I don't think there's a problem in that area.
    Does anyone have any suggestions which I could try to get this to work? I've only been using Tomcat for a week (I'm picking up on someone else's code) so I might have made a beginner's mistake. I'm using Tomcat 5 on Fedora Core 7, and Java 1.5.0_01 (I can't easily change any of those).

    I'm not sure, but I thing that overhead caused by calling du cannot be big enough to matter even on older machines.
    But, when calling du from Perl script you are also invoking shell, and this can be a little bit more 'heavy'.

  • Exporting External JARs on WAS from Webdynpro

    Hello everybody,
    I have posted same topic earlier also. But i can't any solution for that. Bharadwaj has suggested to make Library project and add all JARs in it and deploy on WAS. But in Library projects, we can only add JARs of Exsisting projects only.
    So, what could be other options for that?
    Thanks in advance,
    Bhavik

    Hi Bhavik,
    Sorry for a very very late reply. I think it is a limitation (or probably a bug ) . What i do usually is ,add it to some other project's lib folder and then take the jar from there. Since it is added as a seperate copy in ur .sda file it wont be problem after deploying. No reference exists.
    Its just that u wil have a problem while adding it design time..
    Its a round about way to take a jar.But it works.
    And about ur question.. i doubt if u can really find the jar in the bin folder directly.. (If we add a external jar to project i cant find any jar in the project folder. I searched the .ear file but i am not able to find it. Just check if u can find it )
    Regards
    Bharathwaj
    Message was edited by: Bharathwaj R

  • How to call external jar files in EJB project for CE

    Hi,
    I would be thankful if someone could help me with this -
    I need to call the external jar files into my EJB project - Here is what I have done and am getting runtime exception as  -
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    1. Created a EJB  project" HelloWorld "  using Java perspective in NWDS 7.1 called with client as HelloWorldClient and EAR project as HelloWorldEAR.
    2. Am working on HelloWorld project (1st one).
    3. In my code I am instantiating a class which is a class in one of  the external jar file that I need to refer in my project.
    4. I have set the Java Build path but it works only for the compile time and fails during runtime.
    5. Have read I need to create external library DC and refer in my project "HelloWorld".
    Can anyone help me with exact steps what needs to be done - during creation of external library project and then for my "HelloWorld" EJB project. How would I be able to reference or set the external library project in my EJB project?
    Looking forward to hear from experts.
    Thanks,
    Shiv
    Edited by: Shiv Khullar on Aug 30, 2010 9:39 PM

    Hi Edson,
    I tried it , but it still gives me runtime exception.
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    Steps I performed are -
    1. Created a library project and created 2 Public parts "Compilation" and "Assembly"
    2. Build the library project.
    Now in my EJB project using Project Explorer - set the classpath and added both compilation jar and assembly jar files.
    This is how the classpath entries for external library looks like -
    <classpathentry kind="lib" path="/LocalDevelopmentLocalDevelopmentexternallibrarypdftoolsforwatermarkingdemo.sap.com/gen/default/public/WatermarkAssembly/lib/java/demo.sap.comexternallibrarypdftoolsforwatermarking~WatermarkAssembly.jar"/>
         <classpathentry kind="lib" path="/LocalDevelopmentLocalDevelopmentexternallibrarypdftoolsforwatermarkingdemo.sap.com/gen/default/public/WatermarkCompilation/lib/java/demo.sap.comexternallibrarypdftoolsforwatermarking~WatermarkCompilation.jar"/>
    I have also added the jar files I used in my external library project as "User Library" from Java Build Path . I dont do it , then the code fails during compilation itself.
    Regards,
    Shiv

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Opening a T code in some other window

    Hello All, We have a requirement where in we just need to display an Input box and a submit button in an iview / HTML Page (Similar to r/3's Command box) where the users can enter sap t-code. Upon Entering the t-code and clicking on the button the t-

  • Preferences in iphoto 08

    Cannot open preferences in iPhoto 08,what could be the problem

  • Should "rv_value = 'submit'." force processing of the Setter method?.

    When new values are entered into the field 'Country' for the Account screen the code associated with this field does not seem to be run unless I press ENTER after the field is populated from the list of values. I have a method with the appropriate co

  • Endless SerialPort Reading

    Hello there! I have implemented the code Kevin Le made and it works perfectly. It is a windows form that allows you to configure, open, read, write and close a COM Port in a wonderful and straightforward way. All of that using the serialPort class. D

  • "license has expired"

    I have recently installed CS4 on my computer and have had issues since. When I first tried to run the programs I got the message "licensing for this product has expired." Then I tired to open it a few days later and the accept licensing window appear