Overriding a class which is in JAR file ?

Hi,
     I have an application which is a Java Applet that downloads JAR files in runtime. And this Java Applet is invoked from Internet Explorer through JInitiator 1.3.1.18. I want this application to use one class say "lwWin.class" which is in my local system instead of taking it from the JAR file. This class (lwWin.class) is in a package called "MyAwt.LwWins" of JAR files which are downloaded into the directory called "d:\Classes". Is it possible to let my application to use the class which is in local system instead of taking it from the JAR File ? Please tell me a way achieve this.Hope to see your replies soon.
Thanks and Regards,
Srinivas.

It depends on the way the classes relate to one another. In a privilged appliction you could set up a special class loader, but the situation is somewhat complicated by the rules on how classes can reference those from other ClassLoaders.
You could set up an extension of URLClassLoader that special-cases that specific class.

Similar Messages

  • Taglib: class not found in jar-file

    I've got the following problem:
    I whant to deploy a taglib to tomcat 5.0.25.
    If I point to the jsp which uses the taglib I got the following error:
    org.apache.jasper.JasperException: Unable to read TLD "META-INF/taglib.tld" from JAR file "file:/C:/Programme/Apache Software Foundation/Tomcat 5.0/webapps/taglibtest/WEB-INF/lib/gsa_prod3_db_taglib.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: ch.gsa.prodass3.taglib.TagAddAttributeTEI
    If I copy the taglib.tld out of the jar-file into WEB-INF and do the mapping in web.xml, I get this error:
    org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: ch.gsa.prodass3.taglib.TagAddAttributeTEI
    root cause
    java.lang.ClassNotFoundException: ch.gsa.prodass3.taglib.TagAddAttributeTEI
    It seems like none of the files in the jar-file could be loaded.
    Has anybody an idea?
    Help would be very appreceated!
    Greetings, Jonas

    1 - double check the class is in the jar file, in that path, and is spelt correctly
    2 - restart Tomcat
    3 - check the contents of the tld file - particularly the extra-info tag and class name for it.

  • Unable to access classes in third party jar files packaged with my ejb.jar

    I have packaged some third party jar files in my xxx_ejb.jar file.  The third party jar file contains classes that are accessed by some custom classes which are in turn accessed by my bean classes.  I get the following error when my custom classes attempt to use any of the classes in one of the third party jar files:
    java.lang.NoClassDefFoundError: com/Ostermiller/util/CSVParser
    Shouldn't I be able to access classes in jar files that are packaged with my xxx_ejb.jar file?  I see the xxx_ejb.jar file as a resource of the application classloader that contains it but I don't see the third party jar files.

    As per the Java EE specification, additional JAR files should be packaged on the EAR level. Only WAR files' WEB-INF/lib folder is scanned for JAR files to be added to the classloader.

  • JAR file which needs other JAR files

    Hi,
    I try to run a jar file, which imports some external classes. These classes are in the library "reader.jar", which is added to the classpath. But if I start it with ...
         D:\TestProject>java -cp ./reader.jar -jar viewer.jar
    ... I get an error: java.lang.NoClassDefFoundError: de/readers/TestReader
    If I copy the file "reader.jar" to "... j2sdk1.4.2/jre/lib/ext", I can start
    "viewer.jar" successfull with ...
         D:\TestProject>java -jar viewer.jar
    Why can't I add "reader.jar" to the classpath or why is it not used by Java?

    When you run JAR's, you can not use the classpath defined at the command prompt (well, you can use it, it is just ignored). The JAR has its own class path defined in its manifest file. Add:
    CLASS-PATH: reader.jar
    to the manifest file of the viewer.jar and it should work.

  • How to search a class in list of  jar files

    Hi All,
    I am using Windows XP. I have some 100's of jars and I want to find in which jar file a particular class exists. The search option in Windows XP (except Windows 2000) doesn't help. I tried the sourceforge.net jarbrowser tool but it's search functionality is not working.
    Can anybody please suggest a nice tool or approach ...
    Thanks & Regards,
    Kr.

    I know of one named ClassFinder that will do what you want.

  • Finding class inside of the jar file...

    Hi,
    please could someone explain me, what is the difference between this object mapping...
    env->FindClass("com/dir1/dir2/ClassA");
    and
    env->FindClass("Lcom/dir1/dir2/ClassA;");
    because if class 'ClassA' resides inside of the jar file, which is appended to the classpath, Lcom/dir1/dir2/ClassA; don't succed and FindClass returns NULL!!!!
    Instead of if i use 'com/dir1/dir2/ClassA' string FindClass method ends with success....
    But i don't understand this...i was wondering that all my objects, not default java objects, should be mapped as L<class>;....:-((
    Please heellp

    I have noticed that a class have several notations which have been brough together of late. Even ObjectOutputStream write both java.lang.String and java/lang/String, arrays appear as [Ljava.lang.String; and the code will decode Ljava.lang.String; correctly even though it will not get generated.
    It is possible that this historical discrepencies are more visable at the native level and are yet to be fixed up ????                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Including helper classes in java proxy jar file

    I must not be using the right header search criteria because I'm sure this question
    has been asked before. In a Web Service File (.jws) I've imported a couple of
    helper classes that function as data transfer objects. I did this to maintain
    consistency with other portions of the application. The Java Proxy jar file generated
    by Workshop does not include these files. Is there a way of including these dependencies
    or do I need to distribute another jar file with my helper classes?

    Hi Naichen,
    I was able to successfully run both the autotype and clientgen Ant task, on the
    WSDL you provided. The code behind those Ant tasks are pretty much what the WebLogic
    Web Services test page run. Are you using WLS 8.1 SP2? If not, you might want
    to try with that version.
    Regards,
    Mike Wooten
    "Naichen Liu" <[email protected]> wrote:
    >
    >
    >
    Hi,
    I am having a warning message when trying to generate java proxy jar
    file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this
    service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following
    exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United
    Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly
    appreciated.
    Thanks!!!
    Naichen

  • Multiple Class-Path: attributes in Jar files

    Hello,
    I'm packaging a set of jar files for distribution with Class-Path: attributes in them. In the documentation I read and in one of the java trails it said that I could have a manifest file like:
    Class-Path: log4j.jar log4j-core.jar
    Class-Path: jsse.jar jcert.jar jnet.jar
    But this doesn't work. It only works when I do this:
    Class-Path: log4j.jar log4j-core.jar jsse.jar jcert.jar jnet.jar
    Here is how I'm running the jar:
    java -jar server.jar
    Is the documentation wrong? Or this is a bug?
    thanks
    charlie

    Certain attributes were only meant to be specified once. Like Main-Class and Class-Path for example. If these were listed two or more times, then the last occurance is the one that gets recognized (basically, each new instance overwrites the previous instance). Some attributes are listed as "per-entry" and are freely duplicated for each entry. For example signed jars could have a number of Name: and xxx-Digest: attributes.
    This link is to the manifest spec:
    http://java.sun.com/products/jdk/1.2/docs/guide/jar/manifest.html
    To answer the original posters question, the doc's are in error. Actually, the error was not in the docs, it was in the tutorial, but none the less its still in error. He could have done this:
    Class-Path: log4j.jar log4j-core.jar
    jsse.jar jcert.jar jnet.jar
    ^-- two spaces before the start of jsse.jar
    because the docs allow for line continuation (although it's not exactly clear if you read the docs). The docs are also apparently in error regarding the max line length of 72 bytes. I have tested this with over 100 char's on a win32 machine and it works fine for me. The limitation must therefore apply to some other operating system, or it could just be in error.
    -Ron

  • Failed to load main-class manifest attribute from jar files....

    Hi,
    I installed Java1.5 version in my system before to that Java1.6 was installed and uninstalled. When i i double clicked on any jar file getting a message like: Failed to load main-class manifest attribute from<name of the jar file>.jar file....
    can anyone please suggest me how to rectify this error.

    mvnath wrote:
    The jar files are worked before the installation of 1.5 but not after installation of 1.5I am guessing that the Windows file association for .jar somehow got munjed. It's hard to say since you have not provided much information.

  • How different Web Services can use a class which parses an XML file

    I am using RAD6.1 for developing and deploying web services.As I am using 15 web Services which uses a common class which is used to parse an XML file.As this XML file should be parsed only once and should be used by all the web services.I have made this common class as Singleton but it works as singleton for only one webservice and for other web service again it is parsing the xml file.I want to parse this xml file only once and used by all the web services.In my case tis file is parsed 15 times for 15 web services, but it should be parse donly once and used by all 15 services.Please give me the solution.
    Thanks and Regards
    Sayeeduzzaman

    Hello,
    the 15 Webservices should have a static attribute which contains the xml:
    private static String xml;
    then initialise the xml like this:
    if (xml == null)
    xml = parseIt();
    else
    //do nothing, XML already initialised!
    }

  • Analyzing classes within a given .jar file

    I want to write some code that will take a given .jar file and look through all of the classes defined within and pick out any classes that implement a couple of given interfaces. I've looked at the URLClassLoader class, but I don't really see how to get it to work. Anyone got any ideas?

    I'm going to guess that your problem is getting a list of classes in the jar file in the first place. To do this, use classes and methods from the java.util.zip package and perhaps also the java.util.jar package.

  • Is web-inf/classes like a exploded jar file?

    ie, can it make sense to have an ejb-jar.xml in the web-inf/classes directory of a war file?
    Petstore has one!
    Thanks
    Martin

    Unless I'm mistaken, yes, you could think of it this way.
    In development, I usually compile things to WEB-INF/classes (and put .xml and .properties files there too) and when everything works, make a .jar of it.
    Hope this helps.
    Patrick

  • Help me,JSP is not recognizing the class which in in jar under root of ear

    <%@ page import="com.sample.components.HttpUtil"%>
    I am not able to get the HttpUtil class in my JSP.Above is my declaration .I am getting compilation error.
    The HttpUtil class is under components package,which was in components.jar.
    And it is kept under root of ear.And the classpath for web is having entry of that jar.
    Please help me

    I changed the <form> in the jsp to div and its working fine. I do not need to have comments in JavaScript funcion() anymore. I don't know why that made the difference though? According to:
    http://www.w3schools.com/tags/tag_form.asp
    The <form> tag is used to create an HTML form for user input.
    The <form> element can contain one or more of the following form elements:
    <input>
    <textarea>
    <button>
    <select>
    <option>
    <optgroup>
    <fieldset>
    <label>
    An HTML form is used to pass data to a server.
    I do have <button> and also send the data - the value of checkboxes - to server. So I think it should also work with <form>.
    Please let me know if you have any idea. Thanks.

  • How do class paths work with JAR files?

    Hey all,
    I have in the manifest file a path to a folder, plugins. In it I have a dir and files myDir/*.* so when unzipped it has <install-dir>/plugins/myDir/*.*. In the MF file I indicate the plugins dir as part of the class-path. When I want to load a .class file from the myDir/ dir below plugins, and the classes in there do NOT have package names in them, how is that done? Every time I try to access a file via Class.forName() it says ClassNotFoundException. If I hard-code the string as "myDir/myplugin" or use package identifer "myDir.myplugin" it still doesn't work. I don't want to unzip a ton of files from each plugin in one dir. I want a more organized way of storing them. However, because plugins can be added after the file is unzipped, I can't specify all the locations of plugins/<dir> dir's in the MF file if more are added later. Is there a way to locate and load a class in ANY dir, even those that are NOT in the class-path? Please help me out if you know. Thanks.

    I really can't help accept to say that it is the way it is to avoid naming conflicts i think. can you make the plugins packages ? Otherwise especially if various people write them there may be some crazy naming conflicts hidden in trying to load things from anyplace.

  • Which JAR file has the class weblogic.xml.domimpl.Loader ?

    when an Axis web-service WSDL is read and parsed using weblogic client - i get this error. which weblogic-10 jar file has this class "weblogic/xml/domimpl/Loader" ?
    java.lang.NoClassDefFoundError: weblogic/xml/domimpl/Loader
    at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.java:168)
    at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:58)
    at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
    at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:402)
    at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:388)
    at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:78)
    at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:65)
    at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:468)
    at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:114)
    at com.qwest.assia.service.client.Provisioning_Info_Impl.<init>(Unknown Source)
    at com.qwest.assia.service.client.Provisioning_Info_Impl.<init>(Unknown Source)
    at com.qwest.iom.connector.adapter.webservice.qcontrol.AssiaWebServiceConnectionFactory.getWebServiceConnection(AssiaWebServiceConnectionFactory.java:64)
    at com.qwest.mdw.connector.webservice.WebServiceConnectionFactory.getConnection(WebServiceConnectionFactory.java:25)
    at com.qwest.iom.connector.adapter.webservice.qcontrol.AssiaWebServiceTestCase.test_MyAccountWebService(AssiaWebServiceTestCase.java:51)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)

    Hi,
    I found it in ADF 11g R2 documentation - http://docs.oracle.com/cd/E24382_01/web.1112/e16182/taskflows_regions.htm#insertedID10
    I guess this is 11g R2 feature.
    I have a requirement to display the multiple regions dynamically. This feature suits my requirement perfectly, but unfortunately it is not available in 11g R1.
    Can we achieve the similar functionality in 11g R1 through other means?
    Thanks
    Ravi

Maybe you are looking for