Tomcat 4.2 is not loading a class in jar file

Hi All,
I have a java class B in a jar file which is in tomcat's lib directory. I am trying to instantiate class B from class A which is in the same jar file. But I am unable to create an instance of class B and the control in the program simply advance to the next line and there is no error printed in tomcat log files.
Can anyone please tell me what am I missing here ... why class A is getting loaded correctly whereas class B is not loaded by tomcat ?
Thanks & Regards,
Kumar.

Can you sure that there is only a A class in the classpath of Tomcat, I advise you to add
some statements into the A class so that you can be sure which classloader is used
to load the A class.

Similar Messages

  • OC4J: Class not found for class in jar file placed in \j2ee\home\applib\

    I have an ADF application which uses external libraries (jars), which works fine when running the application from within JDeveloper (TP4).
    However if I deploy the application to the embedded OC4J server it won't find any classes imported in those external libraries at runtime (deploy does work). E.g. one library class imports oracle.jbo.server.DBTransaction. If a method of this class is called I get the following exception:
    Unexpected exception caught: java.lang.NoClassDefFoundError, msg=oracle/classloader/util/AnnotatedNoClassDefFoundError
    oracle/classloader/util/AnnotatedNoClassDefFoundErrorThe same exception, when using a german locale, explicitely states that it cannot find oracle.jbo.server.DBTransaction.
    The jar files are placed in the \j2ee\home\applib\ directory and a <library> element to this path is present in application.xml.
    Any further hints what could be wrong?

    Hi Edwin,
    tried your suggestions but without success.
    when I add this library to server.xml then following error occures when starting OC4J
    17.09.2008 17:10:33 oracle.oc4j.util.SystemLog log
    SCHWERWIEGEND: Server start failed processing configuration
    java.lang.InstantiationException: Illegal tag, 'library': The library tag has moved from config/server.xml to config/application.xml, please update your configuration manually or reinstall.
            at com.evermind.server.XMLApplicationServerConfig.parseDeploymentMainNode(XMLApplicationServerConfig.java:1227)
            at com.evermind.xml.XMLConfig.parseRootNode(XMLConfig.java:342)
            at com.evermind.xml.XMLConfig.init(XMLConfig.java:222)
            at com.evermind.xml.XMLConfig.init(XMLConfig.java:154)
            at com.evermind.server.XMLApplicationServerConfig.<init>(XMLApplicationServerConfig.java:237)
            at com.evermind.server.ApplicationServer.createConfig(ApplicationServer.java:661)
            at oracle.oc4j.server.ServerFactory$Worker.prepareConfig(ApplicationServerFactory.java:225)
            at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:244)
            at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:259)
            at java.lang.Thread.run(Thread.java:619)
    17.09.2008 17:10:33 oracle.oc4j.util.SystemLog logNoStack
    SCHWERWIEGEND: Server exiting: ApplicationServer entered state EXITING--> I added this to application.xml
    Than I enabled more logging of classloader "-Duser.country=US -Dclass.load.log.level=finest"
    Here a snippet of the output at starttime of OC4J:
    ================================
    08/09/18 10:17:07 Initial class loaders created. Uptime: 3156ms.
    08/09/18 10:17:07 Loading main class com.evermind.server.OC4JServer...
    08/09/18 10:17:07 com.evermind.server.OC4JServerMain class loaded. Uptime: 3344ms.
    08/09/18 10:17:07 Transferring to com.evermind.server.OC4JServer.main()...
    08/09/18 10:17:15 Ignoring non-existent code source: D:\oracle\jdevstudio1111_preview4_standalone\j2ee\home\config\..\..\..\BC4J\lib\jmxdc.jar(from <code-source> (ignore manifest Class-Path) in /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/config/server.xml)
    08/09/18 10:17:15 Ignoring <code-source> (ignore manifest Class-Path) in /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/config/server.xml entry: code-source /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/lib/api-ext/adflogginghandler.jar (from system property api.ext.dirs) is already visible in the search path of adf.oracle.domain:11.1.4949.
    08/09/18 10:17:15 Ignoring non-existent code source: D:\oracle\jdevstudio1111_preview4_standalone\j2ee\home\config\..\..\..\BC4J\lib\jmxdc.jar(from <code-source> (ignore manifest Class-Path) in /D:/oracle/jdevstudio1111_preview4_standalone/j2ee/home/config/server.xml)
    08/09/18 10:17:15 Import was not resolved for adf.oracle.domain:11.1.4949: shared library "oracle.fabric.runtime" could not be found.
    08/09/18 10:17:15 Import was not resolved for adf.generic.domain:11.1.4949: shared library "oracle.fabric.runtime" could not be found.Seems that oracle.fabric.runtime couldn't be found but the jar's are located in D:\oracle\jdevstudio1111_preview4_standalone\lib\java\shared\oracle.fabric.runtime\11.1.1.0.0
    It's the same as with my jdeveloper installation where I don't have this problems.
    regards
    Peter

  • Server could not load the class

    I m trying to create a new adapter task bt when i select xliACE.jar from the dropdown box, its trowing an error " Server could not load the class"
    Below is the server log--
    ERROR,04 Dec 2007 09:18:48,217,[XELLERATE.JAVACLIENT],Class/Method: tcADPClient/introspect encounter some problems : RemoteException occurred in server thread; nested exception is:
    java.rmi.ServerError: Unexpected Error; nested exception is:
    java.lang.UnsatisfiedLinkError: no ACEUser in java.library.path
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    Could any one provide some help
    Thanks

    Should compile java code with the same jdk as being used by OIM

  • Ojvmtc reports xy.jar is not a class or jar file

    Hi
    I am a little bit confuced because ojvmtc reports an error I can not imagine about:
    oracle@cikic-desktop:~/Downloads/dom4j-1.6.1$ ojvmtc /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar is not a class or jar file
    The set is closed
    But jce.jar is a jar file and I can inflate it:
    oracle@cikic-desktop:/tmp/fo$ jar -xf /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    oracle@cikic-desktop:/tmp/fo$ ls -l
    total 8
    drwxr-xr-x 3 oracle oinstall 4096 2010-05-03 19:40 javax
    drwxr-xr-x 2 oracle oinstall 4096 2010-05-03 19:40 META-INF
    And if I do a ojvm on a class file everything is working like expected:
    oracle@cikic-desktop:/tmp/fo$ ojvmtc javax/crypto/Mac.class
    The set is not closed
    96 classes are missing
    So It must be a configuration mistake somewhere ...
    Can you please help me out.
    Thanks
    Christian Maier

    Coole thanks, this works pretty well!
    Chris
    oracle@cikic-desktop:~$ cp /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar /tmp/
    oracle@cikic-desktop:~$ ojvmtc /tmp/jce.jar
    The set is not closed
    131 classes are missing

  • I am getting a photoshop error could not load photoshop because the preferences file was invalid and cln't load actions because of an unexpected end of file encountered.

    I am getting a photoshop error could not load photoshop because the preferences file was invalid and cln't load actions because of an unexpected end of file encountered.

    Are you trying to open Photoshop directly, or open it by double clicking on a Photoshop document, like a PSD file?  If the former, then you might need to reinstall.  Resetting Preferences would be the firs step, but I am not sure if that will work if Photoshop is not opening in the first place.
    Try doing so anyway.  Hold down Shift Alt Ctrl (Shift Opt Cmd) while opening Photoshop. OK the message to delete Preferences.
    If you get the unexpected end of file error while trying to open Photoshop via a PSD document, then there is more than a good chance that that file is toast.
    If still stuck, we need to know Operating System, and Photoshop version.

  • Can't use brushes after re-install -Could not load the brushes because the file is not compatible wi

    I have CS3 Web Premium on an Alienware Area 51 M12j 7700i laptop.
    Recently I had to wipe the HD and reinstall the OS, and everything else.
    Photoshop deactivated, installed and re-activated fine, but when I try to use any brushes(except the default ones), I get:
    "Could not load the brushes because the file is not compatible with this version of Photoshop"
    This is weird as they worked just fine before I had to redo everything...
    Anyone know what's the cause?

    corrupted.. maybe... but if you read the post, they worked fine until the rebuild...
    And it's not "a" file, it's "many, many" files, maybe 40 or so brush files.

  • Could not load the following distribution specification files

    I am attempting to use LabWindows/CVI 9.0 to creat a distribution package.  At some point in the process something breaks, and then I can make all the changes I want, but CVI will crash when I close it, so none of my changes to the .cds file will get written.  The error on crash-exit is this:
    "Unrecoverable Internal Error at 001b:104FB24C. LabWindows/CVI will be aborted."
    and/or
    "Panel, pop-up, or menu bar handle is invalid"
    And often, when I re-open CVI, it deletes the .cds file and gives me this error:
    "Could not load the following distribution specification files: xxx.cds"
    Please advise,

    I found that everything is fine with the PRJ, CWS, and CDS, *until* I add the automatic "Project Output (Project.exe)" in the "Files" tab of the "Edit Installer" dialog box.
    As a work-around I have added the release .exe as a file in the project, and then I link that file in the "Files" tab.
    Attachments:
    Files_Tab.JPG ‏119 KB

  • DefaultCacheServer not loading tangosol-coherence-override.xml file in eclipse

    I am unable to start the DefaultCacheServer on eclipse. It doesnot start/join the cluster.I get the following :-
    ava version "1.6.0_45"
    Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
    Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
    2013-08-28 13:21:09.258/0.328 Oracle Coherence 3.6.1.0 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/C:/coherence/lib/coherence.jar!/tangosol-coherence.xml"
    2013-08-28 13:21:09.273/0.343 Oracle Coherence 3.6.1.0 <Info> (thread=main, member=n/a): Loaded operational overrides from "file:/C:/Cache/bin/tangosol-coherence-override.xml"
    2013-08-28 13:21:09.273/0.343 Oracle Coherence 3.6.1.0 <D5> (thread=main, member=n/a): Optional configuration override "/cluster-config.xml" is not specified
    2013-08-28 13:21:09.273/0.343 Oracle Coherence 3.6.1.0 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    2013-08-28 13:21:09.273/0.343 Oracle Coherence 3.6.1.0 <D6> (thread=main, member=n/a): Loaded edition data from "jar:file:/C:/coherence/lib/coherence.jar!/coherence-grid.xml"
    Oracle Coherence Version 3.6.1.0 Build 19636
    Grid Edition: Development mode
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    2013-08-28 13:21:09.507/0.577 Oracle Coherence GE 3.6.1.0 <Info> (thread=main, member=n/a): Loaded cache configuration from "file:/C:/Cache/src/config/product-config-coherence-cache-config.xml"
    2013-08-28 13:21:09.507/0.577 Oracle Coherence GE 3.6.1.0 <Info> (thread=main, member=n/a):
    Services
    Started DefaultCacheServer...
    I am using coherence - 3.6. Eclipse - Juno Release. JDK - 1.6 . The classpath setting in order is Project,JRE libraries, coherence.jar. Project has folder 'config' which has the XML files.
    I am able to start the client using the same tangosol-coherence-override.xml. Below is the XML file,

    <?xml version='1.0'?>
    <coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
       xsi:schemaLocation="http://xmlns.oracle.com/coherence/
       coherence-operational-config coherence-operational-config.xsd">
       <cluster-config xml-override="/cluster-config.xml">
       <member-identity> 
       <cluster-name>ProductConfig</cluster-name>
       <role-name>PC1</role-name> 
        </member-identity>   
    <!--  Enable Single Server mode, as we have only one JVM. -->
          <unicast-listener>
           <address system-property="tangosol.coherence.localhost">127.0.0.1
          </address>
          </unicast-listener>
          <multicast-listener>
          <time-to-live system-property="tangosol.coherence.ttl">0</time-to-live>
          </multicast-listener>  
        </cluster-config>     
        <configurable-cache-factory-config> 
           <init-params> 
              <init-param> 
                 <param-type>java.lang.String</param-type>
                 <param-value system-property="tangosol.coherence.cacheconfig"> 
                   config/product-config-coherence-cache-config.xml
        </param-value> 
              </init-param> 
           </init-params> 
       </configurable-cache-factory-config>
    </coherence>
    This is the VM arguments I am passing.
    -showversion -Dtangosol.coherence.override=tangosol-coherence-override.xml

  • Can I increase heap memory without specify any class or jar file??

    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
    can I increase heap memory without specify any class or jar file??
    thx

    chiara wrote:
    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    can I increase heap memory without specify any class or jar file??The job of java.exe is to execute java bytecode.
    What is it supposed to do with your request to use 256m of memory for heap
    when you are not giving it a class or a jar to run?

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • War file not loading - Offending class: javax/servlet/Servlet.class

    Hello;
    I've got a war file for an app that I've been building for the past several weeks. I created a new version and uploaded it to the server and received a 404 error when trying to call a servlet in the war. The catalina.out file had the following message:
    WebappClassLoader: validateJarFile(/usr/local/apache/tomcat/webapps/optintelligence/WEB-INF/lib/j2ee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    I've not changed my libraries at all and I don't see any conflict with another appliacation. The war file works on my local windows machine but has this error on a RedHat server. Both are running tomcat 4.x
    I would appreciate any information on this problem.
    Thanks;
    Marshall

    You might still get the warning when you start Tomcat:
    WebappClassLoader: validateJarFile(/usr/local/apache/tomcat/webapps/optintelligence/WEB-INF/lib/j2ee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    That's because you have the j2ee.jar as part of the web application. The servlet specficiation forbids a web application trying to override core java, j2ee classes. Thererfore Tomcat prints the warning message that the particular jar could not be loaded as it is trying to override a core java-j2ee class.
    If you remove the j2ee.jar from the web app WEB-INF/lib folder, the warning will disappear.

  • Tomcat says WARNING: Could not load ViewHandler com.sun.facelets.FaceletVie

    Hi,
    My Tomcat (5.5.17) in NetBeans5.5 says
    WARNING: Could not load ViewHandler com.sun.facelets.FaceletViewHandler
    java.lang.ClassNotFoundException: com.sun.facelets.FaceletViewHandler
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
    How can I fix this warning?
    please help.
    thnx in advance.

    It sounds like your application isn't including the jsf-facelets.jar.

  • JRE not loading remote classes

    Hi all,
    i've installed the JRE1.3.1_02 into a Windows 95 machine, just downloading the j2re-1_3_1_02-win.exe file from the sun.com URL, and even when in some another machines it's working perfectly, in this one, when trying to open am applet, the console shows the following error message (i paste the error i found in java.sun.com main page):
    cargar: clase jug2 no encontrada.
    java.lang.ClassNotFoundException: java.net.SocketException: Option unsupported by protocol: create
    it seems that the JRE cannot load remote classes, but why? and, more important, how to solve it?
    thanks in advance

    seraln,
    Do a search, here, on Win95 winsock. There's an abundance of messages regarding your problem. (You still want to load the most recent Win95 SP to get the improved winsock).
    Good luck,
    James

  • How to load a class in lib/file.jar

    Hi,
    I use jboss 4.0.2. and i have a jar-file from a third party in my server/default/lib that calls Thread.currentThread().getContextClassLoader().loadClass("foo"); My problem is that foo.class is never found and i dont know where i have to place this class. I would like to have a seperate folder for my classes, but i dont know how i should configure the classloader to find my classes. i dont want to package them in a jar.
    Thanks a lot!

    i tried this but the class was not found
    my simple question is:
    if a class in a jar that is placed in my jboss/server/default/lib-directory tries to load a class dynamic, where is it(classloader) looking? please tell me...
    thanks

  • Workshop not finding all classes in jar.

    I've added a jar to my application's Libraries but when I expend it not all of the public classes in the jar are visible. Within one package, for example, two public classes are and two aren't.
    The same jar can be read fine by the Eclipse IDE and when I use WinZip I see all the class files, so I'm pretty sure the behavior is with Workshop. Are there settings with respect to Libraries I might be missing?

    Is there a cleaner way to do this?No. You have to search for the classes in the file system (or JARs or whatever) if the class isn't already loaded.
    - Marcus Sundman

Maybe you are looking for

  • How can i make from a GUI application an Applet ?

    Hello, i have a gui appliction and i want to make an applet how can i do that, i read an article (i need to put away method main and write method init (must be same as a constructer , but my constructor is only public Grafika() ) but it doest help...

  • Only one top level element is allowed in an XML document. Line 2, Position 2

    I get this error when I try to run an xsql query with a where clause: Only one top level element is allowed in an XML document. Line 2, Position 2 <font size='-1' face='monospace'>XSQL-005: XSQL page is not well-formed.</font><BR> -^ Here is the xsql

  • PI Message Alerts

    Hi, I have been able to setup Alert Categories, Alert Rules and Scot to receive the alerts via e-mail. I have been able to receive a few alerts into my Alert Inbox and via mail. I am using the same fault message to trigger the alert message. Now howe

  • How  to set DataGrid one cell colour

    I want to set one cell colour in DataGrid,for example,when a set a CheckBox in DataGrid ,I want letset this Cell's colour change

  • Does JMS parse xml content in TextMessages

              Hi           I am working on WLS 6.1sp2 and I am using jms TextMessage type of message to           send XML messages from one subsystem to another. I have added an XML registry           for my version of XML parser. Now I do not have any