Help: manifest class path attribute - OC4J 9.0.3

I have tried everything I can think of. I have even downloaded the developers version of JRun to ensure my code does deploy under the J2EE spec.
Per compleating deployment under JRun, I have migrated back to OC4J and made the approperate modifications to orion-web.xml to include the following entry:
<web-app-class-laoder include-manifest-class-path="true" />
Even with this entry I get the same class not found statements. I am out of ideas.
Anyone got some sugestions?
Info: Ear deployment, static pages deploy under all wars...
Thanks.
Andrew
[email protected]

I have tried everything I can think of. I have even downloaded the developers version of JRun to ensure my code does deploy under the J2EE spec.
Per compleating deployment under JRun, I have migrated back to OC4J and made the approperate modifications to orion-web.xml to include the following entry:
<web-app-class-laoder include-manifest-class-path="true" />
Even with this entry I get the same class not found statements. I am out of ideas.
Anyone got some sugestions?
Info: Ear deployment, static pages deploy under all wars...
Thanks.
Andrew
[email protected]
Hi Andy -
Can you check the attribute and make sure it's the following:
<web web-app-class-loader include-war-manifest-class-path="true"/>
^^^
You have have just typed it in quickly, but I noticed there's a typo in the entry you have above and you are missing the WAR piece of the attribute name.
There's a how-to document on OTN which has an example of this.
http://otn.oracle.com/tech/java/oc4j/htdocs/how-to-servlet-warmanifest.html
cheers
-steve- Hi Steve
Where can I find the zip file I went through the link but doesn't have any link to zip file
Thanks
Ritesh

Similar Messages

  • Who knows about Jar/Manifest: Class-Path-Attribute

    My question is:
    When packaging my classes and ressource files into a jar file, everything works fine as long as I put the manifest-file into the parent directory of the package folders (there's the main class too) and set its Class-Path-Attribut just as . (a dot).
    I'm working with WinXP Prof.
    As soon as I fill in a path with backslashes or slashes as separator, the produced jar-file doesn't work (class loader does'nt find main-class).
    Is the problem the drive-letter (D:) in the path or do you know something else?
    Greetings
    Frank

    Yes, and likely the . is what you need ...saying: I want the packages which begin in the same directory as the jar running this application. Even if your class is in a package hierarchy like tst.test.Support.class, if the directory tst is in the same directory as the application jar, you would use classpath . not tst/test/Support.class. If you put the tst package in a directory under the folder where the jar resides, say called testit ...you would then have a classpath in the mainifest like testit/. The class path always needs to get you to the root of any package you want to use ...but not into the package itself. Java recognizes when it is looking at a package nesting due to the package declaration syntax in the files, the classpath just points to the location of the root of that package and nothing more. Does this make sense?

  • Manifest Class-Path: attribute setting

              Hi there,
              Though the classpath entry is made it is not reacting as expected...Need help
              in understanding the classpath attribute behaviour on web Logic Server 7.0...
              how do I make a jar file inside a war file(war/WEB-INF/lib)refer another jar file
              outside this war.
              

    You looked into the Jar section of the Sun tutorial did you?

  • Class-path attribute & exploded structure

    hi all,
    I've got an exploded app and I'm trying to deploy a session bean
    which has some dependencies on other helper classes.. I've wrote a manifest file
    and I've specified the class-path attribute, but I still get java.lang.NoClassDefFoundError..
    I wonder if manifest file is working for an exploded structure...
    did anybody tried that ?
    thanks for your time,
    cheers

    Manifest classpath (aka JAR dependencies) is a J2EE 1.3 concept. Expect to see it when iAS supports J2EE 1.3.

  • Alternate drives in Jar file Class-Path attribute

    Hello, all. I am working on a project that I would like to package into a single jar file for simple execution. At my place of work classes from EJB are stored on a different drive from where I am doing the development. I am having trouble accessing those classes from the Jars I am creating. When I try the following manifest:
    Main-Class: MyPackage.MyClass
    Class-Path: U:\someFolder
    the application will not start, saying that MyPackage.MyClass cannot be found. This is despite MyPackage.MyClass being properly packaged into the Jar file, as verified by a jar t operation. When I leave off the drive letter in the Class-Path attribute:
    Main-Class: MyPackage.MyClass
    Class-Path: someFolder
    the application starts and executes properly right up until a class from someFolder is needed, at which point exceptions begin to be thrown.
    Any ideas will be much appreciated!
    John Todd

    I was eventually able to find the answer to my own question: Jars do not accept absolute paths at all, only relative paths. Thus, the alternate drive approach will not work. Fortunately I was able to find an alternate solution.
    John Todd

  • Multiple Class-Path: attributes in Jar files

    Hello,
    I'm packaging a set of jar files for distribution with Class-Path: attributes in them. In the documentation I read and in one of the java trails it said that I could have a manifest file like:
    Class-Path: log4j.jar log4j-core.jar
    Class-Path: jsse.jar jcert.jar jnet.jar
    But this doesn't work. It only works when I do this:
    Class-Path: log4j.jar log4j-core.jar jsse.jar jcert.jar jnet.jar
    Here is how I'm running the jar:
    java -jar server.jar
    Is the documentation wrong? Or this is a bug?
    thanks
    charlie

    Certain attributes were only meant to be specified once. Like Main-Class and Class-Path for example. If these were listed two or more times, then the last occurance is the one that gets recognized (basically, each new instance overwrites the previous instance). Some attributes are listed as "per-entry" and are freely duplicated for each entry. For example signed jars could have a number of Name: and xxx-Digest: attributes.
    This link is to the manifest spec:
    http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html
    To answer the original posters question, the doc's are in error. Actually, the error was not in the docs, it was in the tutorial, but none the less its still in error. He could have done this:
    Class-Path: log4j.jar log4j-core.jar
    jsse.jar jcert.jar jnet.jar
    ^-- two spaces before the start of jsse.jar
    because the docs allow for line continuation (although it's not exactly clear if you read the docs). The docs are also apparently in error regarding the max line length of 72 bytes. I have tested this with over 100 char's on a win32 machine and it works fine for me. The limitation must therefore apply to some other operating system, or it could just be in error.
    -Ron

  • Jar Class-Path attribute configuration problems

    java version 1.5.0_14
    OS: Windows Server 2003
    Problem description: Executable jar file needs to access external jar file resources on the same server that executable jar file resides.
    Scenario: Executable jar file resides in a directory called c:\Java. External jar file resides in a directory called c:\Java\itext1
    I have attempted configuring the Class-Path attribute in the manifest with the following:
    java/itext1/itext1.jar or entering itext1/itext1.jar
    I receive the following error message, from the java command:
    c:\>java -jar /java/MyJar.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: com/lowagie/text/pdf/
    BaseFont
    I even unpacked the jar file, to see if I could access the class using the following command below (The class does not have a main method, so I did not expect it to execute, but I would have thought the class would have been located)
    C:\>java java/itext1/com/lowagie/tools/BaseFont
    Exception in thread "main" java.lang.NoClassDefFoundError: java/itext1/com/lowa
    ie/tools/BaseFont
    I am at my wit's end. Does anyone have any suggestions?

    The -jar flag tells the interpreter that the application is packaged in the JAR file format, and to my knowledge, has nothing to do with the classpath attribute within the manifest
    At any rate, I found my problem. When packaging the jar via Eclipse, I had 2 .classpath resource files within the project, which was causing the jar fiile to be built incorrectly.

  • J2EE Packaging and manifest Class-Path:

    Does anyone know if Weblogic 6.0 supports the redefined deployment extension mechanism
    that makes use of the 'Class-Path:' entry in the manifest files?
    In our project we have one single .ear file containing a couple of EJB's (.jar
    files) and a Web Application (.war file).
    We are using log4j as logging mechanism and we would like to keep everything in
    the .ear file so that we can make hot-deploys. So we are trying not to make use
    of the classpath in startWebLogic.sh. All of our EJB's and the Web Application
    makes use of log4j.jar. My question is; can I do the following and make it work
    in Weblogic 6.0?
    1. In every EJB .jar file I add the follwing to the manifest file - "Class-Path:
    log4j.jar"
    2. I place the log4j.jar in the root directory of the .ear file.
    By doing this I expect that the ear classloader loads the log4j.jar classes. Am
    I right or do I do something wrong. At least it does not seem to work.
    Using Weblogic 6.0 without service pack.
    Thanks,
    Steen

    This does not work in WebLogic 6.0. It's supposed to be supported in 6.1
    Daniel
    -----Original Message-----
    From: Steen Laursen [mailto:[email protected]]
    Posted At: Wednesday, August 08, 2001 1:32 PM
    Posted To: environment
    Conversation: J2EE Packaging and manifest Class-Path:
    Subject: J2EE Packaging and manifest Class-Path:
    Does anyone know if Weblogic 6.0 supports the redefined
    deployment extension mechanism
    that makes use of the 'Class-Path:' entry in the manifest files?
    In our project we have one single .ear file containing a
    couple of EJB's (.jar
    files) and a Web Application (.war file).
    We are using log4j as logging mechanism and we would like to
    keep everything in
    the .ear file so that we can make hot-deploys. So we are
    trying not to make use
    of the classpath in startWebLogic.sh. All of our EJB's and
    the Web Application
    makes use of log4j.jar. My question is; can I do the
    following and make it work
    in Weblogic 6.0?
    1. In every EJB .jar file I add the follwing to the manifest
    file - "Class-Path:
    log4j.jar"
    2. I place the log4j.jar in the root directory of the .ear file.
    By doing this I expect that the ear classloader loads the
    log4j.jar classes. Am
    I right or do I do something wrong. At least it does not seem
    to work.
    Using Weblogic 6.0 without service pack.
    Thanks,
    Steen

  • Classloader isolation and jar manifest Class-Path headers

    I have a system where I am loading a set of jars, each with its own URL classloader. So, Jar a is loaded by Loader A, jar b is loaded by Loader B, and so on.
    Each jar has a Manifest Class-Path entry declaring its dependence on other jars. So in the example above, a puts c.jar in its Class-path, and, let's say, b also puts c.jar in its Class-path, unbeknownst to a.
    Let's say there's a class Foo in c.jar. I want--need--it to be the case that (loader of a.jar == Foo.class.getClassLoader()) from the perspective of classes found in a.jar, and (loader of b.jar == Foo.class.getClassLoader()) from the perspective of classes found in b.jar.
    That is, I want a and b to have their own isolated "copies" of c.jar.
    Instead, what I'm finding is that Foo.class is loaded once, and his loader "leaks" over to the other jar's loader, if that makes any sense.
    Is there any way to accomplish what I am talking about here?
    Laird

    As I understand the question - no.Hi; I think you misunderstand the question.
    The classes are being loaded by the system loader.
    Thus there is no way to seperate them.
    If you want them seperate then you must use an
    explicit class loader to load them.I am using explicit loaders to load them. Let me try again, because I don't think I was clear.
    I have an application that has, let's say, nothing at all in its classpath. That is, it was invoked via "java ApplicationMainClass". No classpath.
    Now that application reads, let's say, a properties file containing a list of URLs that point to jars.
    Now the application creates a new URLClassLoader for each such URL. So if the mythical properties file has ten lines, then I create ten classloaders, each of which points to one and only one URL.
    My problem is, even classes loaded by these isolated, separate classloaders are "leaking" across to other loaders. Remember, the parent classloader of all of these classloaders can't see the jars. Its classpath was empty, remember?
    The issue is that the findLoadedClass() method of java.lang.ClassLoader scans the whole VM to see if a given Class was loaded before, and if it was, then by default that Class is simply returned. But I don't want that behavior.
    Now, I also don't want the behavior of having to load the silly things off disk each and every time. So how do I retain this true multiple classloader isolation?
    Thanks,
    Laird

  • Manifest class-path does not works

    Hi,
    We use Jrockit 1.4.2 (latest) on Solaris.
    We found that manifest class-path does not seems to work, we got classdef not found messages.
    If we change the JVM to sun 1.4.2 that everything works perfectly.
    Manifest:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.5.2
    Created-By: 1.4.1_02-b06 (Sun Microsystems Inc.)
    Implementation-Title: com.clarify.igb.common.ejbserver
    Implementation-Version: 12.5.000
    Implementation-Vendor: Amdocs Inc.
    Specification-Title: ClarifyCRM Business Object Infrastructure
    Specification-Version: 12.5.000
    Specification-Vendor: Amdocs Inc.
    Class-Path: ClfyShared.jar ClfyCbo.jar ClfyClient.jar ClfyWebInf.jar C
    lfyiSupport.jar ClfyUtil.jar jdom.jar ClfyCommon.jar ClfySales.jar Cl
    fymOrder.jar ClfyiAdmin.jar ClfyBilling.jar ClfyBillingManager.jar Cl
    fyEmailProcessor.jar
    What can be the problem?
    Regards.,
    LJ

    Hi Jaejun,
    a.jar should also have a MANIFEST.MF Class-Path refering to b.jar.
    HTH
    Regards,
    Slava Imeshev
    "Jaejun Lee" <[email protected]> wrote in message
    news:3e541ede$[email protected]..
    >
    I meant <CRLF> not <CR> only.
    Thank you.
    "Jaejun Lee" <[email protected]> wrote:
    Ravinder Pal <[email protected]> wrote:
    I have read all message posted in this regard but my problem still
    remain.
    Please read the context to give me some pointers.
    myapp.ear contains
    - myejb.jar contains
    - manifest with Class-Path a.jar b.jar
    - a.jar (Internal)
    - b.jar (Some external Vendor)
    Problem: Call from a.jar classes which reference b.jar classes doesraise
    a ClassNotFoundException.
    Thanks.
    I have a similar problem with WebLogic 7.0 sp1.
    I have to verify this.
    Dose WebLogic support MANIFEST.MF Class-Path in development-mode.
    Indeed, I just put a.jar and b.jar in application directory.
    I put Class-Path: b.jar<carrage-return> in MANIFEST.MF of a.jar.
    But, a.jar cannot find classes in b.jar.
    Do I have to make EAR?

  • Verify a jar's manifest class-path

    I want to verify a jar file's manifest class-path. By that I mean I want to verify that every import of every class in the jar file is reachable on the classpath specified in the jar file's manifest. I tried using a ClassLoader to load every class in the jar file and that does indeed catch a few errors (imported classes that are not on the classpath), but it does not catch them all -- I have situations where loading the class works fine, but when the code is executed, I get NoClassDefFoundError because an imported class is missing from the classpath. I have tried things like calling getDeclaredMethod() on the loaded class to sortof force all the imports to be resolved, but that apparently does not work.
    So, can someone tell me how to sortof "force" a loaded class to reference/validate all its imports?
    Thanks,
    Lee

    Well yes, I know that executing the code would do it. But I'm not in a position to execute the code -- I'm doing this during a build and want to verify that I've built all the jars properly and have all the right classpaths. It's actually quite easy to use ANT to compile and create jar files that produce NoClassDefFoundError at runtime, due to leaving needed classes from the jar, or from bogus classpaths in the jar's manifest.
    So, I was hoping there was some other way to do this. Perhaps I need to do something ugly like examining the bytecodes of each method...
    Thanks,
    Lee

  • Javac / Manifest Class-Path

    Hi guys,
    I have problems with javac not finding classes when I use the extension mechanism.
    I have several jars: abc.jar def.jar ghi.jar ...
    To simplify the classpath when trying to compile another project with these jars, I use the extension mechanism and create a new jar (alphabet.jar) containing only a manifest file:
    Manifest-Version:1.0
    Class-Path: abc.jar def.jar ghi.jar ...The following works fine (assuming for example that abc.jar contains org/alphabet/Abc.class):
    > java -classpath alphabet.jar org.alphabet.AbcBut this fails:
    > javac -classpath alphabet.jar Test.java
    Test.java:1: package org.alphabet does not exist
    import org.alphabet.Abc;
    1 errorTest.java:
    import org.alphabet.Abc;
    public class Test {}I've searched on google and co. for more information but could not get anything. Sun's documentation http://java.sun.com/j2se/1.4/docs/tooldocs/findingclasses.html doesn't mention anything about javac not using the extension mechanism.
    This seems to happen on all JDKs (1.2.2, 1.3.1, 1.4 at least).
    Thanks in advance for your help!

    hi again,
    the next what you should know is that a package has to really exist as directories on your harddisk by compile- and runtime and the name of the class-file needs to be the same name as the class-name in it.
    example:
    c:\javalib\org\alphabet\Abc.java
    c:\javalib\Test.java
    compile both with 1 javac-command
    c:\>cd c:\javalib
    c:\javalib\>javac Test.java
    all imported libs (c:\javalib\org\alphabet\Abc.java) will be automatically compiled with this command. you will have now 2 class-files:
    c:\javalib\org\alphabet\Abc.class
    c:\javalib\Test.class
    now you make a 'manifest'-file for creating a autostartable jar-file:
    create a textfile 'mymanifest.txt' (name is not important) in the root of your projekt with the following content:
    c:\javalib\>mymanifest.txt
    Manifest-Version: 1.0
    Main-Class: Test
    Created-By: Your Name
    (if the start-class is in a package you have to write:
    Main-Class: mypackage.Test)
    now you can make a executable jar (a jar with a manifest) with the command:
    c:\javalib>jar cvfm alphabet.jar mymanifest.txt .
    (dont forget the last point!)
    now you can run the jar simply with:
    (it's now a java-executable)
    c:\javalib>java -jar alphabet.jar
    hope to help
    cu
    oliver scorp
    ps: a jar-file is nothing other than a zip-file, rename it and try it out. you will see that the pathes still exist in the compressed file.
    pps: plz dont forget my dukes!

  • Need help with Class-Path and NCDFE

    This isn't a new issue, but I'm getting a variation of a problem a lot of people seem to have had. I was hoping someone out there can help me out.
    I have a jar file (imex.jar) sitting in c:\temp\imextest. I also have another jar file, commons-cli-1.0.jar sitting in c:\temp\imextest\lib.
    I want to run the jar in a standalone manner. My manifest has the following entries.
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.5.3
    Created-By: 1.4.2_01-b06 (Sun Microsystems Inc.)
    Main-Class: com.foo.imex.DirectoryImportExport
    Class-Path: lib/commons-cli-1.0.jar
    I am invoking it using the following command (from c:\temp\imextest)
    java -jar imex.jar -i -f c:\matt\RRBus\jiyun.xml -v
    I get this result:
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
    It seems to me that I have my directory structure and manifest set up correctly, but maybe I don't (as it's not working). Does anyone see what I'm doing wrong here? (the "missing" class is in commons-cli-1.0.jar).
    Thanks,
    Matt

    perhaps jar file needed for parsing is not there in classpath...set it...in the classpath..

  • How do I add the system classpath to Jar Manifest Class-Path

    My application is implemented on win2000 and need to be moved to unix as a executable jar file, the oracle jdbc classes (classes12.zip and classes111.zip) were included in MANIFEST.MF as the following:
    Class-Path: /Oracle/Ora81/jdbc/lib/classes12.zip /Oracle/Ora81/jdbc/lib/classese111.zip
    When I move the jar file to unix, the classpath will be changed, is there a way to make the jar file read the class-path from system CLASSPATH?
    Thank you.
    Y.

    I have the same problem for weeks now, and I can't seem to get it solved. If you found anything please inform me.
    thanks in advance
    Eran

  • Jar's manifest Class-Path option

    Hey, hopefully this is my last question for a while.
    I downloaded a custom look and feel that's packaged in a jar file.
    Here's the directory structure.
    Main-Program\*.class
    Main-Program\MyProgram.jar (the created jar)
    Main-Program\Data\kunststoff.jar (downloaded look&feel jar)
    I can compile the class files like this:
    javac -classpath .;Data\kunststoff.jar MainClass.java
    and run it like this:
    java.exe -classpath .;Data\kunststoff.jar MainClass
    This works fine. But I want my program to be an executable jar.
    So I create the exec. jar like usual
    jar cf0 MyProgram.jar *.class
    jar umf mainclass.txt MyProgram.jar
    When I package the jar using the manifest file I include the Class-Path var:
    Manifest-Version: 1.0
    Main-Class: Database
    Class-Path: .;Data\kunststoff
    Now when I try to execute the jar it gives me the error:
    "Could not find the main class. Program will exit!"
    Any ideas? thanks.

    Manifest-Version: 1.0
    Main-Class: Database
    Class-Path: .;Data\kunststoff>
    Better change that to "Class-Path: Data/kunststoff.jar"
    (http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html)
    And remember to have a line break after it..
    Now when I try to execute the jar it gives me the
    error:
    "Could not find the main class. Program will exit!">
    But the main class should still be found even if the class-path entry was not totally correct, does Database.class show in jar tf MyProgram.jar?

Maybe you are looking for