Including External JARs for Java Application in OC4J

Hi Experts,
Here is my requirement.
I have developed my Java application using Tomcat Server & Eclipse. In my application I have used some External JARs & imported the classes in my JSP.
Now that I'm using OC4J Server instead of Tomcat I'v no clue as to where I have copy these External JARs for my application to work.
I have installed OBIEE-Client which includes OC4J server. The path where I have placed my application is as below
*"C:\OracleBI\oc4j_bi\j2ee\home\default-web-app"*
If I run my application the server does not import the classes in the JSP which we include using Import statement using JSP tags (*ex* - <%@ page import = "org.apache.commons.fileupload.*"%>).
This is the location which I found, where I need to put my Java-J2EE application. This OC4J_BI comes with OBIEE.
Kindly help me out on where to place these External JARs exact location in OC4J.
Also let me know if I have to alter any configuration/xml file (if so pls specify the file name & its location).
Thanks in advance,
Venky

You can either include the external libraries in the application, by placing them into WEB-INF/lib, or you can import them into the server as "shared libraries", normally you'd use the "enterprise manager" application to do this. Having loaded a shared library you then add it to the classpath when you're deploying the application.

Similar Messages

  • Problem using Jar to include external jars in an application

    Ok so, I've just completed a project, and i want to be able to jar it up so its executable by just using the jar file. I can do this, and it will load the first screen. However, i used eclipse to develop it so I just added two files to the eclipse path and it all worked. But when I jar up my application (and include the two external jars in my app), and try to use any class that needs the external jar, it dies and says java.lang.NoClassDefinitionError: javax/servlet/http/HttpServlet
    How do i set it up so it actually finds the classes in the external jar?? Its fairly important that i get this to work :)

    If this app is not running as part of Tomcat, you have two options. One, as ejp pointed out, is to put the missing jars into your $JAVA_HOME/lib/ext dir. If you've already tried that and it's not working, then the jars your putting there do not have the necessary classes in them. Use 'jar -tf <jarname>' to see a list of the classes in the jar.
    The second approach, which it sounds like you've already tried, is using the Class-Path entry in the Manifest file. You must make sure that the jar you're referencing (servlet.jar) has the missing classes in it, and that the jar is in the same directory as the application jar. Another potential gotcha with this approach is to make sure that the jar is not indexed (they're not indexed by default).

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • How to create the exe files for java application

    How to create the exe file for java application?
    got any software to do that?
    Thanks

    In terms of converting java applications into exe files, there are 3 schools of thought:
    1) Instead of converting it to an exe, convert it to a jar file. Jar files are more portable than exe files because they can be double-clicked on any operating system. The caveat is that a Java interpreter must be installed on the target computer for the double-clicking to work.
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/
    2) Create an exe launcher that, when double-clicked, attempts to find a Java interpreter on the local computer and launches the Java application. The exe file is still double-clickable but whether your java application runs depends on whether a Java interpretor is installed on the target computer.
    http://www.sureshotsoftware.com/exej/
    http://www.objects.com.au/products/jstart/index.jsp
    http://www.duckware.com/products/javatools.html
    http://www.ucware.com/jexec/
    http://www.rolemaker.dk/nonRoleMaker/javalauncher/
    http://www.jelude.cjb.net/
    http://thor.prohosting.com/~dfolly/java/index.html
    3) Create an exe launcher that bundles a Java interpretor. Same as above but when the exe file is double-clicked, it searches for a Java interpreter and if one is not found, it installs one on the target computer. The caveat is that the exe file would have an overhead of 10 MB in size for the interpreter.
    http://www.excelsior-usa.com/jet.html (evaluation version available)
    4) Convert the Java application into a native exe file. The caveat is that if you use Swing for your GUI, it won't be converted. Also this option is still somewhat experimental.
    Can't think of any free options right now.

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • What are the reporting tools available for Java applications??

    hi..
    please tell me some reporting tools available for java applications.... if there are some, please mention how to find their documentation????

    http://jasperreports.sourceforge.net is a nice one, there is also a link to a graphical design tool.

  • How to access(connect) BI Data in webdynpro for java applications

    Hi ,
    is there any way to access and display the BI data in portal using webdynpro for java applications like we did in Visual composer.
    if not how to integrate the BI data in webdynpro applications ?
    Regards,
    Govindu

    Hi,
    Yes there are ways to do it. But may your scenario and the scenario for which I have done may differ.
    You can use openhub to get the data in a flat file and then read it into weddynpro through a java service OR
    You can use DBlink(which i have done).
    Please refer the link below:
    [Link|Data from BW to Oracle.;
    This I have done in NW04s. Not sure whether a better solution is available in the newer release.
    Hope it helps.
    Regards,
    Manoj

  • How to use BAPI in webdynpro for java application

    Hi all,
    Please help in getting started with calling a BAPI in a webdynpro for java application. I have got only the content needed to call a BAPI in a webdynpro for abap application but not in java. Kindly provide me some documents if possible.
    Thanks in advance

    Hi ,
    U have Created One Bapi u want to work with web Dyn pro for java Application Right .
    U need the Following
    1) NWDS (Netweaver Devloper Studio )
    2) jdk1.4 or Above installed in your system .
    After Installation of NWDS .
    1) Just Take J2EE Enginee Details
      a) Go to Window -> preferences  -> J2ee Enginee - > give ur port number , Host name Details . and click finsh .
    Go To Web Dyn Pro Perspective Click onj2EE engine .
    Click On Refresh U will see Green Colour button .
    Now ur Ready to import Ur BAPI .
    1) Go to File -> New -> Project - > Web Dyn pro Project -.
    Give Name , pkg Name Click On Finish .
    2) Expand ur project hirarchy -> go TO Application -> Right Click -> Create Application - > Give Application name and Pkg name -> Click on Finish .
    3) Now ur View And Controller Are Created by Default .
    4) Go to Model-> Right Click on it-> Create Model -> Give Model Name & Pkg name Should diff from Application pkg the Click On Next
    a) Here u have to Two JCo Destination Name Like Model Data And Meta data & R/3 System Details like System Number , Host name  Etc -> then Click on next .
    b) Here u will text filed where u want to search for ur Required BAPI . Type ur BAPI Name Click on Search . Ur bapi will be displyed In Down . click on Next .
    c) Now Ur model is Importedint into NWDS .Map ur model data To Controller and Controller Element to View Elements .
    After ur Model .
    Go to -> Project Name -> Right Click -> go to -> Deploy New Archive .
    after wards u have to go Apllication -> Right click -> deploy and Run .
    ur output will be displyed thru Browser .
    Thats it
    Regards ,
    venkat

  • Invoke Workflow from Web Dynpro for Java Application

    I am working on a custom web dynpro for java application and when the user clicks the submit button the SAP standard workflow (WS50000041) should be invoked. Does anyone have experience they can share with me on how to achieve this functionality? It should also be able to attach an adobe form or read data from the form and submit the data as xml.
    Thanks,
    Ashley

    Hi Ashley,
    Use following code in RFC to invoke your workflow -
    DATA : w_subrc TYPE sy-subrc,
                w_wi_id LIKE swwwihead-wi_id.
    CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
            EXPORTING
              task                      = ' WORKFLOW - WSxxxxxx '
              language                  = sy-langu
              do_commit                 = 'X'
            IMPORTING
              return_code               = w_subrc
              workitem_id               = w_wi_id
            TABLES
              input_container           = it_container
              message_lines             = lv_swr_messag
          COMMIT WORK.
    With this code your workflow will get start. But u have to use workflow id in next application also in which your request is getting navigated. In that application you have to take this workflow ID and have to pass again in workflow using - PortalNavigation statements.
    After that this workflow will get start to publish in your TaskList (My Task) in Portal. Remeber that your all task should be maintained in workflow table by using SWFVISU  transaction.
    After that go to Portal and Re-Register your UWL so that your new Workflow ID will get usable in portal.
    With this way you would be able to use workflow with Web Dynpro Java using UWL and Workflow.
    Regards,
    Roshan Gupta

  • How to create setup for Java Application?

    Hello,
    I have created one Java Application. Now I want to create setup for that. I want to know if there is any tool is available for Java Application. If yes, then please help me to get that.
    My emal id is "[email protected]"
    Thanks in advance.
    Sam

    Go to www.zerog.com
    Download InstallAnyWhere4now (free)
    it is Awsome youll love it
    M
    bakbjo

  • How to convert .ear file of webdynpro for java application to webdynpro pro

    Hi All,
    I have a .ear file which belongs one web dynpro for java application.
    I do have other information about the same.
    I need to convert it into a web dynpro project and use it in NWDS to make changes.
    How can I do it? I could not find any solution on SDN.. I hope I get here...
    Thanks and Regards,
    Aditya Deshapnde
    Edited by: Aditya Deshpande on Nov 23, 2010 1:55 PM

    Hi Friend,
    This is almost not possible even if you have Java Decompiler -- WD has a lot compile(design)-time only artifacts that are not exist in generated EAR.
    Hope this is help full for u.
    Regards
    Vijay Kalluri

  • 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

  • How to call function in included dll file through java application.

    Hi All,
    i am trying to create an java application which call c# functions using JNI. i am completed with the code and it is running fine when i tried to run from netbeans IDE. But when i tried from Calculator.jar file, first time it throws this error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CSharpClient in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at calculator.CalculatorApp.<clinit>(CalculatorApp.java:20)
    After that i included that dll file in the cuurent directory. And compiled and tried to run, it throws an unexpected error:
    F:\JavaProjects\Calculator\dist>Java -jar Calculator.jar
    *# An unexpected error has been detected by Java Runtime Environment:*
    *# Internal Error (0xe0434f4d), pid=2640, tid=3700*
    *# Java VM: Java HotSpot(TM) Client VM (1.6.0_02-b06 mixed mode, sharing)*
    *# Problematic frame:*
    *# C [kernel32.dll+0x12a5b]*
    *# An error report file with more information is saved as hs_err_pid2640.log*
    *# If you would like to submit a bug report, please visit:*
    *# http://java.sun.com/webapps/bugreport/crash.jsp*
    Anyone have idea how to solve this error.
    Thanks in advance.

    This error is created whenever things go sour on the native side. The first thing you can try, and I assume you are using a Java<->C++<->C# bridge which includes two dlls, one created by C++ and another by C#. Is to make sure that the C# dll is compiled using /t:module switch during compilation.
    If you are using VS2008, or VS2005, you can add a post build syntax like:
    csc /t:module /out:"$(ProjectDir)$(OutDir)YourModule.dll" "$(ProjectDir)YourCSfile.cs"
    Hope this helps! If not, ensure first that the native code works by creating a native test app for it.

  • How to include external jars - URGENT...

    Hi:
    I am using Eclipse for development.
    My application uses some external jars.
    This step is simple in Eclipse, one simply indicates where the jars are to the IDE.
    However, when I make an executable JAR file from my project, those external JARs are not included.
    So when I run my program, everything is fine until the parts that uses the external JARs.
    Does anyone know how to include them outside of Eclipse platform?
    I am going to see my client in an hour and of course I can't bring my source and install an Eclipse at my client's computer to show them my demo...
    please help... thanx...

    You add those external jars to the classpath or the jars classpath if you're running the program from a jar. Or put the external jar to JAVA_HOME\lib\ext (IIRC)

  • DownloadService.loadResource for external jars for 1.6.0-19+

    First, be kind with my english, i'm french (nobody's perfect...)
    I have a JNLP into which i declare a signed jar resource main.jar. This application retreive at execution a list of signed jar names (+a.jar, b.jar+...) that i dynamically load on my need through DownloadService.loadResource. My a.jar, b.jar are cached and it rules! But if i made a new main.jar, a.jar and b.jar, and deploy them on my server, here what's happend:
    - main.jar is tested for modification date on server (thanks to "If-Modified-Since" HTTP header), cache date is before this date, so JWS update main.jar by downloading this new main.jar. This is the behaviour described into specs and it is perfect for me!
    - but for others resources (a.jar, b.jar) i was excpected the same behaviour but JWS does not seems to check for modification date. So a.jar and b.jar are not updated.
    So my first question: Is there a way to tell to DownloadService.loadResource to check for modification date? i could deal with jar version but this basic date checking was great for me...
    Except this cache minor problem, external jar download works just fine except i get the warning security problem [Mixing Signed and Unsigned Code |http://java.sun.com/javase/6/docs/technotes/guides/jweb/mixed_code.html].
    All my jars are signed with the same certificate, so i was a bit confused.
    Anyway, i follow indications and put the Trusted-Only: true attribut into the manifest of main.jar.
    But it leads to this exception:
    java.lang.SecurityException: Trusted-Only loader attempted to load sandboxed resource from http://monserveur/a.jar
         at com.sun.deploy.security.CPCallbackHandler$ParentCallback.check(Unknown Source)
         at com.sun.deploy.security.CPCallbackHandler$ParentCallback.access$1400(Unknown Source)
         at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
         at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at my.package.a$5.run(a.java:348)
         at java.lang.Thread.run(Unknown Source)I found some posts that deal with similar problems but it does not give me a working solution. The difference seems to be the fact that i load external jars (not defined into JNLP).
    My JNLP is validated though JaNeLA.
    I cannot set a.jar, b.jar as resources into jnlp because i retreive their location during execution...
    My JNLP also declare:
    <security>
            <all-permissions/>
    </security>I think i'm a bit confused with the sandbox notion and the Trusted-Only: true attribut of the manifest. I also tried to add it to a.jar, b.jar and not main.jar but vainly. I also tried to set it on all jars but it does not work better.
    Is there a way to load external jar without having the Mixing Signed and Unsigned Code warning popup? What do i not well understand?
    Sorry to be so chatty...
    Thanks in advanced for any answer.

    So, I finally succed in finding a solution.
    But this solution seems perhaps a barbarian way to solve my problem but it works.
    The idea (as far as i understand) is that when you define "all-permission" into JNLP file, then these permission are granted for JNLP ClassLoader. When you load external jar through DownloadService.loadResource, then another classloader is used. It seems that this classloader does not inherit security policy from JNLP ClassLoader.
    My solution is to define my own policy:
    Policy.setPolicy(getAllPermissionPolicy());
        * @return a {@link Policy} with all permission granted
       private Policy getAllPermissionPolicy()
          Policy policy = new Policy() {
             private PermissionCollection m_permissionCollection;
             @Override
             public PermissionCollection getPermissions(CodeSource p_codesource)
                return getAllPermissionCollection();
             @Override
             public PermissionCollection getPermissions(ProtectionDomain p_domain)
                return getAllPermissionCollection();
              * @return an AllPermissionCollection
             private PermissionCollection getAllPermissionCollection()
                if (m_permissionCollection == null)
                   m_permissionCollection = new AllPermission().newPermissionCollection();
                   m_permissionCollection.add(new AllPermission());
                return m_permissionCollection;
          return policy;
       }For sure, you can decline this with permission you need. Here, all permission are allowed.
    I'm not quite satisfied because it's seems to be a barbarian style solution. But for now, it fits my uses => no warning popup!
    If anybody has a more proper way to deal with such an issue, i'll be glad to hear it!
    Hope it helps.

Maybe you are looking for