Specifying the version of dependent jar file?

Hi all
At the moment I am fighting with some class loading issues in a J2EE Appcontainer... Acutally the app server uses a different version of a jar file than my application.. Now the classloader always uses
the already loaded classes of the AppServers jar Version instead of those that I want..
I have my application together with the dependent jar packaged together into one jar file... In the manifest I lsit the dependency...
Now my question is if its possible to explicitly state the version of the package that my jar is dependent of...
Any help would be appreciated
regards
tom

Vijay
Acutally I just read through the thread. Actually what I am working on is an J2EE App Containing a couple of EJB (2.0) components in different jars, some utility jars and 2 Wars. All this is packaged together into an ear.
Now Actually the basic structure is like:
Ear
--> WAR1
--> webinf containing classes and manifest with dependent jars
--> War2
--> EJB Jar
--> metinf containing deployment desc and manifest where the manifest references JDom-b10.jar on the classpath
--> Also conatiner JDom-b10.jar
Acutally the JDom.jar is already loaded by the Application Server (Jboss 3.2.3) in its bootstrap loader... I need to have the b10 as otherwise some other 3rd Party stuff of the Ejb is not running...
Now I expected the classloader to prefer the direct deployment unit against all parents and delegating loader... but it doesnt:
15:17:04,011 INFO [STDOUT]
org.jdom.Document(1bb8ea).ClassLoader=org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
..org.jboss.system.server.NoAnnotationURLClassLoader@e3b895
..sun.misc.Launcher$AppClassLoader@e80a59
....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/
....file:/C:/Entwicklungstools/abaXX/components36/lib/3rdparty/oracle9iR2.jar
....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/lib/tools.jar
....file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/bin/run.jar
..sun.misc.Launcher$ExtClassLoader@1ff5ea7
....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/dnsns.jar
....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/ldapsec.jar
....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/localedata.jar
....file:/C:/Entwicklungstools/j2sdk_1.4.2_03/jre/lib/ext/sunjce_provider.jar
++++CodeSource: (file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/lib/jdom.jar <no certificates>)
Implemented Interfaces:
++interface java.io.Serializable(f62373)
++++ClassLoader: null
++++Null CodeSource
++interface java.lang.Cloneable(13e8d89)
++++ClassLoader: null
++++Null CodeSource
This above is a small JBoss utility acutally printing out the watched URLs of the CL and the Codesource of a class... .. Now actually the classloader shouldn't use the Jdom.jar mentioned as source but the one listed here:
15:16:24,308 INFO [EJBDeployer] nested deployment: file:/C:/Entwicklungstools/jboss-3.2.3_tomcat-4.1.24/server/tebs/tmp/deploy/tmp27652tebs-0.1-SNAPSHOT.e
ar-contents/tebs-migration-0.1-SNAPSHOT.jar-contents/jdom-b10.jar
Actually I think the problem is pretty close to the thread you mentioned before... AFAIK the classloaders in J2EE Containers have to prefer the direct deployment unit (in this case the jar and its content) to any other parent class loaders files... I also thought that there can be mulitple versions of a class file in one VM an that the appserver has to preserve every app from using a class of another app... So that there is some housing principles....
As I could not figure out how to solve this I came to the question regarding versioning... As both JDom.jars contain version information this would solve my probem... But as you already mentioned AFAIK there is only support to give some verision informationen about a jar in the manifest but nothing mentions that you can explicitely request a specific version.
So If anyone has a clou how I get that crapp working I would be very thankful
Tom

Similar Messages

  • How do you know the version of a JAR file ?

    how do you know the version of a JAR file ?
    is it what is written on MANIFEST.MF ?
    for example i have a JAR file
    whose MANIFEST.MF has this
    Manifest-Version: 1.0
    Created-By: Ant 1.4.1so, whats the version of this JAR ? 1.0 ?

    anyway, that was JSTL..jar.
    Now, come to another JAR file....
    whose MANIFEST.MF has......
    Manifest-Version: 1.0
    Created-By: Apache Ant 1.5.1
    Extension-Name: Struts Framework
    Specification-Title: Struts Framework
    Specification-Vendor: Apache Software Foundation
    Specification-Version: 1.1
    Implementation-Title: Struts Framework
    Implementation-Vendor: Apache Software Foundation
    Implementation-Vendor-Id: org.apache
    Implementation-Version: 1.1
    Class-Path:  commons-beanutils.jar commons-collections.jar commons-dig
    ester.jar commons-logging.jar commons-validator.jar jakarta-oro.jar s
    truts-legacy.jarso, How do you believe whats the version now ? do u go with the comment "Manifest-Version: 1.0" or "Specification-Version: 1.1" ?
    definitely, you would go with the "Specification-Version: 1.1" and declare this JAR as STRUTS 1.1
    hmmm, so, if nothing is mentioned like above should we follow the MANIFEST version as the JSTL version ? in my earlier example i did not find any comment on ""Specification-Version" ......so , if anybody gives me that JAR , how do i decide whether its 1.0 specification or 1.1 specifucation compliant ?
    can you tell whats the JSTL version of my earler example JAR file ?

  • Unable to resolve setting of dependent jar file in ear

    Hi,
    I have an .ear file which as an ejb.jar and dependent.jar file. Now i set the classpath in MANIFEST.MF of ejb.jar and tried to deploy in weblogic server7.0 but my ejb is not able to identity my dependent.jar its throwing class not found error. I even tried setting up classpath even @ my MANIFEST.MF of ear also. still not able to resolve.
    So let me know does dependent.jar in ear is suppoted are not?

    Hello Sanjay,
    This should work without any problems. Can you provide your manifest.mf file?
    Meanwhile, refer to the following link for more documentation about WebLogic classloading
    and how to specify a manifest.mf file to do what you're trying to achieve:
    http://edocs.bea.com/wls/docs70/programming/classloading.html#1073491
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    Sanjay <[email protected]> wrote:
    Hi,
    I have an .ear file which as an ejb.jar and dependent.jar file. Now
    i set the classpath in MANIFEST.MF of ejb.jar and tried to deploy in
    weblogic server7.0 but my ejb is not able to identity my dependent.jar
    its throwing class not found error. I even tried setting up classpath
    even @ my MANIFEST.MF of ear also. still not able to resolve.
    So let me know does dependent.jar in ear is suppoted are not?

  • Why so many dependent jar files?

    Crystal Report needs too many dependent jar file. What is the alternative way to minimize dependent jar files or club together as one jar?
    Thanks,
    Venkat

    If you're using the Java Reporting Component (JRC), then I recommend upgrading to the newest version - [Crystal Reports For Eclipse 2.0|https://www.sdn.sap.com/irj/boc/crystalreports-java], where the number of jars are significantly decreased.
    The reason why 11.5 had so many Jars was that the JRC and RAS and Enterprise SDKs shared libraries, and so the jar files were broken down along functional lines.
    Since CR4E 2.0 is a separate stream, the packaging is simpler.
    Jar file count dependencies is always a touchy thing - break it down along functional lines, and there's complaints that there's too many.  Consolidate to a few, and there's complaints that the files are too large, and why can't it be broken down into smaller jars?
    Sincerely,
    Ted Ueda

  • Used to convert all my videos into iPhone mp4 format using Any Video Converter - then add it to my iPhone 3GS. But last few days, I cant add video files to iTunes. and the iTunes doesnt even specify the reason except for that "files are not supported"

    Everyting was perfect earlier. Used to convert all my videos into iPhone mp4 format using Any Video Converter - then add it to my iPhone 3GS. But last few days, I cant add video files to iTunes. and the iTunes doesnt even specify the reason except for that "files are not supported"
    Everything is fine.
    -They are the right format
    -Quicktime is updated
    -I have tried simply dragging them into the 'movie' library
    -I have tried going to file<add file to library
    Nothing works, has anyone else had this problem and found a way around it?
    Any and all help appreciated.

    In addition to Mike's suggestions,  you only have 4GB of RAM and Mavericks does use more RAM than other versions. You may also want to look at the apps that startup on login and the possiblity of upgrading RAM.

  • An error occured while trying to copy the needed DB driver jar files

    When I try to run my web app, I see this error in the Output window.
    Creator will also put up a window essentially saying that I don't have a particular
    data source. But I do have that very data source there.
    The error seems to be pointing to this line in my build-impl.xml file
    <nbdeploy debugmode="false" clientUrlPart="${client.urlPart}" forceRedeploy="${forceRedeploy}"/>

    I'm using postgresql-8.1-404.jdbc3.jar
    I started this project with Creator2, so I don't know if the nbproject files
    are out of date or anything.
    Here's the output text:
    init:
    deps-module-jar:
    deps-ear-jar:
    deps-jar:
    Copying 1 file to /home/tc/dev/oms/src
    library-inclusion-in-archive:
    library-inclusion-in-manifest:
    Copying 1 file to /home/tc/dev/oms/build/web/WEB-INF/classes
    load-project-properties:
    installGraphics:
    installLayouts:
    compile:
    compile-jsps:
    pluto-hack-web-xml-run:
    portlet-container-deploy:
    jsCreatorDist:
    run-deploy:
    An error occured while trying to copy the needed DB driver jar files.
    Deployment error: An error occured while trying to copy the needed DB driver jar files.. See the server log file for details.
    Exception=Deployment error: An error occured while trying to copy the needed DB driver jar files.. See the server log file for details.
    Deployment error: An error occured while trying to copy the needed DB driver jar files.. See the server log file for details.
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:198)
    at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:75)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
    at org.apache.tools.ant.Task.perform(Task.java:364)
    at org.apache.tools.ant.Target.execute(Target.java:341)
    at org.apache.tools.ant.Target.performTasks(Target.java:369)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
    at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
    at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:242)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
    Caused by: An error occured while trying to copy the needed DB driver jar files.
    at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:139)
    ... 10 more
    /home/tc/dev/oms/nbproject/build-impl.xml:799: Deployment error: An error occured while trying to copy the needed DB driver jar files.. See the server log file for details.
    BUILD FAILED (total time: 7 minutes 21 seconds)

  • Where the javaws stores downloaded jar files?

    I met problem to start jnlp file in command line. System shows me error like "file system is full". So, I wonder where the javaws stores downloaded jar file. And how can I change it to an available directory. Thank you.

    >
    I met problem to start jnlp file in command line. System shows me error like "file system is full". So, I wonder where the javaws stores downloaded jar file. And how can I change it to an available directory. >- Open the [Java Control Panel|http://java.sun.com/docs/books/tutorial/information/player.jnlp].
    <if necessary>
    - Close the application viewer/Change to the 'General' tab
    </if necessary>
    - Click the Temporary Internet Files 'Settings' button.
    - Click the 'Change' button to move the cache, and follow the prompts
    Of course, in that same dialog are controls for changing the compression level, and adjusting the maximum size, of the JWS cache - you are probably better off trying that first.

  • How to combine the classes from 2 jar files into 1?

    Hi there
    I have got 2 jar files with the same name but the classes that they contain are different. So, I want to combine those 2 files into 1. Could anyone please tell me how to add the classes in a jar file to another jar file?
    Thanks for your help!
    From
    Edmund

    The jar utility allows you to extract files as well as put them into a jar. This is in the java docs.
    You might have to hand modify the manifest file if it was hand modified in the first place. All you should have to do is copy the text from one file to another. The manifest will have the same name so you will have to extract to different dirs so it isn't overwritten.
    Steps:
    -Create dir1 and dir2
    -Extract jar1 into dir1, Extract jar2 into dir2.
    -Manually examine manifests and combine if needed.
    -Copy files from one dir to another.
    -Use jar tool to create new jar.

  • What is the advantage of a JAR file?

    what are the advantages of a JAR file?
    is it faster to compile?
    tell me why it does exist...
    thanks

    There should be lots. From the top of my head:
    1) Compressed jar files are faster to download.
    2) Browser only needs to open a single connection to download one jar files instead of multiple class files.
    3) All class files are present at execution instead of being downloaded on a needs-basis which usually causes delays in the applet.
    4) Jar files can be signed.
    5) User doesn't need to juggle around several files at once nor do they need to deal with folders.
    Of course there are disadvantages as well so you should weigh your options before diving in.

  • Apps 11.5.10.2: change the digital signature in jar files

    Hi,
    if you you change the digital signature in jar files, what needs to be updated? Regenerate all forms etc?
    This is Apps 11.5.10.2 on AIX.
    Thanks,
    Helmut

    You only need to regenerate all product JAR files via adadmin.

  • How to dynamically find the dependent jar files on user's PC

    I've written an application to deal with JTAPI. Unfortunately the implementations by vendors are different in terms of file names. Ideally I'd like to load jars based upon what's installed, e.g. load jtapi.jar when Cisco is installed, or Escjtapia.jar when it's Avaya. The application uses a small subset of JTAPI so different implementations should not yield any different results.
    I edited the manifest file in my jar so that the Class-path has both jar file names for Cisco and Avaya. I didn't enter any path, hoping the CLASSPATH of Windows would be searched, but it is not the case. Also, if other vendors are supported in the future, I might have to add all different file names in the manifest. I don't think the class loader will work in my case, as I may not know the class name at all. I just want to search the system's classpath the find any jar complys to JTAPI and load it.
    Anybody can give suggestions on deployment? Thanks!

    I found it. EXIT_SAPLV01Z_001 does the trick. A package contains many User-Exits, BADIs and enhancement points, so it took me a while to go thru all of them.

  • How to load all the classes in a JAR file at runtime?

    Any clues o:
    "How can I force JVM to load all the classes in a specified JAR at once?"
    Thanx!
    -Rajeev

    Well I was thinking may be there exists an option with "java", when I
    am starting an application from a jar file, I could force it to load all
    the classes in the JAR. I don't want to do it programically. Is there such
    an option available?? Or in other words can I ask JVM to not do the dynamic
    loading for the JAR??
    Thanx.
    List all JarEntries and convert the paths to fully
    qualified class files
    e.g file in jar
    [1] /com/mycompany/proj/X.class
    should become
    [2] com.mycompany.proj.X
    then for each entry issue
    Class.forName( [2] );

  • How to determine the version of xmlparserv2.jar?

    Hi,
    Is there any way I can determine the version of an
    xmlparserv2.jar file?
    I am using XML Parser V2 (xmlparserv2.jar) with the following
    file size: 1,086,234 bytes.
    This was supplied with JDeveloper 3.1 but I have no idea what
    version is it? Any help on this will be appreciated.
    TIA,
    -Piyush

    the class oraxml does not exist in this version of the jar!
    however i do see an entry like: xmlparser_2.0.2.6_production
    when i open the jar file in winzip!
    i have cross verfied with other xmlparserv2 files (diff file
    sizes) and this seems to be it.
    thanks for the suggestion.
    regards,
    -Piyush

  • Getting version information on  jar files

    I want to install the Portal Tools Application from PDK. There are some files to be copied to subdirectories of ORA_HOME. Some of the files like jewt4.jar already exists and according to the install guide you have to leave existing files unchanged when they are newer then the PDK files. To get version information you can ,according to the guide, check if the "Jar file contains a file with a version number , e.g., ...." How do I check this? Why is it not enough to check the last modified date of the files in explorer?

    It's not enough to check the last modified date because this can easily be changed, e.g. by using 'touch'.
    To check for these version numbers, in a unix environment do:
    jar -tvf | grep version
    In a windows env, open the jar file up in WinZip and scroll through the members, looking for a likely candidate.
    Regards,
    Gareth
    (PDK team)

  • How do i specify the filename for a binary file generated by a JSP?

    I am writing a report generator that has the ability to generate Excel files. The user clicks on a link (exporter.jsp), the page's content-type has been set to "application/vnd.ms-excel" which naturally prompts the user to either save to a file or open directly in Excel.
    It works fine, but requires the user to manually rename the generated file from "exporter.jsp" to "whatever.xls". Furthermore, Firefox will not let you rename the file in save dialog box, it just automatically saves the file as "exporter.jsp", you must rename it from the file browser.
    How do specify the output file name from within JSP?
    Btw, right clicking and selecting "save link as" allows for specifying the file name, but the file that is created is empty.
    Thanks

    You need to set the content-disposition header as well as the content-type.
    here is one article on the subject
    res.setContentType("application/vnd.ms-excel");
    res.setHeader("Content-Disposition", "attachment; filename=" + filename);

Maybe you are looking for