Referencing Jar inside a Jar

Hi,
i have a jar file. the classes inside the jar file refers to classes within another jar file. i packaged the second jar into my jar file but during runtime i get NoClassDefFoundError when i refer to the classes inside the second jar.
i tried giving the classpath in manifest file but it does not work.
My question is how to reference a jar which is inside another jar?
Thanks
Daniel

I don't think you can reference classes inside a jar that's itself in a jar.
However you can definitely reference classes in a (non-nested) separate jar.
For example A.class in A.jar can reference B.class in B.jar if you put:
Class-Path B.jar
in A.jar's manifest file.
One thing that screwed me up when I first tried this stuff, was that the syntax of Class-Path is not the same as I first expected. If you have more than one path items to put in your class path, you don't separate them with a colon or semicolon, but with spaces.
good luck
j

Similar Messages

  • Hyperion 11.1. 2.0 Install fails with "Some referenced jars do not exists"

    Hi All,
    I am trying to install Hyperion 11.1.2.0 on my laptop. Though the requirements document says the supported OS is windows 2003 or 2008, I have read that people are able to get it working on other OS' as well.
    I have downloaded the below files:
    V20779-01
    V20782-01
    V20783-01
    V20790-01
    V20792-01
    V20799-01
    V20800-01
    V20801-01
    V20802-01
    V20843-01
    V20850-01
    I have the loopback adapter installed and OBIEE 11g running on weblogic server.
    The EPM install has gone through successfully as I see from the log. But when I try to configure the "EPM System Configurator" it command exits with the below error message:
    Running preconfig checks...
    Running EPM_ORACLE_HOME check...
    EPM_ORACLE_HOME environment variable value: F:\OracleBI11G\EPMSystem11R1
    JAVA_HOME environment variable value: F:\OracleBI11G\EPMSystem11R1\..\jdk160
    _11
    EPM_ORACLE_HOME check succeeded
    Running .oracle.products check... .oracle.products check succeeded
    Running Jars manifest check...
    Time spent for manifests parsing: 220 ms
    Maximum jars depth achieved: 6, while restriction was: unrestricted
    Parsed 383 manifests
    Total jars and classpath entries encountered: 383
    Total not-existing referenced classpath entries count: 22
    Total classpath elements to check: 67
    ERROR: F:\OracleBI11G\modules\org.apache.ant_1.7.0\lib\xercesImpl.jar not
    exists; file depth: 3; referenced from F:\OracleBI11G\EPMSystem11R1\common\jlib\
    11.1.2.0\ctg.jar referenced from F:\OracleBI11G\EPMSystem11R1\common\jlib\11.1.2
    .0\epm_j2se.jar referenced from F:\OracleBI11G\EPMSystem11R1\common\config\11.1.
    2.0\configtool.jar
    FATAL ERROR: Jars manifest check failed with message "Some referenced jars do no
    t exist"
    Exiting in 30 seconds
    After reading a similar post in OTN which suggested this could be due to OHS not installed correctly, I reinstalled OHS successfully.
    I still get this error. Can anyone help me how to get around this issue.
    thanks,
    sandeep.

    I got the same problem with you. If you check in your physical directory, you wouldn't find F:\OracleBI11G\modules\org.apache.ant_1.7.0. Maybe when the installtools installed the EPM System, it detected that apache had been installed by OBIEE. Maybe you'll find F:\OracleBI11G\modules\org.apache.ant_1.7.1. The way I took to make configtools worked was by copying F:\OracleBI11G\modules\org.apache.ant_1.7.1 to F:\OracleBI11G\modules\org.apache.ant_1.7.0 and re run the configtools.
    Now I got the other problem when I tried to deploy foundation service to weblogic. It gave me EPMCFG-10067 : Failed to get admin user name for the domain.
    Try to copy F:\OracleBI11G\modules\org.apache.ant_1.7.1 to F:\OracleBI11G\modules\org.apache.ant_1.7.0. Maybe after that you can help me solving my problem.

  • Export applet from eclipse with referenced jars?

    Hey guys,
    I've been looking around for a good answer for how to do this. I'm working on a project that consists of an applet (JApplet) and some referenced jars. In Eclipse I can export the jar but can't figure out how to get it to include all of the referenced jars as well. Any idea how to go about doing this?
    Thanks
    Edit:
    I came across this post:
    http://forums.sun.com/thread.jspa?forumID=421&threadID=630738
    but didn't find a suitable answer
    Edited by: JFactor2004 on May 17, 2010 1:24 PM

    Figured it out. Just had to include the names of the jars in the applet tag in the html file.

  • Referencing jars in other pars

    Hi
    I have been playing with a collection renderer and it needs to reference a class PropertyColumnRenderer from the jar km.appl.ui.flex.collection_core.jar from the portal app com.sap.km.cm.ui.flex , I tried supplying in the sharing reference com.sap.km.cm.ui.flex but it does not seem to pick it up . Any clues
    Regards
    Pran

    Hi,
    just decompile that PropertyColumnRenderer.class and include it in your own par. It should work.
    There's no sharing reference for a jar which is in a private part I think.
    Regards,
    Ladislav

  • Referencing JAR files locally

    I'm trying to reference a Jar file on a LAN for the purpose of getting to its main class and invoking it from my local machine (via a class loader and jar runner generic app). I know the exact location on the LAN (directory structure/path name values), but don't know how to translate this to a URL. Is this possible? A URL seems to imply a reference on the net. What if you want to reference a local Jar file (on a LAN, on your own machine, etc.)?

    Where can I get more info re the 'file:' URL protocol (format)? URL documentation doesn't seem to have any.

  • Referencing JAR files

    I would like to use java mail in a jsp file that is sitting in IFS but how do I tell IFS to reference the appropriate jar files?

    If you're using JWS, you can add your special jar to the iFS classpath by setting an environment variable named IFS_CUSTOM_CLASSPATH to include the location of the .jar file.
    If you're using Apache, you'll have to edit the apache/jserv configuration files which specify the classpath.

  • Java - referencing external jar and class files

    When compiling (loadjava) a Java class, how can an externally referenced '.jar file' be resolved please? Using '-resolve' doesn't do the job in this case.
    Many thanks.

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • CommandAction works through OnDeviceDebug, but not when installed from jar

    Hi everybody,
    I'm trying to run a HelloMIDlet example and if I run it on emulator it works fine, also when I run it on mobile through OnDeviceDebug from eclipse it works fine, but when I install a jar file and run the application it ends with Application Error message and it exits. I found out that the problem might be in the CommandAction method, because when I use this:
    public void commandAction(Command c, Displayable s) {
              notifyDestroyed();
    }then the application works also when installed from jar, but when I use this:
    public void commandAction(Command c, Displayable s) {
       String label = new String("Exit");   //just for test
       if (label.equals("Exit"))
         notifyDestroyed();
    }then it ends with Application Error right after I run the program (and it works when I use OnDeviceDebug). I'm using jdk1.5.0_06 and WTK from Sony Erricsson (my target device is W800i, which supports CLDC1.1 and MIDP2.0)
    My manifest file is
    Manifest-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MIDlet-Name: HelloMIDlet
    Created-By: Sun Microsystems Inc.
    MIDlet-Vendor: Sun Microsystems, Inc.
    MIDlet-1: HelloMIDlet, , HelloMIDlet
    MIDlet-Version: 1.0
    MicroEdition-Profile: MIDP-2.0
    MIDlet-Description: Hello Worldand I don't use the jad file when installing the application (seems to be unecessary when you have a manifest file inside the jar). And I'm unable to debug it because when debugging then it works normally. Also I tried to recompile the BluetoothDemo and the same error(and works through OnDeviceDebug). And when I installed the jar file, which is originally distributed with BluetoothDemo then it worked. When I compared original jar file and my jar file then the only difference was in the size the class files (class files compiled by me were bigger then the class files in original jar file (which work)).
    Any ideas guys and girls?

    I tried that approach but it doesn't work either. I think maybe my directory structure is wrong.
    C:\IRS\IRS.jar
    C:\IRS\irs.hs
    referenced: jar:file://C:/IRS/IRS.jar!/irs.hs
    Am I doing this right?

  • HelpSet works but not when packaged in JAR

    I have been using the JavaHelp and it all works perfectly if I just compile and run it from Eclpise, but when I try packaging everything into a JAR it doesn't work. Can anyone help me please?
    public void loadHelpSet()
    InfoMsg.postError("loading help") ;
    try
    // Get the classloader of this class.
    ClassLoader cl = this.getClass().getClassLoader() ;
    URL url = HelpSet.findHelpSet(cl, "Irs") ;
    irsHS = new HelpSet(cl, url) ;
    HelpBroker hb = irsHS.createHelpBroker() ;
    hb.setDisplayed(true) ;
    catch (Exception e)
    InfoMsg.postError("Unable to load Help Set") ;
    } // end loadHelpSet
    it doesn't appear to get past the line irsHS = new HelpSet(cl, url) when run from the JAr, but it doesn't appear to throw an error either as no message box is shown (as it would if it couldn't find the helpset under normal circumstances when run from Eclipse)

    I tried that approach but it doesn't work either. I think maybe my directory structure is wrong.
    C:\IRS\IRS.jar
    C:\IRS\irs.hs
    referenced: jar:file://C:/IRS/IRS.jar!/irs.hs
    Am I doing this right?

  • URGENT ! Forms (jar file vs directory and classes)

    Hi,
    Our java developper has made an applet that we have to integrate with Forms.
    I said that I need a jar file that I will put in the forms90/java directory.
    The java developper want's to deploy instead of a jar file the whole directory and sub directory and all classes under the forms90/java.
    My question is, are both deployement giving the same result in term of performance on the client side when downloading the classes or the jar file.
    I always tought that jar file was better in performance.
    What is the best way to deploy our applet?
    Thanks for quick answer.
    Jean-Yves

    If you choose jar file client JVM will probably cache your jar. This will increase speed of application loading.
    Another benefit is that when you use jar file there is lazy/on demand loading option available (in my experience on demand loading doesn't work out of the box - jar file and all referenced jar files must be indexed). In other words: users that don't use forms that use your applet will not download that jar file (I have used this for FormsGraph example and some custom java application) and they don't have to download all of the jars your jar file references.

  • Classes not found for jars listed in manifest

    I have an applet whose main jar has a number of dependent jars listed in the manifest. All the jars are signed.
    The applet works fine when downloaded from an HTTP server.
    Previous to 1.6.14 it would also run from a local directory.
    As of Java 1.6.15 and 1.6.16, the classes in the dependent jars are no longer loadable from the local directory. ClassDefNotFound is the reported on the java console. Obviously the class is present, as the application is running fine in JVMs 1.6.14 and previous.
    I see that 1.6.16 includes changes for the security baseline, but I cannot find anything that suggests changes are needed to support dependent jars. None of the dependent jars request a specific version of JRE.
    Anybody know what is going on?

    Is this the error? ...Yes, sorry, the exception is NoClassDefFoundError
    If you provide a Short, Self Contained, Correct Example someone may be able to diagnosis the problem, as opposeed to guessing. A link to the real live application can be found at: http://download.equitrac.com/38834/InstallGUI.html. (This original application does not meet the definition of short ... but demonstrates the problem well.)
    When run as an applet off this site, it works fine.
    If you click on the download button, it will place a copy on your local harddrive. To execute it locally double click on your local copy of InstallGUI.html.
    When running it locally with Java 1.6.15 and 1.6.16 it will give you a class def not found exception without doing any thing.
    When running locally with Java 1.6.14, it will not experience any trouble.
    This applet needs permissions to open sockets and store data on the harddrive.
    Probably due to the presence of class files that once existed outside of the jars, but are now not thereClose ... the application is made up of a main jar (our product) and a number of third party jars. The manifest for the main jar properly references the other jars, and works in all JVMs before 1.6.15. As of 1.6.15, none of the classes from the referenced jars can be opened.
    I found that I can work around the problem by placing all classes into a single jar ... which may infringe on licensing requirements for some of the third party jars we use.
    Dave

  • Where to find .jar files so I can implement import java.util.logging

    I'm trying to figure out how to take an application built for Websphere and port it to WebLogic. I've come across this blog entry http://blogs.sun.com/fkieviet/entry/using_java.util.logging_in_bea_weblogic and would like to try creating and using the startup class.
    I have not been able to find the correct jar files.
    import weblogic.common.T3ServicesDef;
    import weblogic.common.T3StartupDef;
    import weblogic.logging.LoggingHelper;
    In reading the documentation on using the NonCatalogLogger APIs at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/i18n/writing.html I also see some code calling for the following imports
    import weblogic.jndi.Environment;
    import weblogic.logging.NonCatalogLogger;
    1. Does anyone know where I can grab these?
    2. There must be a strategy for finding these .jars that people use. If so, what is it?

    I thought I understood you, but the more I look at what you've set here, I'll just be honest and admit that the I don't know what you are saying here:
    'You should be able to add the "weblogic.jar" in the WebLogic distribution to your classpath.' - What doe this mean?
    1. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add external JARS and navigate to the weblogic.jar
    2. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add Library and try to go from there?
    3. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add Variable and try to go from there?
    4. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath and do something else?
    5. Something else?
    Also, I don't know what you mean here:
    'You don't need to (and you shouldn't) copy that jar file, just have it in your compilation classpath. It will be present automatically at runtime.'
    Sorry for being so simple here but I've been trouble shooting why I can't follow what look like pretty simple steps to implement over-riding the ApplicationLifecycleListener Class to use existing java.util.logging.Logger code by adding the following to the the weblogic-application.xml:
    <wls:listener>
         <wls:listener-class>com.qualcomm.weblogic.log.listener.UtilLogWrapper</wls:listener-class>
    </wls:listener>
    And including as a referenced jar file, a simple POJO class instance of com.qualcomm.weblogic.log.listener.UtilLogWrapper.
    My resrouces for this are:
    1. http://blogs.sun.com/fkieviet/entry/using_java.util.logging_in_bea_weblogic.
    2. http://www.oracle.com/technology/pub/articles/drolet-ant.html.
    Maybe my weblogic.jar is at the root of the problem.
    I hope you can 'dumb this down' for me with a simple explanation of steps to do what you outlined above.

  • JNLP jar (re)download

    Hello All ,
    I might be having a fundamental misconception here ; if so , please help me put it right.
    I have a JNLP file which is automatically generated (automatic here actually indicates that a script will populate a particular field in the file (which holds references to some jar files). The rest of the file does not change)).
    I am using the <version> attribute of the <jnlp> tag to indicate the version of the application.
    My expectation is that each time this version attribute changes , the .jnlp file wlil be re-downloaded and also will be re-downloaded each of the jar files it references.
    Below is a representative code sample :
    <code>
    <?xml version="1.0"; encoding="utf-8"?>
    <jnlp
    spec="1.0+";
    codebase="$$codebase"
    href="$$name"
    version="%VERSION%">
    <!-- version to be filled in by a script-->
    <information>
    . <!-- Some information here -->
    </information>
    <security><all-permissions/></security>
    <resources>
    <j2se version="1.6+"; initial-heap-size="32m" max-heap-size="512m" />
    <jar href="my.jar";/>
    <jar href="my2.jar";/>
    <property name="property1" value="value1" />
    <extension href="another.jnlp"; /> <!-- another .jnlp contains a list of jars that is generated by another script -->
    </resources>
    <application-desc main-class="my.main";/>
    </jnlp>
    </code>
    The following scenario is what I am trying to implement :
    a)Deploy the jnlp application on a server and access it by using http://localhost:XXXX/myapp
    b)It downloads and installs and runs.
    c)I close the app.
    d)I now change one of the jar files referenced in another.jnlp and also some contents in my.jar and my2.jar.
    e)I now repeat steps a) and b) (the .jnlp files "version" attributes are updated accordingly)
    EXPECTATION : The jnlp file is re-downloaded and so are all the referenced jars[of particular interest my2.jar and any referenced jars in another.jnlp].
    OBSERVATION : The jnlp file is re-downloaded but the OLD jars are still being used (I know its the old jars because I change something in the jar on the server and the change is not reflected in the client browser).
    If I clear the java cache by doing a "javawas - uninstall" , I get the behaviour I seek in EXPECTATION ; however I do not want to clear the cache everytime I update some jar or other ; I want jnlp to detect that a jar has changed and re-download it.
    How do I go about achieving this?

    elie_nasrani wrote: I have a JNLP application which will run over internet , my problem is that anyone can go to the url and launch the application and download all the jars, before even logging in, i'm worried about using this for Denial of service.
    is there a way that i can control the jar files download time, like only download the necessary jar first and when jars are needed will be downloaded eventually
    Web start offers lazy downloads, as well as the DownloadService* (DS) to help with this kind of problem.
    'Lazy' means the resource is only downloaded when needed, but using the DS offers even greater control, even to the extent of manually blocking a download - if needed.
    * e.g. of the Download service, be sure to follow the links.
    <http://www.physci.org/jws/#ds>
    As far as 'signing' goes, I cannot imagine how that would help for your problem. Not only are signed Jar's (at least slightly) larger, but they can also be used by JWS apps. coming from other domains! If your app. is sandboxed, I strongly recommend keeping it as unsigned code.
    Why is your JNLP file exposed to the general public? Don't the users have to log in before they can get to the page with link to the application JNLP?
    If that is the case, the only chance for users who are not logged in to launch it, is if a friend sends them a direct link to the JNLP file.
    As an aside, I generally do not have time to look at posts with no 'dukes' assigned (see links at upper left), if getting a solution is important to you, it is a good idea to add some.

  • Mounting jar

    Hi, I had problems with a upper function of EJBQL weblogic 8.1, then, I found a
    patch, when I made the test with the class that had the problem it's works, but
    then I put the jar in workshop's classpath the error persists, the IDE does not
    see the patch. Can you tell me how I must put the jar in my IDE? exist an special
    procedure?
    Thanks in advance,
    monica a.

    same problem as I had today. You have to preverify your program. The Sun Studio doesn't do this automatically. I haven't found out how to achieve it, maybe it is a feature for MIDlet Suites only, like obfuscating and packaging. But you can take your code and put it in the Wireless Toolkit and build it. There it gets preverified and is able to run, even with the referenced jar ;-)
    hth
    Kay

  • Create single JAR for deployment

    How can I create a single JAR file from within the JSE 8 IDE?
    I want to add the JARs from my libraries. I thought I read about "recipes". Is this a feature from a prior version?

    The java projects which are in the general category under the new project wizard create jar files as a result of a project build. The jar file will be under the dist directory in the project file. Referenced jar files will not be included for a java project. You could do this by overriding targets in the build.xml file. This typically delegates to build.impl but the target which creates the jar could easily be overridden to accomplish this.

Maybe you are looking for

  • Infinity - BT Lack of real communication

    I see KerryG has several posts on Infinity and why so many people can’t get it. These seem to be standard excuses and frustrating for people wish to plan their communications needs.  I am looking at Satellite broadband as a way of exceeding BT’s path

  • Purchase goods receipt base on components

    Dear Guru , We have one requirement which is the purchase goods receipt is base on sales bom components level . For instance , in system we have A material number and it have 3 sales bom components : B , C and D . And we created one Purchase Order on

  • Can't Create Mail Accounts in 10.8.2

    I use 3 mail accounts on my Mountain Lion 10.8.2 mail application. Recently, I re-installed the OS recently as I upgraded my HDD to an SSD and since then have not been able to re-configure 2/3 mail accounts. I have a hotmail account which I cannot co

  • Error in xalan

    Hello, I have a strange problem... I have a XML and a XSL. Sometimes it works, sometime not.... I'm working with xalan 2.3.4 here is my XSL:<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0"     xmlns:xsl="http://www.w3.org/1999/XSL

  • Photoshop CS5 Welcome Screen

    Hi all, Since installing CS5 Web Premium, the Welcome Sceen does not display and I cannot find how to get it back. I like having the Welcome Screen displayed at startup, and normally (all other CS5 programs) to get it back you go to the "Help" menu a