Jar file dependency
* I'm using OC4J 9.0.3 production version.
* I have a question about class visibility.
* I have the manifest file in my App-ejb.jar point to another jar (common.jar) file.
* My App-ejb.jar file is packaged along with my App-web.war file into an ear file.
* The classes in common.jar are not visible to my web layer. Is this a bug?
===============================================================================
My app-package structure:
App.ear
_______App-ejb.jar
_______App-web.war
_______App-common.jar
===============================================================================
Contents of the manifest file in App-ejb.jar:
Manifest-Version: 1.0
Created-By: Auto-gen
Class-Path: Company-common.jar
===============================================================================
There is a typo in the contents of the manifest file. The entry for "Class-Path:" should read:
"Class-Path: App-common.jar"
Similar Messages
-
How to include jar files in ant script for compiling
i am trying to manually include j2ee.jar for compiling, here is the entire build.xml:
<?xml version="1.0"?>
<!--PRIMARY build file for all of dev modual -->
<project name="com" default="compile.all" basedir="../">
<path id="project.class.path">
<pathelement location="lib/"/>
<pathelement path="${java.class.path}/"/>
<pathelement path="${additional.path}"/>
<pathelement path="${CLASSPATH}" />
<pathelement path="${classpath}" />
</path>
<property name="SRCDIR" value="${basedir}/java" />
<property name="DSTDIR" value="${basedir}/classes" />
<property name="LIBDIR" value="${basedir}/libs" />
<property name="JARDIR" value="${basedir}/jars" />
<property name="DOCDIR" value="${basedir}/docs" />
<property name="ORACLE.JAR" value="${LIBDIR}/orcl/8.1.7/classes12.zip" />
<property name="JUNIT.JAR" value="${LIBDIR}/junit/3.7/junit.jar" />
<property name="CLASSPATH" value="z:/tools/java;${SRCDIR};${DSTDIR};${JUNIT.JAR};${ORACLE.JAR}" />
<property name="POLICYFILE" value="${SRCDIR}/com/leader/cti/main/ctimain.policy" />
<property name="DEBUG_FLAG" value="on" />
<property name="OPTIMIZE_FLAG" value="off" />
<property name="DEPRECATION_FLAG" value="off" />
<property name="RMI_VERSION" value="1.2" />
<!-- builds everything -->
<target name="compile.all">
<antcall target="compile.cti"/>
</target>
<target name="compile.vbsf" description="Compiles files for vbsf.jar.">
<mkdir dir="${DSTDIR}"/>
<copy file="${SRCDIR}/VBSFELK5UD3SWQ2E.class" todir="${DSTDIR}"/>
<javac srcdir="${SRCDIR}" destdir="${DSTDIR}" classpath="${CLASSPATH}" debug="${DEBUG_FLAG}" deprecation="${DEPRECATION_FLAG}" optimize="${OPTIMIZE_FLAG}" >
<include name="com/objectmatter/**/*.java" />
</javac>
</target>
<target name="compile.persist" description="Compiles files for persist.jar." depends="compile.vbsf" >
<javac srcdir="${SRCDIR}" destdir="${DSTDIR}" debug="${DEBUG_FLAG}" deprecation="${DEPRECATION_FLAG}" optimize="${OPTIMIZE_FLAG}" >
<classpath refid="project.class.path"/>
<include name="com/leader/persist/**/*.java" />
<include name="testcom/leader/persist/**/*.java" />
</javac>
</target>
<target name="compile.cti" description="Compiles files for both cti jars." depends="compile.persist,compile.cti.only" />
<target name="compile.cti.only" description="Compiles files for both cti jars." >
<javac srcdir="${SRCDIR}" destdir="${DSTDIR}" debug="${DEBUG_FLAG}" deprecation="${DEPRECATION_FLAG}" optimize="${OPTIMIZE_FLAG}" >
<classpath refid="project.class.path"/>
<include name="com/leader/cti/**/*.java" />
<include name="testcom/leader/cti/**/*.java" />
</javac>
<rmic classpath="${CLASSPATH}" base="${DSTDIR}" stubversion="${RMI_VERSION}" >
<include name="com/leader/cti/main/RMICTIService.class" />
<include name="com/leader/cti/main/RMIConferenceCall.class" />
<include name="com/leader/cti/main/RMIConferenceCallReservation.class" />
<include name="com/leader/cti/main/FakeRmiCtiService.class" />
<include name="com/leader/cti/main/FakeRmiConferenceCall.class" />
<!--include name="com/leader/cti/main/DerivedQueueReceiver.class"/-->
</rmic>
</target>
<!-- build all dev jars -->
<target name="jar.all"
description="Create all jar files"
depends="jar.vbsf, jar.persist, jar.jeti, jar.service"/>
<!-- build vbsf.jar -->
<target name="jar.vbsf"
description="Create client distribution jar for vbsf code"
depends="compile.vbsf" >
<mkdir dir="${JARDIR}" />
<jar jarfile="${JARDIR}/vbsf.jar"
basedir="${DSTDIR}" >
<include name="VBSFELK5UD3SWQ2E.class"/>
<include name="com/objectmatter/**/*.class" />
</jar>
</target>
<!-- build persist.jar -->
<target name="jar.persist"
description="Create client distribution jar"
depends="compile.vbsf,compile.persist" >
<mkdir dir="${JARDIR}" />
<jar jarfile="${JARDIR}/persist.jar"
basedir="${DSTDIR}" >
<include name="com/leader/persist/**/*.class" />
</jar>
</target>
<!-- build jeti.jar -->
<target name="jar.jeti"
description="Create client distribution jar"
depends="compile.vbsf,compile.persist,compile.cti" >
<mkdir dir="${JARDIR}" />
<jar jarfile="${JARDIR}/jeti.jar"
basedir="${DSTDIR}" >
<include name="com/leader/cti/rmiint/*" />
<include name="com/leader/cti/main/*Stub*" />
<include name="com/leader/cti/util/**" />
<include name="com/leader/cti/vru/*" />
<include name="com/leader/cti/interfaces/*" />
<include name="com/leader/cti/history/*" />
<include name="com/leader/cti/autodial/*" />
</jar>
</target>
<!-- build jeti_service.jar -->
<target name="jar.service"
description="Create the jar file for the service"
depends="compile.vbsf,compile.persist,compile.cti" >
<mkdir dir="${JARDIR}" />
<copy file="${basedir}/vbsf/cti.schema" tofile="${DSTDIR}/cti.schema" />
<copy file="${basedir}/vbsf/cti.schema" tofile="/tools/java/com/leader/osapplication/persist/cti.schema" />
<jar jarfile="${JARDIR}/jeti_service.jar"
basedir="${DSTDIR}" >
<include name="com/leader/cti/**" />
<include name="cti.schema" />
</jar>
</target>
<!-- build jeti.jar, jeti_service.jar -->
<target name="jar.cti"
description ="Create client/server jars for cti"
depends="jar.jeti,jar.service" />
<!-- clean everything. -->
<target name="clean">
<delete dir="${DSTDIR}" />
<delete dir="${JARDIR}" />
<delete dir="${DOCDIR}" />
</target>
<target name="clean.cti" description="clean cti class files (not jars)">
<delete dir="${DSTDIR}/com/leader/cti" />
<delete dir="${DSTDIR}/testcom/leader/cti" />
</target>
<!-- Run the gui CTI tests -->
<target name="test_cti_gui">
<java classname="junit.swingui.TestRunner" classpath="${CLASSPATH}" fork="yes">
<arg value="testcom.leader.cti.CTIPackageTest"/>
<sysproperty key="leader.unique_number_generator.file" value="unique_number_generator_file_test" />
<sysproperty key="vbsf.repository" value="/tools/java/dev/vbsf" />
<sysproperty key="vbsf.enableGlobalCaching" value="false" />
</java>
</target>
<target name="test.cti.gui"
depends="test_cti_gui" />
<!-- Run the text version of CTI tests -->
<target name="test">
<java classname="junit.textui.TestRunner" classpath="${CLASSPATH}" fork="yes">
<arg value="testcom.leader.cti.CTIPackageTest"/>
<sysproperty key="leader.unique_number_generator.file" value="unique_number_generator_file_test" />
</java>
</target>
<!-- Run CTI service -->
<target name="run.service"
description="run the service normally"
depends="compile.all" >
<java classname="com.leader.cti.main.CTIMain"
classpath="${CLASSPATH}"
fork="yes" >
<sysproperty key="java.security.policy"
file="${POLICYFILE}" />
<sysproperty key="config.dir"
value="${SRCDIR}/com/leader/cti/main/" />
</java>
</target>
<!-- Run fake CTI service -->
<target name="run.service.fake"
description="run the fake service"
depends="compile.all" >
<java classname="com.leader.cti.main.FakeCtiMain"
classpath="${CLASSPATH}"
fork="yes" >
<sysproperty key="java.security.policy"
file="${POLICYFILE}" />
<sysproperty key="config.dir"
value="${SRCDIR}/com/leader/cti/main/" />
</java>
</target>
<!-- Run CTI service emulator -->
<target name="run.service.emulator"
description="run the service normally"
depends="compile.all" >
<java classname="com.leader.cti.main.CTIMain"
classpath="${CLASSPATH}"
fork="yes" >
<sysproperty key="java.security.policy"
file="${POLICYFILE}" />
<sysproperty key="config.dir"
value="${SRCDIR}/com/leader/cti/main/" />
<sysproperty key="vru.propertyfile"
value="emulator.properties" />
</java>
</target>
<!-- Runs the CTI service and emulator -->
<target name="run.emulator"
description="run the service and the emulator"
depends="compile.all" >
<java classname="testcom.leader.cti.vru.emulator.VRUEmulator"
classpath="${CLASSPATH}"
fork="yes" />
</target>
<!-- Runs the gui CONCALL testss -->
<target name="run.gui"
description="run the concall test gui"
depends="compile.all" >
<java classname="testcom.leader.cti.main.SwingClient"
classpath="${CLASSPATH}"
fork="yes" >
<sysproperty key="java.security.policy"
file="${POLICYFILE}" />
</java>
</target>
<!-- Fires the maptool up. Defaults to CTI`s Schema file. -->
<target name="maptool" >
<java classname="com.objectmatter.bsf.mapping.toolgui.MapTool"
fork="yes"
classpath="${CLASSPATH}" >
<sysproperty key="vbsf.repository" value="${basedir}/vbsf" />
</java>
</target>
<target name="javadoc_cti">
<mkdir dir="${basedir}/docs"/>
<javadoc packagenames="com.leader.*" classpath="${CLASSPATH}" sourcepath="${SRCDIR}" destdir="${DOCDIR}\cti" author="true" version="true" use="true" windowtitle="Leader CTI API" doctitle="Leader Technologies, Inc" bottom="Copyright © 2005 Leader Technologies Incorporated.<BR>All Rights Reserved." maxmemory="128m">
<group title="Leader CTI Packages" packages="com.leader*"/>
</javadoc>
</target>
<target name="javadoc_vbsf">
<mkdir dir="${basedir}/docs"/>
<javadoc packagenames="com.objectmatter.* " classpath="${CLASSPATH}" sourcepath="${SRCDIR}" destdir="${DOCDIR}" author="true" version="true" use="true" windowtitle="VBSF by ObjectMatter API" doctitle="Leader Technologie, Inc" bottom="Copyright © 2005 Leader Technologies Incorporated.<BR>All Rights Reserved." maxmemory="128m">
<group title="Objectivity Packages" packages="com.objectmatter.*"/>
</javadoc>
</target>
</project>
i am getting this:
compile.all:
compile.vbsf:
compile.persist:
compile.cti.only:
Compiling 1 source file to C:\Projects\Leader\dev\classes
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:14: package javax.jms does not exist
import javax.jms.*;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:17: package javax.jms does not exist
import javax.jms.Queue;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:18: package javax.jms does not exist
import javax.jms.JMSException;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:19: package javax.jms does not exist
import javax.jms.Message;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:28: cannot find symbol
symbol: class MessageListener
public abstract class BasicMQReceiverAsyncR implements Runnable, MessageListener
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:44: cannot find symbol
symbol : class QueueConnectionFactory
location: class BasicMQReceiverAsyncR
QueueConnectionFactory queueConnectionFactory = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:45: cannot find symbol
symbol : class QueueConnection
location: class BasicMQReceiverAsyncR
QueueConnection queueConnection = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:46: cannot find symbol
symbol : class QueueSession
location: class BasicMQReceiverAsyncR
QueueSession queueSession = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:48: cannot find symbol
symbol : class QueueReceiver
location: class BasicMQReceiverAsyncR
QueueReceiver queueReceiver = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:49: cannot find symbol
symbol : class TextMessage
location: class BasicMQReceiverAsyncR
TextMessage message = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:406: cannot find symbol
symbol : class QueueConnectionFactory
location: class BasicMQReceiverAsyncR
queueConnectionFactory = (QueueConnectionFactory)
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:408: package javax.jms does not exist
queue = (javax.jms.Queue) jndiContext.lookup(QUEUE_NAME); //queue1 = (javax.jms.Queue)jndiContext.lookup("MyQueue1");
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:433: cannot find symbol
symbol : variable Session
location: class BasicMQReceiverAsyncR
Session.AUTO_ACKNOWLEDGE);
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:447: cannot find symbol
symbol : class JMSException
location: class BasicMQReceiverAsyncR
catch (JMSException e)
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:461: cannot find symbol
symbol : class JMSException
location: class BasicMQReceiverAsyncR
catch (JMSException x)
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:482: cannot find symbol
symbol : class BytesMessage
location: class BasicMQReceiverAsyncR
if (m instanceof BytesMessage)
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:488: cannot find symbol
symbol : class BytesMessage
location: class BasicMQReceiverAsyncR
BytesMessage bytesMsg = (BytesMessage)m;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:488: cannot find symbol
symbol : class BytesMessage
location: class BasicMQReceiverAsyncR
BytesMessage bytesMsg = (BytesMessage)m;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:501: cannot find symbol
symbol : class QueueSession
location: class BasicMQReceiverAsyncR
QueueSession queueSession2 = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:502: cannot find symbol
symbol : class QueueSender
location: class BasicMQReceiverAsyncR
QueueSender queueSender2 = null;
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:510: cannot find symbol
symbol : variable Session
location: class BasicMQReceiverAsyncR
Session.AUTO_ACKNOWLEDGE);
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:514: cannot find symbol
symbol : class BytesMessage
location: class BasicMQReceiverAsyncR
BytesMessage bytesMessage = queueSession.createBytesMessage();
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:523: cannot find symbol
symbol : variable DeliveryMode
location: class BasicMQReceiverAsyncR
DeliveryMode.PERSISTENT,
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:524: cannot find symbol
symbol : variable DEFAULT_PRIORITY
location: class com.leader.cti.vru.Message
Message.DEFAULT_PRIORITY,
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:525: cannot find symbol
symbol : variable DEFAULT_TIME_TO_LIVE
location: class com.leader.cti.vru.Message
Message.DEFAULT_TIME_TO_LIVE);
C:\Projects\Leader\dev\java\com\leader\cti\msgqueue\BasicMQReceiverAsyncR.java:529: cannot find symbol
symbol : class JMSException
location: class BasicMQReceiverAsyncR
catch (JMSException x)
26 errors
C:\Projects\Leader\dev\java\build.xml:34: The following error occurred while executing this line:
C:\Projects\Leader\dev\java\build.xml:56: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 8 seconds)
my class path is:
.;C:\Projects\Leader\prototype\jms\build\classes;C:\Projects\Leader\dev\libs\persist.jar;C:\Projects\Leader\dev\classes;%OPENJMS_HOME%\lib;%OPENJMS_HOME%\lib\antlr-2.7.2.jar;%OPENJMS_HOME%\lib\castor-0.9.5.jar;%OPENJMS_HOME%\lib\commons-codec-1.3.jar;%OPENJMS_HOME%\lib\commons-collections-2.1.jar;%OPENJMS_HOME%\lib\commons-dbcp-1.2.1.jar;%OPENJMS_HOME%\lib\commons-logging-1.0.4.jar;%OPENJMS_HOME%\lib\commons-pool-1.2.jar;%OPENJMS_HOME%\lib\concurrent-1.3.4.jar;%OPENJMS_HOME%\lib\derby-10.1.1.0.jar;%OPENJMS_HOME%\lib\jdbc-2.0.jar;%OPENJMS_HOME%\lib\jms-1.1.jar;%OPENJMS_HOME%\lib\jndi-1.2.1.jar;%OPENJMS_HOME%\lib\jta-1.0.1.jar;%OPENJMS_HOME%\lib\log4j-1.2.11.jar;%OPENJMS_HOME%\lib\openjms-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\openjms-common-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\openjms-net-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\openjms-tools-0.7.7-beta-1.jar;%OPENJMS_HOME%\lib\oro-2.0.8.jar;%OPENJMS_HOME%\lib\spice-jndikit-1.2.jar;%OPENJMS_HOME%\lib\xerces-2.4.0.jar;%OPENJMS_HOME%\lib\xml-apis-1.0.b2.jar;%J2EE_HOME%\lib\j2ee.jar;%J2EE_HOME%\lib
as you can see j2ee.jar is in %J2EE_HOME%\lib, but still doesn't work. can someone help me?<property name="messaging.client.jar.path" value="Location in your local drive" />
<property name="messaging.client.jar.name" value="nameOfYourFile.jar" /> -
.jar files not launching, and Jar Launcher not appearing when I search it
Okay, so here's the issue:
A couple weeks ago, I decided to download a stand-alone jar file for my personal use. The jar file, dependent on nothing, ran in Jar Laucher by default and worked fine. Earlier this week, however, I decided my Mac was cluttered and so I went through it and cleared out everything I wasn't ever going to use again. I also have an app called "The Unarchiver" from the Mac App store (I've had this for about two months). Since the uncluttering, three bad things have happened. 1) Any .jar files open in The Unarchiver instead of Jar launcher
2) When I search around my Mac for Jar Launcher, nothing appears.
3) The .jar file icons changed to this:
Also, I tried uninstalling The Unarchiver, and it still didn't work. Either Jar Launcher is gone, or it went dormant. What should I do, and if needed, where can I reinstall Jar Launcher?!?
(Mac Late 2009 Model 10.7.3)I figured out how to fix this issue. All you have to do is just install a new version of Java from the Apple website. When it's done, all of your jar files will now open in Jar Launcher by default.
http://support.apple.com/kb/DL1515
You don't need to uninstall The Unarchiver. -
Run class in jar file using command prompt
Hi,
I have created a jar file OSTBTLDataTransfer.jar using eclipse and tried to run a class Person in the package com.aqa.details using the command prompt like this
java -classpath com.aqa.details.Person
but this complained about a jar file dependency and i have set it to the classpath like this:
set CLASSPATH=C:\jarup\abc\ibatis-2.3.4.726.jar
but it couldn't find the dependency when i tried to run again.
please let me know your suggestions
Thanks,
KCjava -classpath OSTBTLDataTransfer.jar com.aqa.details.Person
or if you have an appropriate manifest in the jar simply
java -jar OSTBTLDataTransfer.jar -
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? -
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
tomVijay
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 -
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,
VenkatIf 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 -
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.
-
Creating a JAR File for a program that depends on other JAR files
Hi, I'm pretty new to this so it shouldn't be terribly hard to answer:
I have a program which uses JGoodies. There are 2 JGoodies .jar files in the same directory as my program. So I compile it by doing:
javac -extdirs . NameOfMyProgram.java
First off, is this the best way to do it? Is there any way of 'calling' these JAR files from within NameOfMyProgram.java?
Secondly, if I then try to run it by doing java NameOfMyProgram, it doesn't work; can't find the JGoodies stuff. I end up having to add the classpaths of the unzipped JGoodies directories.
So I have 2 questions:
1. How can I execute my file so that it reads from the JAR files, not the big expanded folders that I unzipped?
2. How can I create a JAR file that reads the JGoodies files properly? Right now, I have a Manifest.txt file that looks like:
Main-Class: NameOfMyProgram
Class-Path: forms-1.0.5.jar
Class-Path: looks-1.3.1.jar
Thanks a lot for your help!- learn how to use mysql JDBC
- pack JDBC driver only
- remotely access your DB
- set proper security level for your app -
Jdeveloper dependency on ANT script for .JAR file for ADF Application
Hi all,
We need to create a .jar file for an ADF project consist of Model & viewcontroller. We are able to create jar file with help OjDeploy in my ANT script.
My query: Ojdeploy uses internally jdeveloper home to complete the task. After going through the generated script, we came to know about below two references:
1. oracle.jdeveloper.ant.library = ${jdeveloperHome}\\ jdeveloper\\jdev\\/lib/ant-jdeveloper.jar
2. oracle.jdeveloper.ojdeploy.path = ${jdeveloperHome}\\jdeveloper\\jdev\\bin\\ojdeploy.exe
Is there any way to remove above dependencies so that we can create .jar file without installing Jdeveloper on a machine ?
regards,
Mohitojdeploy requires a JDeveloper installation.
Without going into the debate as to whether this is "good" or not, that's the way it works, I personally don't have a problem with installing JDeveloper on a build box (after all, you do have to install other software on the build box, too).
If you don't want to install JDeveloper, you can hand-roll your own ANT scripts which is good for racking up the billable hours, but not so good at maintainability. -
Adding all dependent classes of an applet to make a jar file
Hi everyone,
I have this problem which I was not able to find a solution for, So I truly appreciate any feedback on this.
I have a project on eclipse which is basically an applet.
This applet is using some classes in some jars that I have imported as libraries for this project.
Everything works on eclipse with no problem. However I need to make a jar file of the applet and required classes to use it in an html page.
Now that's the part I have been facing difficulties, cuz I have to include all the classes that the applet is using from other jar
files. And I can not come up with a way to find out all those classes.
On the other side if I include the whole jars then my applet goes over 100 meg and would be useless.
I am going to give an example of the problem I have in hope of making it a bit clear.
I have a applet, which uses some classes from some jars. i.e., class A. but class A itself need class B and etc.
Now how can I find all these dependencies since I have to include them along the applet in the jar file I am going to make.
Once again I appreciate any feedback and sorry that is a long question.Fractalz wrote:
. . . Now that's the part I have been facing difficulties, cuz I have to include all the classes that the applet is using from other jar
files. And I can not come up with a way to find out all those classes.See the Class-Path: parameter (of a Manifest file) documentation here:
http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#Manifest-Overview -
Error while deploying a JAR-File into 8i !
Hello to all Oracle experts,
At the attempt to deploy a Jar file into the 8i the following
error message comes onto Shell level:
initialization complete
loading : com/sun/xml/tree/XmlDocumentBuilder
ORA-01536: space quota exceeded for tablespace 'PROCON_DATA'
Error while loading com/sun/xml/tree/XmlDocumentBuilder
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_LOB", line 700
ORA-06512: at "PROCON.LOADLOBS", line 1
ORA-06512: at line 1
creating : com/sun/xml/tree/XmlDocumentBuilder
Error while creating class com/sun/xml/tree/XmlDocumentBuilder
ORA-29509: incorrectly formed Java binary class definition
The command was:
loadjava -user procon/procon@t2srv1:1521:PROCON -thin -verbose -schema PROCON xml_un.jar
It would please me if somebody has an idea to this error !
nullHi Olivier,
you could try the following approach:
1. Package your JAR files as J2EE Engine libraries and deploy them on it as described here: <a href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/2ade3fc6c6ec06e10000000a1550b0/frameset.htm">Working with J2EE Libraries</a>.
2. Set reference to this library from the application that use them. Depending on your application, refer to the appropriate documentation:
-- reference from a J2EE app -> see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/15/d5d93fe80fed06e10000000a1550b0/frameset.htm">Referencing Libraries in Applications</a>
-- reference from a portal app -> see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/02/788540ae1dbb4de10000000a1550b0/frameset.htm">Referencing Elements</a>
Hope that helps! -
Program will run with errors, but not at all in a .jar file
First off, here is my program right now:
import java.io.*;
import java.util.*;
import javax.swing.JOptionPane;
public class prune
public static void main(String args[])
String steamid="",time="";
BufferedReader infile = null;
BufferedWriter outfile = null;
FileReader fr = null;
FileWriter wr = null;
StringTokenizer strtk = null;
String line = null;
JOptionPane.showMessageDialog
(null, "Vault.ini Pruner v2");
String filepath = JOptionPane.showInputDialog("Enter the filepath to your vault.ini file.");
String strdeletenumber = JOptionPane.showInputDialog("Enter the number that vault entries under will be deleted");
int deletenumber = Integer.parseInt(strdeletenumber);
try
infile = new BufferedReader(new FileReader(filepath));
outfile = new BufferedWriter(new FileWriter(filepath));
catch(IOException ioe)
JOptionPane.showMessageDialog
(null, "Can't open vault.ini:" + ioe);
try
while((line=infile.readLine())!=null)
strtk = new StringTokenizer(line);
steamid = strtk.nextToken();
time = strtk.nextToken();
if(Integer.parseInt(time)>=deletenumber)
outfile.write(steamid);
outfile.write(" ");
outfile.write(time);
outfile.newLine();
catch(IOException ioe)
JOptionPane.showMessageDialog
(null, "Error:" + ioe);
try
outfile.close();
infile.close();
catch(IOException ioe)
JOptionPane.showMessageDialog
(null, "Error:" + ioe);
System.exit(0);
}The program is supposed to open a vault.ini file and delete entries with a number lower than specified.
Vault files are set up like this:
STEAMID:X:XXXX 100000
Right now if I run the program through command prompt it erases both the vault.ini and new vault.ini. I am also trying to put it in an executable jar file and when I do that I get a "Failed to load main class manifest attribute" error. Any ideas on what is causing this?I don't know what is happening. I put your exact code into a small build environment and used a build file for ant that I have and it works just fine. Manifest files are a total pain which is why I use a tool to generate it. I know that the last line has to be blank and that no line can be over a certain length.
You've now spent several days avoiding ant and I got it running with ant in about 3 minutes. I'm really missing something.
For reference, the build file is below should you change your mind. Put your prune.java in a new directory named "src" and save this file below as build.xml in the parent directory of "src". Run the program with java -jar lib/prune.jar
<project name="jartest" default="main" basedir=".">
<!-- location properties -->
<property name="src.dir" location="src" />
<property name="dest.classes.dir" location="classes" />
<property name="dest.lib.dir" location="lib" />
<!-- value properties -->
<property name="dest.lib.name" value="prune.jar" />
<property name="main.class" value="prune" />
<!-- compile time value properties -->
<property name="compile.debug" value="true" />
<property name="compile.optimize" value="false" />
<property name="compile.deprecation" value="true" />
<property name="compile.source" value="1.4"/>
<property name="compile.target" value="1.4"/>
<!-- build -->
<target name="main" depends="compile,jar" />
<target name="compile">
<mkdir dir="${dest.classes.dir}"/>
<mkdir dir="${dest.lib.dir}"/>
<javac srcdir="${src.dir}"
destdir="${dest.classes.dir}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
source="${compile.source}"
target="${compile.target}" >
</javac>
</target>
<!-- clean -->
<target name="clean">
<delete dir="${dest.classes.dir}"/>
<delete dir="${dest.lib.dir}"/>
</target>
<!-- jar -->
<target name="jar" depends="compile">
<jar destfile="${dest.lib.dir}/${dest.lib.name}"
basedir="${dest.classes.dir}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${main.class}" />
</manifest>
</jar>
</target>
</project> -
Jar Files in a Jar File - Classpath Error
Hi,
I created a jar file that will have all the class files of the application. In the manifest file class path, I have the jar files the application is dependent on. The dependent jar files were kept outside of the application jar file. I was able to execute the main file in the application jar file. Then I created another jar file that holds all the dependent jar files the application is dependent on along with the application jar file into one super jar file. configured the main class attribute of the super jar file to that in the application jar file. When I try to execute it, I'm getting an error saying Class Not Found. Can someone guide me in setting the classpath for this super jar file in its manifest file.
Presently my manifest file classpath variable in the super jar file is set as App.jar Depend1.jar Depend2.jar
Thanks,
E HJava's standard class loaders do not support jar files inside of other jar files, and will give the error you see.
You can write your own customized class loader, use a 3rd-party solution (onejar at sourceforge is one), or remove the interior jars. -
Program run in Netbeans but NOT running as jar file
Dear all ,
i hope any help in this problem.
i am writing program to access parallel port i put next files :
1. [ comm.jar + javax.comm.properties ] in
[ C:\Program Files\Java\jdk1.6.0_18\lib ] and [ C:\Program Files\Java\jdk1.6.0_18\jre\lib ]
2. [ win32com.dll ] in [ C:\WINDOWS\system32 ]
when i run application in NetBeans IDE 6.8 work fine and every think is ok
BUT when i produce jar file , generated jar file does not work [GUI appear but can not get ports on PC]
- I try to set Environment Variable as next :
CLASSPATH = .;C:\Program Files\Java\jdk1.6.0_18\lib\comm.jar
also does not work
any tip please ?
Thanks in advance
NabilFirst of all, leave the lib and jre/lib directories of the JRE alone. Never ever touch them again. Remove any jars you have put there yourself, or better yet completely remove and reinstall the JRE to make sure you put it back in a correct state.
After you do that, learn how to properly work with the classpath in both the IDE and the command line.
Netbeans: you define the classpath by adding jars to the project (right click on the libraries node in the project tree to get the appropriate options).
Command line: this depends on if you run a single class, or you invoke an executable jar.
Single class: you use the -cp command line switch to define the classpath
Executable jar: the jar itself defines the classpath in its META-INF/manifest.mf file. The -cp command line switch is ignored.
Since you use Netbeans, you'll get an executable jar so make sure to learn how such a jar is structured.
Maybe you are looking for
-
Can I Use Time Machine To Back Up a FAT32 Disk Containing Image Files?
New iMac User Here. I just bought a brand new but mid-2010 27" i7 iMac. Although I've used recent MacBooks when traveling I've got no experience with Time Machine or other similar third party back up software. I moved to the iMac from a desktop PC
-
How to set vertical line in SAPScript
Dear All, I have to set vertical line at a particular position of SAPScript. Here the lines are of varying length. Can you suggest how to do that? Line 1...................... | Vertical Line Line 2......................... | Verti
-
Edirectory settings for SMG authenticaion
Hi, We have installed Symantec Messaging Gateway v10. In order to receive Daily Qurantine report of Spam message for users, we must configure AD integration. We want to configure the directory integration with our Novell Groupwise server but somehow
-
Is there a way to get the bookmarks toolbar to display when switching to full screen on a Mac?
When switching to full screen mode in Firefox 9 the bookmarks toolbar goes away. I can't find any view setting to keep it displayed. Is there a way?
-
OS 10.5 Family Pack Retail Questions: PowerPC Install; Used as Boot Disk?
I have a MacBook Pro (which I've not unsealed yet) that was sold with 10.5: (http://www.everymac.com/systems/apple/macbook_pro/stats/macbook-pro-core-2-duo-2 .53-aluminum-15-late-2008-unibody-specs.html) and I have a Mac G4 Dual 867 powerPC, which wi