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

Similar Messages

  • How to handle External Jar files in EJB DC

    I have created a EJB DC.
    I have added the required MDM Jar files to the class path.
    These MDM Jar files are supplied by SAP for integration with Master Data Management.
    But the DC build fails.
    If I create the same project as a <b>REGULAR</b> EJB (non-dc approach)project, everything works fine.
    Qn:
    How to bundle the MDM jars (External jars)in a DC?
    How to create the Public Parts in the DC for the added MDM External Jars?
    How to use the above DC in the EJB DC?
    Basically, I am looking for a step by step procedure,
    to add external jars in a DC.
    And to use the above DC in a EJB DC.
    Any assistance in this regard is appreciated.

    You should not reference the MDM jar files by setting classpath directly. For setting references to it from your EJB DCs , you will have to create a DC of type "External Library". Deploy this DC also before your EJBs are deployed. You will then have to create a public part for this DC and the reference the public part from the DC metadata of the EJB DC ie set the Used DC list of EJB DC to the public part of the ext lib. You will get info about this in NDS help as well on help.sap.com

  • How to call a jar file from oracle forms (6i)

    Hi,
    I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
    thanks.
    duminda

    I created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
    then i tried to run it in application server. its still not running.
    can you tell me what i have to do within my bean class? or can you suggest any solution?
    thank you.

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to call a .jar file in JSP

    Hi Folks,
    I would like to know how to call a .jar file in a JSP page..
    Thanks in adv.

    Any web app creating tutorial can. You know, if this doesn't ring a bell with you at all, I don't really feel inclined to explain it to you because I think you shouldn't yet be dealing with JEE in the first place.
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html

  • 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

  • How to call  a jar file for the dynamic menu

    hi ,
    I am using JDEV 11.1.2.2.0 version.
    My problem is this,
    when dynamic tree populate using java bean class(data come from the table)
    how can we call a jar files(seperate projects jars) to each link of the tree.
    plz help...
    -Harsh-

    Hi,
    projects are a design time functionality. So what is the use case? I it is a Java object stored in the JAR file then you would configure this JAR file in the ViewController project library section (project properties)
    Frank

  • 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 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

  • How to use external java files into my project

    Hi all,
    I need your help to import my external java files in to my project.
    The files are in package folder.
    So how to tell the import command with the path of the folder.
    I read also that I can make a jar file and integrate it into the project.
    How can I make jar file.
    Best regards...

    there is one utility in j2se jar and check the option also
    put that jar file in lib folder of yr application folder
    [email protected]

  • 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

  • How to add a jar file to a project

    I believe I have followed the necessary steps to add a jar file to my project. I have added this jar file as a new library and I see all the classes in it. I have even added it to my SessionBean1.java via the Add ---> Property menu. I noticed that this did not do the import of the class, so I did it myself. I also noticed that it did the drop downs and found the class for me automatically. Specifically, the IDE knows about the class layout and can see my class package as I type it out.
    So far so good....
    I then go to compile the project and I get the error:
    C:\Projects\safe\Safe\src\safe\SessionBean1.java:11: package com.dusa.bo does not exist
    import com.dusa.bo.BackofficePerson;
    Am I missing something? I looked around and it looks to me like the jar file is in the project and it should know about it. Again, I do know that the editor can find it, because as I type import ..... it then list "com" as an option to click on, then if I click on com, it will then list dusa ... and so on.
    Thanks

    I figured this out. Sorry for the post.

  • How to call external js file to custom master page

    Hi all,
    I have created custom master page and i need to call external .js to master page. i tried every aspect of including this in master page. but this js is not running. 
    <script src="test.js" type="text/javascript"></script>
    i have put the above calling js script to head tag. 
    And, When i am running the site, the js file is not loading. 
    How to load this js file to custom master page. 
    Thanks,
    Rakesh

    I have placed js file in same folder of custom master page. 
    This is quite annoying and i am struggling to call it. 
    js file is in same master page folder still i am calling it through whole URL as
    <script type="text/javascript" language="javascript" src="http://SharePoint/sites/SiteName/_catalogs/masterpage/Master%20Page%20Template/test.js"></script>
    Still it is not working.
    Now i am not sure what is wrong here. 
    Please help..
    Thanks in adv !!
    Rakesh

  • In a java applet , how to call other jar file?

    i have i programm, this programm is a java application,
    also, i already put these program into jar file, and then if i double this jar file , its work!
    but , now i need to run this program in web browser,
    i thing that i will write a simple applet with a button
    after i click this jButton, how the java applet call and run the java file?
    please help me.. it is because this is my project! thx..........
    [email protected]

    I have a solution write one batch file in that you specify class path and java home.
    then give
    java -jar Test.jar
    then call this batch file from program using Java runtime
    Runtime.exec method...
    Hope will this work

  • How to call external Java code from Animate project?

    I am creating a trainer using Animate that needs to interface with an aircraft model written in Java.  Is there a way to call external Java functions from Animate?
    Thanks!

    you can import external java files by yepnope
    yepnope({nope:[
                                  'your java script file address.js',
                             ],complete: init});
    function init() {
    codes that work with your js file can be write in here
    Zaxist

Maybe you are looking for