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

Similar Messages

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

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

  • 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

  • How to add jar file in class path ?

    Hello,
    how can I add jar file in system class path.
    I am using Linux and installed java.
    Now I am creating one java package and working programs.
    I want to add commons-net-2.0.jar jar file into class path.
    how can I add in linux systems.
    Thank you.

    the same way you add anything else to the classpath.

  • 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

  • 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

  • WAR meta-inf/manifest Class-Path jars use which classloader ?

    If using an expanded EAR structure, my Web App requires some utility classes. I
    can either put these in my :-
    meta-inf/manifest.mf
    Class-Path : utility.jar
    OR
    web-inf/lib
    can contain the utility.jar
    Is there any difference in terms of which classloader is used to load these classes,
    the EAR/EJB classloader or the Web App child classloader ?
    What is recommended ?

    If have found out the answer myself by testing it :-
    A jar in the meta-inf/manifest.mf e.g. Class-Path : utility.jar
    will be loaded by the EAR/EJB level classloader
    whereas
    web-inf/lib containing utility.jar
    will be loaded by the Web App level child classloader.
    Dimitri Rakitine <[email protected]> wrote:
    I have this question too - it appears that 6.1sp2 attempts to use Class-Path
    in jars in WEB-INF/lib - what this Class-Path: is supposed to do ???
    Pete <[email protected]> wrote:
    If using an expanded EAR structure, my Web App requires some utilityclasses. I
    can either put these in my :-
    meta-inf/manifest.mf
    Class-Path : utility.jar
    OR
    web-inf/lib
    can contain the utility.jar
    Is there any difference in terms of which classloader is used to loadthese classes,
    the EAR/EJB classloader or the Web App child classloader ?
    What is recommended ?--
    Dimitri

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

  • Jar files and class path

    I have a small swing application which connects to an external database and queries something and creates a small report on the local machine. Running from the command line calling the == java MyClass works good. I would like to deploy this to two other machines. I dont want the use to run from the command line solution. I want to run it from a batch file using the jar file. But I am getting a a classpath issue ( ClassNotFoundException for the jdbc drivers ) . I signed my jar file using jarsigner too. I am not interesed in using the Web Start because there are no other security attached to this app. Only couple of people intends to use it. Running from the command line calling the app file explicitly works. In the batch file I added the setclass path too. Still it gives an exception. I added the jdbc driver jar file to the appication jar file too. Still the problem exists.
    Any ideas ?

    instead of including the JDBC driver inside your application's jar, have the two jars sit in a directory separatly and include both of them on your classpath. Or, you can even specify a manifest.mf Class-Path parameter for your application's jar file so that it automatically includes the driver's jar.

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

  • Problem: Multiple jar files in Class-Path [ IOException: line too long]

    Hello Folks,
    I am trying to create a jar file using the following command:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    My MANIFEST.MF file is as following:
    Manifest-Version: 1.0
    Main-Class: com.gridftp.INSPgridFTP
    Class-Path: lib/activation.jar lib/ant.jar lib/antlr.jar lib/axis.jar lib/castor-0.9.3.jar lib/cog-abstraction-common-2.0.jar lib/cog-abstraction-examples-2.1.jar lib/cog-certmanagement-1.0.jar lib/cog-certrequest-1.0.jar lib/cog-grapheditor-0.46.jar lib/cog-gridfaces-1.0.jar lib/cog-gridshell-1.0.jar lib/cog-jglobus-1.2-050621.jar lib/cog-karajan-0.31.jar lib/cog-provider-clref-gt3_0_2.jar lib/cog-provider-clref-gt3_2_0.jar lib/cog-provider-clref-gt3_2_1.jar lib/cog-provider-clref-gt4_0_0.jar lib/cog-provider-condor-2.0.jar lib/cog-provider-gt2-2.0.jar lib/cog-provider-gt2ft-1.0.jar lib/cog-provider-gt3_0_2-2.0.jar lib/cog-provider-gt3_2_0-2.0.jar lib/cog-provider-gt3_2_1-2.0.jar lib/cog-provider-gt4_0_0-2.2.jar lib/cog-provider-local-2.0.jar lib/cog-provider-ssh-2.0.jar lib/cog-provider-webdav-1.0.jar lib/cog-resources-1.0.jar lib/cog-setup-0.91.jar lib/cog-util-0.91.jar lib/commons-discovery.jar lib/commons-httpclient.jar lib/commons-logging.jar lib/concurrent.jar lib/cryptix32.jar lib/cryptix-asn1.jar lib/cryptix.jar lib/j2ssh-common-0.2.2.jar lib/j2ssh-core-0.2.2.jar lib/jaas.jar lib/jakarta-regexp-1.2.jar lib/jakarta-slide-webdavlib-2.0.jar lib/jaxrpc.jar lib/jce-jdk13-125.jar lib/jgss.jar lib/jug-1.0.1.jar lib/junit.jar lib/log4j-1.2.8.jar lib/mail.jar lib/puretls.jar lib/saaj.jar lib/wsdl4j.jar lib/xercesImpl.jar lib/xml4j.jar lib/xml-apis-1.1.jar lib/xmlsec.jar lib/xpp3-1.1.3.4d_b4_min.jar lib/xstream-1.1.1-patched.jar .
    The grid-jar directory structure is:
    | - com -- all classes are under this dir.
    | - lib -- all the required jar files are in this dir.
    There are 59 jar files in the lib directory. When I try to create the jar file, I get the following exception:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    java.io.IOException: line too long
    at java.util.jar.Attributes.read(Attributes.java:356)
    at java.util.jar.Manifest.read(Manifest.java:167)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:904)
    Any idea, why do I get this exception? Is there any restriction as to how many jar files (or characters) can be there in the Class-Path value in the MANIFEST.MF file?
    Please help.
    Thanks,
    Ana

    use as the following way to resolve the problem:
    (1) use separate lines, to avoid too long a line for java package name lists
    (2) type a preceding space before each folloing lines, for example:
    Class-Path: ...jar ...jar ...jar
    ...jar ..jar
    ...jar ...jar
    ...jar ...jar
    Hello Folks,
    I am trying to create a jar file using the following
    command:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    My MANIFEST.MF file is as following:
    Manifest-Version: 1.0
    Main-Class: com.gridftp.INSPgridFTP
    Class-Path: lib/activation.jar lib/ant.jar
    lib/antlr.jar lib/axis.jar lib/castor-0.9.3.jar
    lib/cog-abstraction-common-2.0.jar
    lib/cog-abstraction-examples-2.1.jar
    lib/cog-certmanagement-1.0.jar
    lib/cog-certrequest-1.0.jar
    lib/cog-grapheditor-0.46.jar
    lib/cog-gridfaces-1.0.jar lib/cog-gridshell-1.0.jar
    lib/cog-jglobus-1.2-050621.jar
    lib/cog-karajan-0.31.jar
    lib/cog-provider-clref-gt3_0_2.jar
    lib/cog-provider-clref-gt3_2_0.jar
    lib/cog-provider-clref-gt3_2_1.jar
    lib/cog-provider-clref-gt4_0_0.jar
    lib/cog-provider-condor-2.0.jar
    lib/cog-provider-gt2-2.0.jar
    lib/cog-provider-gt2ft-1.0.jar
    lib/cog-provider-gt3_0_2-2.0.jar
    lib/cog-provider-gt3_2_0-2.0.jar
    lib/cog-provider-gt3_2_1-2.0.jar
    lib/cog-provider-gt4_0_0-2.2.jar
    lib/cog-provider-local-2.0.jar
    lib/cog-provider-ssh-2.0.jar
    lib/cog-provider-webdav-1.0.jar
    lib/cog-resources-1.0.jar lib/cog-setup-0.91.jar
    lib/cog-util-0.91.jar lib/commons-discovery.jar
    lib/commons-httpclient.jar lib/commons-logging.jar
    lib/concurrent.jar lib/cryptix32.jar
    lib/cryptix-asn1.jar lib/cryptix.jar
    lib/j2ssh-common-0.2.2.jar lib/j2ssh-core-0.2.2.jar
    lib/jaas.jar lib/jakarta-regexp-1.2.jar
    lib/jakarta-slide-webdavlib-2.0.jar lib/jaxrpc.jar
    lib/jce-jdk13-125.jar lib/jgss.jar lib/jug-1.0.1.jar
    lib/junit.jar lib/log4j-1.2.8.jar lib/mail.jar
    lib/puretls.jar lib/saaj.jar lib/wsdl4j.jar
    lib/xercesImpl.jar lib/xml4j.jar lib/xml-apis-1.1.jar
    lib/xmlsec.jar lib/xpp3-1.1.3.4d_b4_min.jar
    lib/xstream-1.1.1-patched.jar .
    The grid-jar directory structure is:
    | - com -- all classes are under this dir.
    | - lib -- all the required jar files are in
    e in this dir.
    There are 59 jar files in the lib directory. When I
    try to create the jar file, I get the following
    exception:
    jar -cvfm mygrid.jar MANIFEST.MF -C grid-jar/ .
    java.io.IOException: line too long
    at
    at
    at
    at
    java.util.jar.Attributes.read(Attributes.java:356)
    at
    at
    at java.util.jar.Manifest.read(Manifest.java:167)
    at
    at
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:904)
    Any idea, why do I get this exception? Is there any
    restriction as to how many jar files (or characters)
    can be there in the Class-Path value in the
    MANIFEST.MF file?
    Please help.
    Thanks,
    Anajust

  • Jars in the class path of a custom component

    I am using the dom4j-1.6.1.jar library in a custom component, but my JBoss server has dom4j.jar in jboss\server\all\lib.  My custom component is throwing the following error:
    DefFoundError message:org/dom4j/xpath/DefaultXPath while invoking service XmlToCsvService and operation convert and no fault routes were found to be configured.
    This makes me suspect that the version of Dom4J in the lib directory of the server is taking precedence over the one in my component.  Any suggestions for how to deal with this?  Thanks.
    Jared Langdon

    Even Marcel's suggestion may not always work, but it certainly is worth a quick try.  I seem to remember trying that and finding that one of the LiveCycle EAR files has a version of dom4j buried inside it (I don't remember which version of LC it was).
    Of course altering an Adobe supplied EAR is not recommended and may violate your support ageement. There is an alternative, however; if changing the JBoss lib folder doesn't work.  To avoid the conflict you can use JarJar to rename the packages within the DOM4J class and deploy the renamed jar with your component to avoid the conflict.
    http://code.google.com/p/jarjar/
    You would then use the renamed classes in your component:
    import org.mypackage.dom4j.Document;
    import org.mypackage.dom4j.DocumentException;
    import org.mypackage.dom4j.DocumentHelper;
    import org.mypackage.dom4j.Element;
    import org.mypackage.dom4j.Node;
    import org.mypackage.dom4j.io.DOMReader;
    import org.mypackage.dom4j.io.DOMWriter;

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

Maybe you are looking for

  • BI IP-Characteristic Relationship- invalid combinations are shown

    Dear all, we need to create a query ready for input but we need to avoid that the invalid combinations of two characteristic on wors are shown. In fact the system presents the inconsistent combination as not editable. Could you please suggest how to

  • Cleared item not updated in Main Bank Account FEBAN

    Hi Experts, i entered manual bank statement through FF67 and saved it. then i went to FEBAN to view if there was any open item left in this statement so that it can be posted manually. in FEBAN i found not a single open item in this statement which m

  • Can i open a flase file from java application?

    i want that when the user click a button on my java application, a flash file i made (Not html)will be showen .

  • Partner email address

    Hi, I get the popup/dialog when I double click on partner in sales document, there I fill name, email address and other details of the partner. I am able to capture partner name from FM SD_REPRESENTANT_GET_DATA by passing VBPA-PERNR but I'm unable to

  • How do i get rid of the ugly Table?

    Wheni check out my site i see the table. liek i have all my images and then they are all seperated by the table how can i get rid of those lines? THANKS -Bryan