Manifesting Classpath Issues + Ant

Having some problems with classpath and manifest file.
I'm using ant to build manifest in jar. The classpath seems to be set OK in the manifest.
I include an external jar(log4j) in my app jar, and it seems to go in the correct place in my app jar(lib directory).
The manifest file seems to be created OK, and is put in the MANIFEST-INF directory in app jar.
I can compile and build everything OK.
The main issue is that at runtime, it does not seem to pickup the log4j jar. I get a NoClassDefFoundError when trying to create a Logger class.
Any help would be appreciated. I will include relevant information below.
ant stuff          <jar jarfile="${dist}/lib/mosaixsegment8-${DSTAMP}.jar" basedir="${build}">
               <manifest>
                    <attribute name="Built-By" value="${user.name}"/>
                    <attribute name="Main-Class" value="com.company.TestClient"/>
                    <attribute name="Class-Path" value="lib/log4j-1.2.8.jar"/>
               </manifest>
          </jar>
Manifest File CreatedManifest-Version: 1.0
Ant-Version: Apache Ant 1.5.4
Created-By: 1.4.2_01-b06 (Sun Microsystems Inc.)
Built-By: user
Main-Class: com.company.TestClient
Class-Path: lib/log4j-1.2.8.jar
Code Snippitimport org.apache.log4j.Logger;
public class TestClient{
     public static void main (String argv [])
          // Get Logger
          org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger("name");
Error Message
[java] java.lang.NoClassDefFoundError: org/apache/log4j/Logger
[java] at com.company.TestClient.main(Unknown Source)
[java] Exception in thread "main"
[java] Java Result: 1

pkwooster,
If there are complex solutions then the problem must be complex and perhaps I did not understand the problem (it takes a few hits on my head for the problem domain to get cleared up :). Reason I say this is because my problem is not complex & neither is the solution.
What I have is this:
1. Manually created (I know ANT does this; but I didn't use ant; I used a sh script) the MF file with just the Class-Path defined.
Here is the MF entry from my standalone application (it is really a messaging application):
Class-Path: log4j-1.2.7.jar bta_notify-facade-client.jar bta_notify-ex
ception.jar bta_notify-vo.jar
2. IN my sh script I use the following command to create my jar:
jar cvfm $BTA_ADAPTER_JAR_OUT \
     meta-inf/adapter-manifest.mf \
     $BTA_ADAPTER_CLASSES/*.class \
     $BTA_EXCEPTION_CLASSES/*.class \
     $BTA_MESSAGE_CLASSES/*.class \
     $BTA_VO_CLASSES/*.class \
     $BTA_GRAIN_BEAN_CLASSES/*.class \
     -C $BTA_SRC_CONFIG_DIR log4j.xml \
     -C $LOG4J_DIR $LOG4J_JAR
(the BTA_EXCEPTION_CLASSES & BTA_VO_CLASSES are not the same as the jars mentioned in the mf classpath).
That is all that I did. The adapter.jar contains log4j.jar (without the path) & the mf (meta-inf/ as the path).
I did something very similar on a j2ee app that is deployed as an EAR file in weblogic. That is where I have ear containing jar1 which contains log4j, other jars & jar1's mf which lists these contained jars (log4j & others) in its classpath.
I presume my problem & the problem that is being solved by these other complex solutions are not the same.

Similar Messages

  • Generating a manifest CLASSPATH using Ant

    I'm using Ant 1.5.4 to build my applications. When I create a JAR file to deploy I ask Ant to add a main class and CLASSPATH to the manifest, like this:
    <target name="deploy" depends="report" description="deploy the application">
        <buildnumber />
        <copy todir="${deploy}">
            <fileset dir="${src.lib}" />
        </copy>
        <pathconvert property="manifest.jars" pathsep=" ">
            <path id="manifest.class.path">
                <fileset dir="${deploy}">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
            </path>
            <map from="${basedir}/${deploy}/" to=""/>
        </pathconvert>
        <manifest file="META-INF/manifest.mf">
            <attribute name="Implementation-Title" value="${project}" />
            <attribute name="Built-By" value="${user.name}"/>
            <attribute name="Build-Date" value="${TODAY}" />
            <attribute name="Major-Version" value="${major}" />
            <attribute name="Minor-Version" value="${minor}" />
            <attribute name="Build-Number" value="${build.number}" />
            <attribute name="Main-Class" value="${manifest.main}"/>
            <attribute name="Class-Path" value="${manifest.jars}"/>
        </manifest>
        <jar jarfile="${deploy}/${project}.jar"
             manifest="${manifest}/manifest.mf">
            <fileset dir="${output.classes}" excludes="**/*TestCase*.class, **/*TestSuite*.class"/>
        </jar>
    </target>This particular app has several third-party JARs. When I look at the manifest contents, they look like this:
    Class-Path: activation.jar imap.jar junit.jar my-common.jar mail.ja
    r mailapi.jar pop3.jar smtp.jar xalan.jar xerces.jar xml-apis.jar xsl
    tc.jar
    Has anybody else done this with Ant for a long CLASSPATH with many JARs? Are those line breaks inside JAR names a problem? It looks strange to me, and I'm not sure that it's correct or useful. Thanks - MOD

    I'm using Ant 1.5.4 to build my applications. When I create a JAR file to deploy I ask Ant to add a main class and CLASSPATH to the manifest, like this:
    <target name="deploy" depends="report" description="deploy the application">
        <buildnumber />
        <copy todir="${deploy}">
            <fileset dir="${src.lib}" />
        </copy>
        <pathconvert property="manifest.jars" pathsep=" ">
            <path id="manifest.class.path">
                <fileset dir="${deploy}">
                    <patternset>
                        <include name="**/*.jar" />
                    </patternset>
                </fileset>
            </path>
            <map from="${basedir}/${deploy}/" to=""/>
        </pathconvert>
        <manifest file="META-INF/manifest.mf">
            <attribute name="Implementation-Title" value="${project}" />
            <attribute name="Built-By" value="${user.name}"/>
            <attribute name="Build-Date" value="${TODAY}" />
            <attribute name="Major-Version" value="${major}" />
            <attribute name="Minor-Version" value="${minor}" />
            <attribute name="Build-Number" value="${build.number}" />
            <attribute name="Main-Class" value="${manifest.main}"/>
            <attribute name="Class-Path" value="${manifest.jars}"/>
        </manifest>
        <jar jarfile="${deploy}/${project}.jar"
             manifest="${manifest}/manifest.mf">
            <fileset dir="${output.classes}" excludes="**/*TestCase*.class, **/*TestSuite*.class"/>
        </jar>
    </target>This particular app has several third-party JARs. When I look at the manifest contents, they look like this:
    Class-Path: activation.jar imap.jar junit.jar my-common.jar mail.ja
    r mailapi.jar pop3.jar smtp.jar xalan.jar xerces.jar xml-apis.jar xsl
    tc.jar
    Has anybody else done this with Ant for a long CLASSPATH with many JARs? Are those line breaks inside JAR names a problem? It looks strange to me, and I'm not sure that it's correct or useful. Thanks - MOD

  • JApplet MANIFEST classpath.. 3 files

    how do I make the right manifest file for it?
    with this as my MANIFEST.MF
    Manifest-Version: 1.0
    Class-Path: "swingx-0.9.0.jar;mysql-connector-java-5.0.4.jar;MS-SQL_jdbc.jar;"I get this..
    java.lang.NoClassDefFoundError: org/jdesktop/swingx/JXTaskPane
         at Item.<init>(Item.java:35)
         at Main.<clinit>(Main.java:105)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at sun.applet.AppletPanel.createApplet(AppletPanel.java:780)
         at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2074)
         at sun.applet.AppletPanel.runLoader(AppletPanel.java:709)
         at sun.applet.AppletPanel.run(AppletPanel.java:363)
         at java.lang.Thread.run(Thread.java:619)which just means that it isn't loading anything I think =(
    how do I make the correct classpath?
    **EDIT**
    just ignore this.. I've figured it out
    Manifest-Version: 1.0
    Class-Path: swingx-0.9.0.jar
    mysql-connector-java-5.0.4.jar
    MS-SQL_jdbc.jarEdited by: Nizzle on Nov 14, 2007 4:46 PM

    Hi Steve,
    As a quick workaround, can you consider merging that 3rd party
    references into a simple, let's call it 3rdparty.jar, file. Then you
    will be able to overcome this line limit. If you use ANT, it can be
    made a part of the build process and can simplify future additions.
    Hope this helps,
    Regards,
    Slava Imeshev
    "Steve Ebersole" <[email protected]> wrote in message
    news:3e788ce9$[email protected]..
    >
    I am having trouble deploying an EAR file having an ejb module with amanifest
    Class-Path entry. It appears to be directly related to the length of thatClass-Path
    entry. No matter the length of the Class-Path entry, ejbc runs fine butthen
    the problem comes trying to upload the EAR through the console.
    First iteration was just skeletal code and the dependencies were minimal.I was
    able to get this uploaded and deployed correctly. For that EAR, the EJBjar file
    manifest's Class-Path entry had only 2 entries and was no where near the72-character
    line limit.
    Second iteration had some functionality and the dependencies were muchlarger.
    Again ejbc ran fine, but I got errors on upload when the console tries todeploy
    the EAR. The manifest Class-Path entry for that ejb version contained 16jar
    files which, because fo the 72 line limit, spread across 3 lines.
    The complaint I get on deployment is NoClassDefFound for a class that isin a
    jar file listed in the manifest classpath (it found it the first time).
    Is there a bug in WebLogic (6.1 sp3) where it cannot recognize manifestclasspath
    entries over a certain limit? I have seen postings about WebLogic'sissues with
    class loading from manifest classpath entries but thought they had allbeen fixed
    as of 6.1sp3.
    Thanks in advance for any help or suggestions.

  • Whenever I try to download the Edge Animate tutorials it says currently having issues ant to contact customer support

    Whenever I try to download the Edge Animate tutorials it says currently having issues ant to contact customer support

    Hi,
    Now sure from where you are downloading edge animate tutorials. Can you please post any link or screenshots?
    If it is within browser then..
    1. Try in different browser.
    2. Clear the browser cache.
    Regards,
    Devendra

  • Unable to set classpath in Ant Script to compile AIA related api

    Hi everyone,
    I am trying to build customized ant scripts to compile,build & deploy (oracle 11g)AIA application using ANT tool.To compile composite application,"scac" target name is used.This scac will refer the classpath which was set at ant-sca-compile.xml.scac is compiling all integartion artifacts except AIA related api.I added aia.jar to classpath in ant-sca-compile.xml.still,scac is not recognizing aia.jar
    I am getting below compilation problem
    scac:
    [scac] Validating composite : 'F:\AIA_Dev\BBProcessSupplierAppln\SyncSupplierPartyBBProvABCSImpl\bin/..//composite.xml'
    [scac] F:\AIA_Dev\BBProcessSupplierAppln\SyncSupplierPartyBBProvABCSImpl\bin\..\SCA-INF\bpel\SyncSupplierPartyBBProvABCSImplProcess\src\orabpel\syncsupplierpartybbprovabcsimplprocess\ExecLetBxExe9.java:408: package oracle.apps.aia.core.eh.logging does not exist
    [scac] Note: F:\AIA_Dev\BBProcessSupplierAppln\SyncSupplierPartyBBProvABCSImpl\bin\..\SCA-INF\bpel\SyncSupplierPartyBBProvABCSImplProcess\src\orabpel\syncsupplierpartybbprovabcsimplprocess\BPEL_BIN.java uses unchecked or unsafe operations.
    [scac] Note: Recompile with -Xlint:unchecked for details.
    [scac] FATAL_ERROR: location {ns:composite/ns:component[@name='SyncSupplierPartyBBProvABCSImplProcess']}(42,62): Failed to compile bpel generated classes.
    [scac] failure to compile the generated BPEL classes for BPEL process "SyncSupplierPartyBBProvABCSImplProcess" of composite "default/SyncSupplierPartyBBProvABCSImpl!1.0"
    [scac] The class path setting is incorrect.
    [scac] Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version.
    [scac]
    Please let me know any body have faced above problem & resolved it.It is consuming more time.It would be appreciable,if any body provides solution for this.
    Thanks in advance.
    Thanks,
    Hanu

    Hi,
    How are you referring to the class path. I have created my custom build file and I refer like this.
    <path id="classpath">
      <pathelement location="${oracle.home}/lib/aia.jar"/>
      <pathelement location="${oracle.common.home}/modules/org.apache.commons.logging_1.0.4.jar"/>
    </path> oracle.home is the location where my aia.jar resides.
    In the compile-classes target I have
    <!--Target for Class path details -->
    <target name="compile-classes">
      <mkdir dir="${sca-inf.classes.dir}"/>
      <javac destdir="${sca-inf.classes.dir}"   classpathref="classpath"
             debug="on"                         nowarn="${javac.nowarn}"
             deprecation="${javac.deprecation}" encoding="Cp1252"
             source="1.6"                       target="1.6">
        <src path="${src.dir}"/>
      </javac> 
    </target> Regards,
    Neeraj Sehgal

  • [svn:bz-trunk] 18389: Eclipse Project Classpath issues:

    Revision: 18389
    Revision: 18389
    Author:   [email protected]
    Date:     2010-11-01 03:49:03 -0700 (Mon, 01 Nov 2010)
    Log Message:
    Eclipse Project Classpath issues:
    - Fixing class path entries.
    - Instead of jars pointing to the actual projects.
    Modified Paths:
        blazeds/trunk/development/eclipse/projects/java/blazeds-proxy/.classpath
        blazeds/trunk/development/eclipse/projects/java/blazeds-team.war/.classpath

    Figured out that it was failing while building a product for MacOS. I updated Tycho to use version 0.15.0 and all work well.
    For more information on the bug (case sensitive file systems) see:
    bugs.eclipse.org/bugs/show_bug.cgi?id=349877

  • ADF data control classpath issue

    Hi,
    when I am trying to create a jmx connection as part of adf jmx data control using jdeveloper 11.1.2.2.0.
    As part of jmx connection I am providing websphere server 9.7 fp25 connection (installed in the same machine) details and when I click on test connection in the data control wizard getting the following error
    Connection failed:
    java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]
    I guess it is a classpath issue. If it is, where can I provide the class path for data control? or something else I have to do?
    I found the above missing class is available in  /scratch/was/IBM/Websphere/AppServer/runtimes/com.ibm.ws.admin.client_7.0.0.jar
    Please suggest.
    thanks in advance,
    cdhar

    repost. Any pointers to documentation would be great!

  • Classpath issue with wlwBuild ant taskdef

    I have an ant script that was exported from the weblogic ide. It has a taskdef like the following which works perfectly fine.
    <taskdef name="wlwBuild" classname="workshop.core.WlwBuildTask" classpath="${weblogic.home}/workshop/wlw-ide.jar"/>
    I copied the wlw-ide.jar file to a different location and changed the classpath in the taskdef to point to that new location but I get the following error when I try to build:
    build-ear:
    [wlwBuild] java.lang.reflect.InvocationTargetException
    [wlwBuild] java.lang.reflect.InvocationTargetException
    [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [wlwBuild] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [wlwBuild] at java.lang.reflect.Method.invoke(Method.java:324)
    [wlwBuild] at workshop.core.Compile.start(Compile.java:19)
    [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [wlwBuild] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [wlwBuild] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [wlwBuild] at java.lang.reflect.Method.invoke(Method.java:324)
    [wlwBuild] at workshop.core.Starter.invokeStart(Starter.java:34)
    [wlwBuild] at workshop.core.Compile.main(Compile.java:9)
    [wlwBuild] Caused by: java.lang.NoClassDefFoundError: weblogic/utils/classloaders/GenericClassLoader
    [wlwBuild] at workshop.core.App.<init>(App.java:363)
    [wlwBuild] at workshop.core.CompileHelper.createApp(CompileHelper.java:333)
    [wlwBuild] at workshop.core.CompileHelper.compile(CompileHelper.java:58)
    [wlwBuild] ... 11 more
    [wlwBuild] java.lang.reflect.InvocationTargetException
    [wlwBuild] java.lang.IllegalStateException: Called System.exit(-1)
    [wlwBuild] at workshop.core.util.NoExitSecurityManager.checkExit(NoExitSecurityManager.java:45)
    [wlwBuild] at java.lang.Runtime.exit(Runtime.java:88)
    [wlwBuild] at java.lang.System.exit(System.java:715)
    [wlwBuild] at workshop.core.Starter.invokeStart(Starter.java:44)
    [wlwBuild] at workshop.core.Compile.main(Compile.java:9)
    Any ideas why?
    Thanks.
    gtata

    BEA provides several ant scripts, however only one runs correctly. Thus you have to specify the full path of your ant script.
    1. Setup your vars invoquing:% WL_HOME%\common\bin\commEnv.cmd
    2. set ANT_HOME=%WL_HOME%\integration\adapters\utils
    3. Build use full path!!! %ANT_HOME%\ant.cmd -f mybuild.xml
    After step 2, WL_HOME\server\bin is in your PATH and there is an ANT script in that path, which does fail. That's why you have to specify the "correct" ant script's full path when running ant.
    Yours,
    Yves

  • Set path and classpath in ANT

    by using ANT, how can set the JDK path and classpath..
    jdk version exists in the : C:\Program Files\Java\jdk1.6.0
    This is the build.xml that i need to modify!
    -Do i need to have a serperate JAVA_HOME variable?
    <?xml version="1.0"?>
    <!--
    Build file for 'Chat Client'
    Version: $Revision: 4.10 $ $Date: 2003/05/28 $
    Author:  Rajat Gupta
    -->
    <project name="Chat" default="jar" basedir=".">
       <!-- ================================================================== -->
       <!-- Initialization of all property settings                            -->
       <!-- ================================================================== -->
       <target name="init">
          <property name="appname"        value="chat"   />
          <property name="src.dir"        value="src"               />
          <property name="lib.dir"        value="lib"              />
          <property name="build.dir"      value="Chat"            />
          <property name="build.compiler" value="classic"          />
       </target>
       <!-- ================================================================== -->
       <!-- Makes sure the needed directory structure is in place              -->
       <!-- ================================================================== -->
       <target name="prepare" depends="init">
          <mkdir dir="${lib.dir}" />
          <mkdir dir="${lib.dir}/META-INF" />
          <mkdir dir="${build.dir}" />
       </target>
       <!-- ================================================================== -->
       <!-- Compilation of the web part of the application                     -->
       <!-- ================================================================== -->
       <target name="classes" depends="prepare">
          <javac srcdir="${src.dir}/oracle/otnsamples/oc4jjms"
                 destdir="${lib.dir}"
                 includes="**" />
       </target>
       <!-- ================================================================== -->
       <!-- Compilation of the complete J2EE application (both web and EJB)    -->
       <!-- ================================================================== -->
       <target name="j2ee-meta-inf" depends="classes, prepare">
          <copy file="${src.dir}/META-INF/application-client.xml"
                tofile="${lib.dir}/META-INF/application-client.xml" />
          <copy file="${src.dir}/images/oralogo.gif"
                tofile="${lib.dir}/oralogo.gif" />
       </target>
       <target name="jar" depends="j2ee-meta-inf">
       <jar jarfile="${build.dir}/${appname}.jar"
           basedir="${lib.dir}" manifest="${src.dir}/META-INF/MANIFEST.MF"/>
          <delete dir="${lib.dir}" />
       </target>
    </project>Message was edited by:
    jugp

    [url ='http://www.jguru.com/forums/home.jsp?topic=Ant']answer here

  • Classpath Issue - but JAR file is in the classpath

    I'm having an issue getting a JAVA Application Client to run and would welcome any suggestions or input to resolve this problem. I'm not a developer, just the builder/deployer of the applications. There are two developers looking at this problem too, but they are stumped too.
    It complains that it can't find sun/jdbc/rowset/CachedRowSet, which is contained in the rowset.jar - which is in the classpath. I've put all the supporting information below, if you need additional information please let me know and I'll provide it.
    ***** ERRORS FROM RUNNING SCRIPT BELOW *****
    *** NOT Using Verbose: ***
    Exception in thread "main" java.lang.NoClassDefFoundError: sun/jdbc/rowset/CachedRowSet
    *** Using Verbose (only included the output with the error): ***
    [Loading superclasses of com/actuate/schemas/SubmitJobResponse]
    [Loaded java.sql.SQLException from /usr/java130/jre/lib/rt.jar]
    [Loading superclasses of java/sql/SQLException]
    [Signaling in VM: java/lang/NoClassDefFoundError, message: sun/jdbc/rowset/CachedRowSet]
    Exception in thread "main" java.lang.NoClassDefFoundError: sun/jdbc/rowset/CachedRowSet[Loaded sun.i
    o.UnknownCharacterException from /usr/java130/jre/lib/rt.jar]
    [Loading superclasses of sun/io/UnknownCharacterException]
    [Preparing sun/io/UnknownCharacterException]
    ***** SCRIPT TO RUN THE JAVA COMMAND *****
    #!/usr/bin/ksh
    LIBDIR="/actuate/Mace/lib"
    JAVA_CP=""
    MAIN_JAR="MaceEXT.jar"
    JAVA_PATH="/usr/java130/jre/bin"
    JAVA_HOME="/usr/java130/jre"
    JAVA_FULLVERSION=`$JAVA_PATH/java -fullversion`
    JAVA_EXE=${JAVA_HOME}/bin/java
    PATH=$JAVA_PATH:$PATH
    export PATH
    export JAVA_HOME
    JAVA_CP="${LIBDIR}/sljcx.jar"
    JAVA_CP="${LIBDIR}/sljc.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/rowset.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/wsdl4j.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/tt-bytecode.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/servlet.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/saaj.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/log4j-1.2.4.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/jaxrpc.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/commons-logging.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/axis.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/ivjejb35.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/j2ee.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/activation.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/mail.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/ns.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/xmlParserAPIs.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/xercesImpl.jar":${JAVA_CP}
    JAVA_CP="$JAVA_HOME/lib/rt.jar":${JAVA_CP}
    echo ""
    echo "Classpath"
    echo $JAVA_CP
    echo ""
    echo "JAVA_Home"
    echo $JAVA_HOME
    echo ""
    echo "JAVA_EXE"
    echo $JAVA_EXE
    echo ""
    echo "JAVA_Path"
    echo $JAVA_PATH
    echo ""
    echo "JAVA FullVersion"
    echo $JAVA_FULLVERSION
    #$JAVA_EXE -cp $JAVA_CP -jar $MAIN_JAR -h dev -c adduser -u 000 -p ""
    $JAVA_EXE -verbose -cp $JAVA_CP -jar $MAIN_JAR -h dev -c adduser -u 000 -p ""
    ***** JAR -tvf OF ROWSET.JAR *****
    server105:/actuate/Mace/lib $ jar -tfv rowset.jar
    0 Tue Jun 13 19:45:42 EDT 2000 META-INF/
    66 Tue Jun 13 19:45:42 EDT 2000 META-INF/MANIFEST.MF
    0 Tue Jun 13 19:45:30 EDT 2000 sun/
    0 Tue Jun 13 19:45:30 EDT 2000 sun/jdbc/
    0 Tue Jun 13 19:45:42 EDT 2000 sun/jdbc/rowset/
    551 Tue Jun 13 19:45:30 EDT 2000 sun/jdbc/rowset/BaseRow.class
    9112 Tue Jun 13 19:45:32 EDT 2000 sun/jdbc/rowset/BaseRowSet.class
    35562 Tue Jun 13 19:45:36 EDT 2000 sun/jdbc/rowset/CachedRowSet.class
    597 Tue Jun 13 19:45:36 EDT 2000 sun/jdbc/rowset/ColInfo.class
    1290 Tue Jun 13 19:45:36 EDT 2000 sun/jdbc/rowset/InsertRow.class
    18442 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/JdbcRowSet.class
    2109 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/Row.class
    4489 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/RowSetMetaDataImpl.class
    4707 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/RowSetReaderImpl.class
    8270 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/RowSetWriterImpl.class
    4745 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SQLInputImpl.class
    3287 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SQLOutputImpl.class
    2326 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialArray.class
    1560 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialBlob.class
    1948 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialClob.class
    592 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialRef.class
    2419 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialStruct.class
    1903 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/WebRowSet.class
    257 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlReader.class
    15620 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlReaderDocHandler.class
    2029 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlReaderImpl.class
    258 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlWriter.class
    9797 Tue Jun 13 19:45:42 EDT 2000 sun/jdbc/rowset/XmlWriterImpl.class
    ***** ECHO OF VARIABLES FROM SCRIPT *****
    Classpath
    /usr/java130/jre/lib/rt.jar:/actuate/Mace/lib/xercesImpl.jar:/actuate/Mace/lib/xmlParserAPIs.jar:/ac
    tuate/Mace/lib/ns.jar:/actuate/Mace/lib/mail.jar:/actuate/Mace/lib/activation.jar:/actuate/Mace/lib/
    j2ee.jar:/actuate/Mace/lib/ivjejb35.jar:/actuate/Mace/lib/axis.jar:/actuate/Mace/lib/commons-logging
    .jar:/actuate/Mace/lib/jaxrpc.jar:/actuate/Mace/lib/log4j-1.2.4.jar:/actuate/Mace/lib/saaj.jar:/actu
    ate/Mace/lib/servlet.jar:/actuate/Mace/lib/tt-bytecode.jar:/actuate/Mace/lib/wsdl4j.jar:/actuate/Mac
    e/lib/rowset.jar:/actuate/Mace/lib/sljc.jar:/actuate/Mace/lib/sljcx.jar
    JAVA_Home
    /usr/java130/jre
    JAVA_EXE
    /usr/java130/jre/bin/java
    JAVA_Path
    /usr/java130/jre/bin
    JAVA FullVersion
    java full version "J2RE 1.3.0 IBM build ca130-20020504"
    ***** DIRECTORY LISTING *****
    server105:/actuate/Mace $ ls -lat
    -rwxr-xr-x 1 actuate actuate 1673 Apr 04 09:11 go.sh
    -rw-r----- 1 actuate actuate 476699 Apr 03 12:37 MaceEXT.jar
    drwxr-xr-x 2 actuate actuate 4096 Apr 02 10:49 lib
    -rw-r----- 1 actuate actuate 1818 Mar 28 11:15 MaceConfig.xml
    server105:/actuate/Mace/lib $ ls -lat
    -rw-r----- 1 actuate actuate 32033 Apr 02 10:49 ivjejb35.jar
    -rw-r----- 1 actuate actuate 329096 Apr 02 10:49 j2ee.jar
    -rw-r----- 1 actuate actuate 374291 Apr 01 16:39 ns.jar
    -rw-r----- 1 actuate actuate 654326 Apr 01 16:31 sljc.jar
    -rw-r----- 1 actuate actuate 81987 Apr 01 16:31 sljcx.jar
    -rw-r----- 1 actuate actuate 54368 Mar 31 08:32 activation.jar
    -rw-r----- 1 actuate actuate 867459 Mar 31 08:32 axis.jar
    -rw-r----- 1 actuate actuate 24287 Mar 31 08:31 commons-logging.jar
    -rw-r----- 1 actuate actuate 32069 Mar 31 08:31 jaxrpc.jar
    -rw-r----- 1 actuate actuate 378778 Mar 31 08:31 log4j-1.2.4.jar
    -rw-r----- 1 actuate actuate 305414 Mar 31 08:31 mail.jar
    -rwxrwxrwx 1 actuate actuate 62388 Mar 31 08:31 rowset.jar
    -rw-r----- 1 actuate actuate 18468 Mar 31 08:31 saaj.jar
    -rw-r----- 1 actuate actuate 78350 Mar 31 08:31 servlet.jar
    -rw-r----- 1 actuate actuate 130773 Mar 31 08:31 tt-bytecode.jar
    -rw-r----- 1 actuate actuate 109356 Mar 31 08:31 wsdl4j.jar
    -rw-r----- 1 actuate actuate 933730 Mar 31 08:31 xercesImpl.jar
    -rw-r----- 1 actuate actuate 78440 Mar 31 08:31 xmlParserAPIs.jar

    All that script made my eyes glaze over, but it appears you are running your main class from an executable jar file. Is that correct? Executable jar files don't use the classpath. If you want them to refer to anything outside the executable jar, you have to put Class-Path entries in its manifest.

  • Weird classpath issue in EAR.Some classes can access jars that others cant!

    Hi,
    I'm experiencing a very frustrating problem that's proving to be a bit of a show stopper for me. I would really appreciate some help...
    I have an EAR deployed successfully on Sun Appserver 8 which passes the tests from the sun EAR verifier tool. The ear contains a jar file that I built which has a stateless session bean, home, remote interfaces and rmi stubs, deployment descriptors, as well as some utility classes. The EAR also contains some third-party jars such as Hibernate, Log4-j, apache-commons etc etc. The jar I built has in it's manifest file, the classpath information to reference the other jars in the ear.
    The problem I am having is that one of the classes in a third-party jar (hibernate3.jar) cannot see a class in another of the third party jars (log4j-1.2.8.jar) and as a result is throwing a NoClassDefFoundError for org/apache/log4j/Layout while trying to initialise - the two jars are at the root of the EAR.
    Furthermore, my utility classes can access and use Log4j classes without any problem and logging command from those classes is output successfully to the server console. However, my session bean, which is packaged in the same jar as the utility classes, fails to log anything even though it uses exactly the same logger and log configuration as the utility classses.
    I have tried adding classpath information to the manifest of the EAR so that the third-party jars can pick it up but this makes no difference. Also, according to the EAR verifier tool, you are not allowed to put any classpath information in the EAR manifest.
    I have also tried deploying this in weblogic but am experiencing the same problem.
    If anyone can offer any advice or solutions I would greatly appreciate it.
    :)

    what´s type error have you?
    perhaps external libraries (located in classpath) invoke opsCommon.jar and config-3.0.jar classes. then, classnotfound is normal.
    and... why separate external libraries (opsCommon.jar and config-3.0.jar inside ear, and other in classpath)?

  • Classpath issues when executing from a jar

    I have a jar that I built for an RMI server that has a need to access another jar. (log4j). I run the jar from the command line using:
    java -jar -Djava.rmi.server.codebase=my.jar my.jar
    and the code runs fine but when I try to add in the log4j.jar I can't find it. I have placed it in my.jar in a lib directory within my.jar, I have placed it in the current directory, I have placed it in other directories I know are on the classpath, I have done all kinds of variations with the -classpath switch on the command line and nothing works.
    How do I package, configure and/or call such that the Logger class in log4j.jar can be found by my RMI server when I execute my.jar?
    Thanks

    Running from the jar-file ignores the CLASSPATH. See Bug #4459663
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4459663
    You have a few options:
    First, you can unjar all of the jars you depend on and rejar 'em up with your jar. This is the simplest solution.
    Second, you can skip running "from the jar" and just put that jar in your CLASSPATH.
    Third, you can put jars you depend on in the $JAVA_HOME/jre/lib/ext directory.
    Fourth, you can modify the manifest to specify a classpath, and then put the libraries you depend on at the places specified.
    And, if you think There Ought To Be A Better Way, vote for the RFE!

  • Classpath issue in a Weblogic environment with separate apps

    I am seeing class definition and/or class version errors relating to the classloader with regarding to some of the JOS support classes that Hibernate/Spring uses, such as Jakarta commons logging, as an example. Our situation is that we have two applications that call each other. Each use Hibernate to do persistence to their own databases. Intermittently, I see these errors when I have the hibernate.jar and the supporting .jars in each application's app-inf/lib's. However, if I move the .jars to the server classpath then the issues go away.
    This configuration is not optimal because one application may use a latter version of the .jars and then this would require regression testing for all apps that use Hibernate and the associated .jars on the server.
    In general, I am wondering how others have configured their .jars. Is this something you just have to live with?? Or is there a viable solution to have the .jars live in each application?
    Thanks,
    Lou

    Here's what the error looks like:
    java.lang.ExceptionInInitializerError
    at net.sf.hibernate.util.JDBCExceptionReporter.logWarnings(Ljava.sql.SQLWarning;)V(JDBCExceptionReporter.java:???)
    at net.sf.hibernate.impl.BatcherImpl.closeConnection(Ljava.sql.Connection;)V(BatcherImpl.java:297)
    at net.sf.hibernate.impl.SessionImpl.disconnect()Ljava.sql.Connection;(SessionImpl.java:3352)
    at net.sf.hibernate.impl.SessionImpl.close()Ljava.sql.Connection;(SessionImpl.java:576)
    at org.springframework.orm.hibernate.SessionFactoryUtils.doClose(Lnet.sf.hibernate.Session;)V(SessionFactoryUtils.java:651)
    at org.springframework.orm.hibernate.SessionFactoryUtils.closeSessionOrRegisterDeferredClose(Lnet.sf.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(SessionFactoryUtils.java:640)
    at org.springframework.orm.hibernate.SessionFactoryUtils.access$300(Lnet.sf.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(SessionFactoryUtils.java:86)
    at org.springframework.orm.hibernate.SessionFactoryUtils$SpringSessionSynchronization.beforeCompletion()V(SessionFactoryUtils.java:776)
    at org.springframework.orm.hibernate.SessionFactoryUtils$JtaSessionSynchronization.afterCompletion(I)V(SessionFactoryUtils.java:874)
    at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(I)V(ServerSCInfo.java:853)
    at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions()V(ServerTransactionImpl.java:2708)
    at weblogic.transaction.internal.ServerTransactionImpl.afterCommittedStateHousekeeping()V(ServerTransactionImpl.java:2606)
    at weblogic.transaction.internal.ServerTransactionImpl.setCommitted()V(ServerTransactionImpl.java:2638)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(II)V(ServerTransactionImpl.java:2436)
    at weblogic.transaction.internal.ServerTransactionImpl.globalCommit()V(ServerTransactionImpl.java:2365)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:278)
    at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:244)
    at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic.ejb20.internal.InvocationWrapper;Ljava.lang.Throwable;)V(BaseEJBObject.java:299)
    at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic.ejb20.internal.InvocationWrapper;Ljava.lang.Throwable;)V(StatelessEJBObject.java:140)
    at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(SyncDispatcher_k1mrl8_EOImpl.java:110)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Lcom.bea.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(Dispatcher.java:161)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Lcom.bea.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request;Ljavax.servlet.http.HttpServletResponse;Ljavax.servlet.ServletContext;)V(Dispatcher.java:49)
    at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executePostRequest(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Ljavax.servlet.ServletContext;Ljavax.servlet.ServletConfig;)V(HttpServerHelper.java:713)
    at com.bea.wlw.runtime.core.dispatcher.HttpServer.doPost(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServer.java:49)
    at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:996)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(WebAppServletContext.java:6456)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:118)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.))
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Ljava.lang.String;)Lorg.apache.commons.logging.Log;(LogFactoryImpl.java:543)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.String;)Lorg.apache.commons.logging.Log;(LogFactoryImpl.java:235)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.Class;)Lorg.apache.commons.logging.Log;(LogFactoryImpl.java:209)
    at org.apache.commons.logging.LogFactory.getLog(Ljava.lang.Class;)Lorg.apache.commons.logging.Log;(LogFactory.java:351)
    at net.sf.hibernate.util.JDBCExceptionReporter.<clinit>()V(JDBCExceptionReporter.java:12)
    at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
    at jrockit.vm.RNI.trampoline()V(Unknown Source)
    at net.sf.hibernate.util.JDBCExceptionReporter.logWarnings(Ljava.sql.SQLWarning;)V(JDBCExceptionReporter.java:???)
    at net.sf.hibernate.impl.BatcherImpl.closeConnection(Ljava.sql.Connection;)V(BatcherImpl.java:297)
    at net.sf.hibernate.impl.SessionImpl.disconnect()Ljava.sql.Connection;(SessionImpl.java:3352)
    at net.sf.hibernate.impl.SessionImpl.close()Ljava.sql.Connection;(SessionImpl.java:576)
    at org.springframework.orm.hibernate.SessionFactoryUtils.doClose(Lnet.sf.hibernate.Session;)V(SessionFactoryUtils.java:651)
    at org.springframework.orm.hibernate.SessionFactoryUtils.closeSessionOrRegisterDeferredClose(Lnet.sf.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(SessionFactoryUtils.java:640)
    at org.springframework.orm.hibernate.SessionFactoryUtils.access$300(Lnet.sf.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(SessionFactoryUtils.java:86)
    at org.springframework.orm.hibernate.SessionFactoryUtils$SpringSessionSynchronization.beforeCompletion()V(SessionFactoryUtils.java:776)
    at org.springframework.orm.hibernate.SessionFactoryUtils$JtaSessionSynchronization.afterCompletion(I)V(SessionFactoryUtils.java:874)
    at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(I)V(ServerSCInfo.java:853)
    at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions()V(ServerTransactionImpl.java:2708)
    at weblogic.transaction.internal.ServerTransactionImpl.afterCommittedStateHousekeeping()V(ServerTransactionImpl.java:2606)
    at weblogic.transaction.internal.ServerTransactionImpl.setCommitted()V(ServerTransactionImpl.java:2638)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(II)V(ServerTransactionImpl.java:2436)
    at weblogic.transaction.internal.ServerTransactionImpl.globalCommit()V(ServerTransactionImpl.java:2365)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:278)
    at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:244)
    at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic.ejb20.internal.InvocationWrapper;Ljava.lang.Throwable;)V(BaseEJBObject.java:299)
    at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic.ejb20.internal.InvocationWrapper;Ljava.lang.Throwable;)V(StatelessEJBObject.java:140)
    at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(SyncDispatcher_k1mrl8_EOImpl.java:110)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Lcom.bea.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(Dispatcher.java:161)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Lcom.bea.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request;Ljavax.servlet.http.HttpServletResponse;Ljavax.servlet.ServletContext;)V(Dispatcher.java:49)
    at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executePostRequest(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Ljavax.servlet.ServletContext;Ljavax.servlet.ServletConfig;)V(HttpServerHelper.java:713)
    at com.bea.wlw.runtime.core.dispatcher.HttpServer.doPost(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServer.java:49)
    at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:760)
    Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor()Ljava.lang.reflect.Constructor;(LogFactoryImpl.java:397)
    at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(Ljava.lang.String;)Lorg.apache.commons.logging.Log;(LogFactoryImpl.java:529)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.String;)Lorg.apache.commons.logging.Log;(LogFactoryImpl.java:235)
    at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(Ljava.lang.Class;)Lorg.apache.commons.logging.Log;(LogFactoryImpl.java:209)
    at org.apache.commons.logging.LogFactory.getLog(Ljava.lang.Class;)Lorg.apache.commons.logging.Log;(LogFactory.java:351)
    at net.sf.hibernate.util.JDBCExceptionReporter.<clinit>()V(JDBCExceptionReporter.java:12)
    at jrockit.vm.RNI.getRunnableCode(I)I(Unknown Source)
    at jrockit.vm.RNI.trampoline()V(Unknown Source)
    at net.sf.hibernate.util.JDBCExceptionReporter.logWarnings(Ljava.sql.SQLWarning;)V(JDBCExceptionReporter.java:???)
    at net.sf.hibernate.impl.BatcherImpl.closeConnection(Ljava.sql.Connection;)V(BatcherImpl.java:297)
    at net.sf.hibernate.impl.SessionImpl.disconnect()Ljava.sql.Connection;(SessionImpl.java:3352)
    at net.sf.hibernate.impl.SessionImpl.close()Ljava.sql.Connection;(SessionImpl.java:576)
    at org.springframework.orm.hibernate.SessionFactoryUtils.doClose(Lnet.sf.hibernate.Session;)V(SessionFactoryUtils.java:651)
    at org.springframework.orm.hibernate.SessionFactoryUtils.closeSessionOrRegisterDeferredClose(Lnet.sf.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(SessionFactoryUtils.java:640)
    at org.springframework.orm.hibernate.SessionFactoryUtils.access$300(Lnet.sf.hibernate.Session;Lnet.sf.hibernate.SessionFactory;)V(SessionFactoryUtils.java:86)
    at org.springframework.orm.hibernate.SessionFactoryUtils$SpringSessionSynchronization.beforeCompletion()V(SessionFactoryUtils.java:776)
    at org.springframework.orm.hibernate.SessionFactoryUtils$JtaSessionSynchronization.afterCompletion(I)V(SessionFactoryUtils.java:874)
    at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(I)V(ServerSCInfo.java:853)
    at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions()V(ServerTransactionImpl.java:2708)
    at weblogic.transaction.internal.ServerTransactionImpl.afterCommittedStateHousekeeping()V(ServerTransactionImpl.java:2606)
    at weblogic.transaction.internal.ServerTransactionImpl.setCommitted()V(ServerTransactionImpl.java:2638)
    at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(II)V(ServerTransactionImpl.java:2436)
    at weblogic.transaction.internal.ServerTransactionImpl.globalCommit()V(ServerTransactionImpl.java:2365)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit()V(ServerTransactionImpl.java:278)
    at weblogic.transaction.internal.ServerTransactionImpl.commit()V(ServerTransactionImpl.java:244)
    at weblogic.ejb20.internal.BaseEJBObject.postInvoke(Lweblogic.ejb20.internal.InvocationWrapper;Ljava.lang.Throwable;)V(BaseEJBObject.java:299)
    at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(Lweblogic.ejb20.internal.InvocationWrapper;Ljava.lang.Throwable;)V(StatelessEJBObject.java:140)
    at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(SyncDispatcher_k1mrl8_EOImpl.java:110)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Lcom.bea.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request;)Lcom.bea.wlw.runtime.core.request.Response;(Dispatcher.java:161)
    at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Lcom.bea.wlw.runtime.core.dispatcher.DispFile;Lcom.bea.wlw.runtime.core.request.Request;Ljavax.servlet.http.HttpServletResponse;Ljavax.servlet.ServletContext;)V(Dispatcher.java:49)
    at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executePostRequest(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Ljavax.servlet.ServletContext;Ljavax.servlet.ServletConfig;)V(HttpServerHelper.java:713)
    at com.bea.wlw.runtime.core.dispatcher.HttpServer.doPost(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServer.java:49)
    Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
    at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor()Ljava.lang.reflect.Constructor;(LogFactoryImpl.java:385)
    ... 31 more

  • Runtime classpath issue -- NoClassDefFoundError

    Hi,
    It shames me to post such a common, everyday problem, but I cannot figure this one out.
    I have a class in the package service: service.SynchImage. I have a class in another package as well: vigra.matlab.LOTFClient. In LOTFClient, I am importing service.SynchImage and trying to instantiate it.
    All my source code compiles successfully.
    When I try to run my program, I get a NoClassDefFoundError telling me it cannot find service/SynchImage.
    This is how I am trying to use service.SynchImage (from LOTFClient):
    package vigra.matlab;
    import service.SynchImage;
    public final class LOTFClient implements Runnable {
        private static byte[] in;
        public void run() {
            try {
                if (imAq == null) { //imAq is not relevant
                    throw new Exception("Proxy to LOTFVigra is invalid");
                } else {
                    System.out.println("Connection to LOTFVigra service successful");
                    in = imAq.acquireImage();
                    SynchImage si = new SynchImage(in, 640, 480);
            } catch (Exception e) {
                System.err.println(e.getMessage());
    }Again, this DOES compile successfully. Here is how I am running this class:
    package vigra.matlab;
    public class LOTFDriver {
         public static void main(String[] args) {
              LOTFClient client = new LOTFClient();
              Thread thread = new Thread(client);
              thread.start();
    }Alrighty. I'm using an Ant build script to compile all this. In my build script, I set the classpath to the appropriate directories, as follows:
         <!-- Define the Java classpath -->
         <path id="classpath">
              <pathelement location="${CATALINA_HOME}/webapps/kdb/WEB-INF/classes" />
              <pathelement location="/u/dgresh/Ice-3.1.0/lib/Ice.jar" />
         </path>
         <!-- Compile the Java code -->
         <target name="compile" depends="init">
              <javac srcdir="${src}" destdir="${build}">
                   <classpath refid="classpath" />
              </javac>
         </target>When I browse to $CATALINA_HOME/webapps/kdb/WEB-INF/classes I see the "service" package there. When I browse inside the package, I see "SynchImage.class" there. I found a duplicate "service" package that did not contain the SynchImage.class file and deleted it, but I still get the error.
    Is there anything else I should be checking for? What on earth am I missing? It must be something incredibly obvious, but what is it?
    Oh, here is SynchImage, if it matters:
    package service;
    import java.awt.image.BufferedImage;
    public class SynchImage {
         private static byte[] input;
         private static int width;
         private static int height;
         public SynchImage(byte[] input, int width, int height) {
              this.input = input;
              this.width = width;
              this.height = height;
              ImageProcessor.createAndSaveImage(input, width, height);
         public static BufferedImage fetchImage() {
              return ImageProcessor.createImage(input, width, height);
    }Thanks

    Okay, I'm now very confused.
    In $CATALINA_HOME/webapps/kdb/WEB-INF/classes I was building my project to "LOTFVigra/$project", and the service package to "classes".
    If I don't build it to LOTFVigra/vigra/matlab/*.class and simply build it to CATALINA_HOME/webapps/kdb/WEB-INF/classes/vigra/matlab/*.class, it will run. Why on earth would this occur?

  • WEB-INF/classes not in classpath issue - bug or specification?

    I've noticed BC4J expects some of its configuration files to be present in the standard classpath or the application.
    However, when running web-apps, the WEB-INF/classes are used for loading classes by the JVM, but they are not in the classpath literaly which causes BC4J not to find its metadata files - this has caused many people to be confused because they believed (like me) that the /classes folder is just another part of the classpath.
    But someone has to solve this! After all, if I have a million web-apps, I (as a BC4J user) do not want to include a million JAR files in the classpath. I want to put the JAR in the classes directory and have BC4J find it automatically since its part of the web-app's classes, jars/zips and such.
    The question is, is this a BC4J issue (not finding the files) or a Java Specification issue? and if this is a mere BC4J issue, why won't Oracle provide a small patch for BC4J (simply release an updated JAR/ZIP file)? Or instead, put it in BC4J release notes (unless its already there and I've missed it..) so that customers won't have to spend/waste valuable time trying to understand.
    Regards to all,
    Arik Kfir.

    Originally posted by Arik Kfir ([email protected]):
    I've noticed BC4J expects some of its configuration files to be present in the standard classpath or the application.
    However, when running web-apps, the WEB-INF/classes are used for loading classes by the JVM, but they are not in the classpath literaly which causes BC4J not to find its metadata files - this has caused many people to be confused because they believed (like me) that the /classes folder is just another part of the classpath.
    But someone has to solve this! After all, if I have a million web-apps, I (as a BC4J user) do not want to include a million JAR files in the classpath. I want to put the JAR in the classes directory and have BC4J find it automatically since its part of the web-app's classes, jars/zips and such.
    ===========================================
    If I understand you correctly, it sounds like you need to put the bc4j .jar files in the /j2ee/home/lib directory...by placing a jar file there, it becomes available to all web applications running inside OC4J...
    does that solve your problem?
    regards,
    Mike Conway
    UNC Chapel Hill

Maybe you are looking for