How to include an external jar file in .EAR project

Hello All,
I have created a web service through java class in sap netweaver 7.1.
For database connection i want to add external jar file as reference. could you all please tell me how to do this or can i get some scenario where it is explained.
Please Help
Regards,
Vanita Jain

Hi Vanita,
open your project in nwds > right click on the project > click on properties option from the menu > click on java build path from the left-side navigation of the window > and click on libraries in the right side tab > here you'll get a button called add external jars > clicking to this, will open browser window to select a jar file.
Regards,
Sen

Similar Messages

  • [noob] how to include third part jar file in ear

    Hi,
    eveything is in the subject. It's quartz that I'm using btw.
    Regards
    Fred

    Hello,
    You are using the internal deployment file?
    <yourapp>.deploy?
    1) Place the file in the WEB-INF/lib directory
    2) Right click <yourapp>.deploy file and select properties
    3) File Groups -> WEB-INF/Lib -> Contributers and select your jar file.
    4) Rebuild the ear, done
    -Anton
    PS Be carefull, depending on the Application server you are using the quartz library COULD already be present (Most have it) and this could be a different version!
    If this is the case you need to tell the application server to load classes from the web-inf directory first!
    With the Oracle OC4J containers this can be done during deployment, classloaders and select search local classes first.
    With Weblogic you will need the deployment descriptor 'weblogic.xml' and add:
    <container-description>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-description>

  • 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

  • How to include third party .jar files into my jar file

    Hi,
    how do i include a open source third party jar file into an executable jar?
    i have a class called BlogBox.java and it uses org.apache.commons.net.ftp.FTPClient, i want to create an executable file, where do i put the .jar file containing FTPClient aka Apache Commons Net?
    currently i'm getting the following error from when executing my BlogBox.jar
    C:\MyJava\BlogBox>java -jar BlogBox.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
    at blogbox.BlogBox.<init>(BlogBox.java:27)
    at blogbox.BlogBox.main(BlogBox.java:103)
    Any suggestions? i have searched google and this forum but could not find the solution to my problem, thanks
    [edited msg] do i need to add the classpath at execution or something of the apache commons net library?
    Message was edited by:
    gekkokid

    When you use an executable jar the normal class path
    is ignored, but you can put a classpath inside the
    jar. The usual trick is to place the library jar
    files in a directory inside the application directory
    and direct the manifest file to it. The manifest file
    live in the jar inside the META-INF directory and
    it's called manifest.mf
    The two heavilly used entries are Main-class: and
    Class-path: lines. Class-path just has a
    comma-separated list of library paths.
    The jar utility has a special option to load it up.Thanks :) I created a "/lib" directory, placed in the packages in there and redirected the Class-Path: lib/commons-net-1.4.1.jar
    and it works,
    thank you everyone :)

  • How to add one poi jar file into webdynpro project

    Hi all:
        We would like to add one poi jar file into one webdynpro project, however, what should we do ?
        Its one external 3rd party jar file.

    Hi,
    To add a jar file you need to have an external library DC.
    Hope the below link will help you:
    [http://help.sap.com/saphelp_nw70/helpdata/en/46/3ce3e4df201d63e10000000a11466f/frameset.htm]
    thanks & regards,
    Manoj

  • How to set the classpath for external .jar files after importing?

    Hi techs,
    How to set the classpath in WSAD5.1.2 after importing the .jar file to the WEB-INF/lib folder.
    urgent

    I got it.
    after importing the jar file to the perspective,we need to right click on project name, go to proprties,
    goto java build path,
    there we need to include the external jar files.

  • Using External JAR file within Web Dynpro DC

    Hi,
    I have created a Web Dynpro DC and I need to use an external JAR file.
    I want to use this external JAR file within the same Web Dynpro DC and NOT creating another DC to house the external JAR file as I can see from the blog.
    I have included the external JAR file in the "lib" folder of the Web Dynpro DC.
    When I tried to perform a DC build, it keeps complaining error....
    How should I solve this problem...
    Thanks.
    mike

    Hi Mike,
    Go through the below which might help you.
    Re: Lookup of RFC Destinations
    Re: Import a Java Bean from a different DC
    Web Dynpro References
    Re: j2ee library with webdynpro
    Re: Web Services :HTTP Destination not getting resloved.
    http://help.sap.com/saphelp_nw70/helpdata/en/46/3ce3e4df201d63e10000000a11466f/frameset.htm
    Thanks n Regards,
    Jhansi Miryala

  • How to import external jars in a CAF project?

    Hello Experts!
    Could you help me find out the way to import external jars in a CAF project. I have tried to import the jars
    in ejbmodule using "java build path--->libraries". But while trying to build the project it's displaying error and all the imported jars automatically get removed from the list.
    I have read that creation DC of type "External Library" can help me.
    1) Create a DC of type external library
    2) Copy my jars to folder "libraries"
    What should I do next? And how can I import my DC of type "External Library" to my CAF project?
    Looking forward for your suggestion.
    Thanks & Regards
    Vitaly

    Hi,
    This article will guide you how to deploy the external jar files to the application server.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60a0f850-c451-2c10-a6a6-ddcabfa3a65b&overridelayout=true
    Add the library project to the public part of your caf project to use the jar files.
    Regards,
    Gayathri

  • Accessing an external jar file

    Hi there,
    Does anyone knows how to acces an external jar file?
    I need to use a jar on another webserver because the jar is using a library.
    Thx...

    I think you can add a classpath
    in the environment variables on windows
    and append the directory of where your jar files
    are located.
    or
    copy the jar files to the C:\j2sdk1.4.0_03\jre\lib\ext
    where j2sdk1.4.0_03 is your javahome directory
    any comments
    just POST here
    Gudluck
    kuks

  • How to include external .js file into .ear file using NetBean 5.5.1?

    is it possible to include external .js file into .ear file using NetBean 5.5.1? if not, then where should I placed the external .js file and how to write the src="xxx" element? (that is , how to write the path of "xxx"?)
    I am using JBOSS 4.2.2 GA as server
    thx!!

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • How to use external jar files ??

    Hi all,
    In my user-defined function for mapping (IR) , I want to make use a Class which is available in an external .jar file.
    Our XI is working on Windows2003 OS. I set the classpath in OS environment variables.
    But it is not working.
    Where I should set the classpath ?
    Can anyone help.
    Thanks in Advance
    Chemmanz
    Message was edited by: Chemmanz

    Hi Chemmanz,
    For user defined functions, it is not necessary to use the external jar files.
    Just follow the below steps:
           1.      To create a new user-defined function, choose <b>Create New Function</b> in the data-flow editor at the bottom of the screen, on the left-hand side.
           2.      Specify the attributes of the new function in the subsequent window:
    Name:
    Technical name of the function. The name is displayed in the function chooser and on the data-flow object.
    Description:
    Description of how the function is used.
    Arguments:
    In this table, you specify the number of input values the function can process, and name them. All functions are of type String.
           3.      In the subsequent window, you can create Java source code:
                                a.      You can import Java packages to your methods from the Imports input field, by specifying them separated by a comma or semi-colon:
    You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since all message mappings require these packages and therefore import them.
    In addition to the standard packages, you can also specify Java packages that you have imported as archives and that are located in the same, or in an underlying software component version as the message mapping.
                                b.      Create your Java source text in the editor window or copy source text from another editor.
           4.      Confirm with Save and Close.
           5.      User-defined functions are limited to the message mapping in which you created the function. To save the new function, save the message mapping.
           6.      To test the function, use the test environment.
    The new function is now visible in the User-Defined function category. When you select this category, a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the function to the data-flow editor, choose the arrow next to the button and select from the list box displayed.
    Regards,
    Prasad U

  • How do I deploy an external JAR file

    Hello,
    How do I deploy an external JAR file?
    I am grateful for every hint.

    Hi Manuel,
      If you read my blog mentioned in the beginning of the thread, you will note that such solution is not supported in our engine due to number of reasons.
      Please, read the blog and use application library shared among these two applications. You will achieve the same effect. Please note that the using application will need run and deploy-time dependencies to the shared library.
      You should not add files to any of the folders manually or manipulate engine's classpath in such situations.
    Best Regards,
    Georgi

  • How to import external jar file

    i am using bcprov-jdk14-124.jar file for my project. i can import this jar file through eclipse project properties but this is not worklng when i create jar file for my project. This is worked in eclipse only. i want to use that jar file in my project current path. so any body help me how to import this jar file? ( i am using mac os to develop java project )

    You need to specify the classpath when you execute it outside of Eclipse.
    Kaj

  • 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

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

Maybe you are looking for

  • Report 2 returning data from previously ran report 1 - Plus/Viewer

    Hello, We have an issue running through discoverer viewer and plus. If you run the first report with a parameter for the year with this returns the correct data. However if you run report after the first with year 09-10, the 08-09 data is returned ag

  • ITunes no longer MOVES files....

    I have my iTunes library on a network drive, when I add a folder, or just a  bunch of music files into iTunes by dragging and dropping them into iTunes (a blue box shows up that covers music/movies, etc)... if I do not hold down any keys, it just sho

  • Ms excel how to transfer customised toolbars

    I customise intensively lots of shortcuts, rules, scripts etc on my computer. Starting on a new computer is complicated then, because transfer to new computers and versions is not always easy or even possible. In older ms excel (office) versions, the

  • Lag When Displaying 1080p

    I just recently bought the T410 thinkpad with pretty good specs.  The laptop i bought is exactly the one on this link all the way to the right (express ship one). Link did not work but it has an i7 processor, 4g of ram, Intel HD Graphics, 7200 320g h

  • Upgrade Video Card To Something Else Other Then 8800GTS

    I have a 8800GTS in my mac pro right now and when I play games I get some lag from it like bad frame rates and so on. I was wondering can you upgrade the card with a different one I have a 3850 ATI card but it doesn't have a Mac Pro check on it like