Loading jar files using loadjava - 11g Enterprise Edition 11.1.0.6.0-64bit

Hi,
We are trying to fetch data from a weblogic server using a JMS thin client.
We have loaded our client code jar(application.jar) and the following thin client jars in oracle using loadjava.
(Version:- Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production).
1) wljmsclient.jar
2) wlthint3client.jar
3) wlclient.jar
some of the classes remain in invalid state after loading the jar files. we validate them manually.
When we run the client code we are getting following exception.
ORA-29532: Java call terminated by uncaught Java exception: java.lang.InternalError: error initializing kernel caused by: java.lang.ExceptionInInitializerError
at weblogic.protocol.ClientEnvironment.loadEnvironment(ClientEnvironment.java:22)
at weblogic.kernel.Kernel.initialize(Kernel.java:92)
at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:64)
at weblogic.rjvm.wls.WLSClientRJVMEnvironment.ensureInitialized(WLSClientRJVMEnvironment.java:55)
at weblogic.protocol.ServerURL.getDefaultURL(ServerU
Any help on the above issue?
Thanks,
Navin

Hi;
For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » JVM which is JVM dedicated forum site.
Regard
Helios

Similar Messages

  • Error while loading the jar file using loadjava

    Hi,
    I'm trying to load a jar file in to a database through the loadjava utility. First time when i loaded a jar file it created few public synonyms with /'s. like /5b3d7f97_BeanInfoIndexer.
    Now i want to drop these synonyms before i reload the jar file with loadjava.
    If i use DROP PUBLIC SYNONYM /5b3d7f97_BeanInfoIndexer; it gives the following error...
    ERROR at line 1:
    ORA-00933: SQL command not properly ended
    I wonder how to drop these synonyms. I have to drop all these synonyms to freshly load the jar file.
    Thanks
    Shiva

    You can include the synonym names in double quotes in the drop synonym command. But it is not a good idea to drop the synonyms(which have been created by loadjava) using drop synonym command. Instead, you can use dropjava command which will automatically drop all the synonyms created by the loadjava command.

  • Load .JAR file using SQL Developer

    Hi,
    I have couple of .JAR files on my local machine which has to be loaded on to the oracle server (11g). I tried using the load Java functionality in the SQL Developer but realised one could load a java class only if you had the source code.
    Is my understanding correct or is there a way to load a JAR file using sql developer ?
    Thanks

    K,
    Thanks for the answer.
    Do you know if you have to restart oracle after loading .jar files ? I ask this because I am not aware if oracle/jvm automatically knows that the jar files have been uploaded.
    Thanks

  • How to load jar file using SQL Developer

    Dear All,
    I need urgent help to load mytest.jar to the database using SQL Developer. I am able to load individual java classes to the database using SQL developers, but i could not load JAR files. Please help me any one know how to do this using SQL Developer.
    Thanks and Regards
    John p

    I don't think that's possible, so load it through the OS with the loadjava utility.
    Have fun,
    K.

  • Load PDF file using ADF 11g

    Hi There,
    I have a requirement of showing PDF file in popup window or in a frame . I am using the following code
    <af:commandButton text="#{node}" useWindow="true" action="dialog:showPDF"
    actionListener="#{ReportTemplateDesigner.downloadPDFReport}" windowHeight="300" windowWidth="400" />
    and in managed bean
    public String downloadPDFReport(ActionEvent actionEvent) throws FileNotFoundException, IOException {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    HttpServletResponse response =
    (HttpServletResponse)externalContext.getResponse();
    File file = new File("C:\\report.pdf");
    FileInputStream input = new FileInputStream(file);
    BufferedInputStream bInput = null;
    BufferedOutputStream output = null;
    try {
    bInput = new BufferedInputStream(input, DEFAULT_BUFFER_SIZE);
    response.reset();
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition",
    "inline; filename=\"" + "ABC" + "\"");
    output =
    new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
    System.out.println("inside download PDF report");
    byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
    int length;
    while ((length = input.read(buffer)) > 0) {
    output.write(buffer, 0, length);
    output.flush();
    } finally {
    close((Closeable)output);
    close((Closeable)bInput);
    facesContext.responseComplete();
    return "dialog:showPDF";
    I can see the pdf file is loaded into the same window . Could anyone tell me is there any way to load PDF file on the same page in a frame ?
    Thanks in advance,
    Ree

    Managed bean code :
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext =
    facesContext.getExternalContext();
    HttpServletRequest request =
    (HttpServletRequest)externalContext.getRequest();
    String originalUrl = (request.getRequestURL().toString());
    String find = "Report";
    String replace = "Report/" + pdfFileName; // path of pdf file .
    pdfUrl = replaceAllWords2(originalUrl, find, replace);
    System.out.println("PDF URL :" + pdfUrl);
    Jsf code
    <af:inlineFrame source="#{Report.pdfUrl}"
    inlineStyle="width:100%; height:100%;"></af:inlineFrame>
    Hope this help.
    Reena

  • Java Mail throws Connect failed error in Oracle 11g Enterprise  Edition

    Hi,
    I am using Oracle 11g Enterprise edition.I have a java class which is used for reading outlook 2010 inbox and download attachments from mails .For Connecting to OutLook from oracle i am using "POP3S" protocol in my java class. Which is working fine until my database is oracle-11g standard edition. Last week we are upgraded our database from oracle 11g standard edition to oracle 11g enterprise edition after that i can't connect to mail server through my java class which throws an error as follows.
    DEBUG: setDebug: JavaMail version 1.4.4
    DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc]
    DEBUG POP3: mail.pop3s.rsetbeforequit: false
    DEBUG POP3: mail.pop3s.disabletop: false
    DEBUG POP3: mail.pop3s.forgettopheaders: false
    DEBUG POP3: mail.pop3s.cachewriteto: false
    DEBUG POP3: mail.pop3s.filecache.enable: false
    DEBUG POP3: mail.pop3s.keepmessagecontent: false
    DEBUG POP3: mail.pop3s.starttls.enable: true
    DEBUG POP3: mail.pop3s.starttls.required: false
    DEBUG POP3: mail.pop3s.apop.enable: false
    DEBUG POP3: mail.pop3s.disablecapa: false
    DEBUG POP3: connecting to host "194.42.133.180", port 110, isSSL true
    javax.mail.MessagingException: Connect failed;
    nested exception is:
         javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
         at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:210)
         at javax.mail.Service.connect(Service.java:295)
         at javax.mail.Service.connect(Service.java:176)
         at GetNoonReport.Connect2Mailserver(GetNoonReport:338)
         at GetNoonReport.ReadMail(GetNoonReport:103)
    Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
         at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:501)
         at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
         at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)
         at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)
         at com.sun.mail.pop3.Protocol.<init>(Protocol.java:107)
         at com.sun.mail.pop3.POP3Store.getPort(POP3Store.java:261)
         at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:206)
         ... 4 more
    Is Oracle Enterprise Edition supports "POP3S" protocol?, Or Enterprise edition needs any additional configuration for establishing outlook connection with "pop3s" ?.
    Any help is appreciated
    Regards ,
    Nisanth

    907833 wrote:
    Hi,
    I am using Oracle 11g Enterprise edition.I have a java class which is used for reading outlook 2010 inbox and download attachments from mails .For Connecting to OutLook from oracle i am using "POP3S" protocol in my java class. Which is working fine until my database is oracle-11g standard edition. Last week we are upgraded our database from oracle 11g standard edition to oracle 11g enterprise edition after that i can't connect to mail server through my java class which throws an error as follows.
    I suspect root cause is with Java not Oracle.
    Oracle RDBMS does NOT speak any "protocol" except SQL natively.

  • Oracle Rules Manager - 11g Enterprise Ed. 11.2.0.3.0 64bit Prod - ORA-38441

    Hello Aravind:
    I'm having a problem when I try to create a rule class for an event with complex type attributes, but this is only happening in a database with this specs:
    - 11g Enterprise Edition 11.2.0.3.0 64bit Prod
    The previously specification is installed on my client server. When I run the script with the "create_rule_class" the following error raises:
    - ORA-38441: System could not derive the list of STORED and INDEXED attributes
    When I create rule class on my development environment, with the same script, everything works fine, my configuration is this:
    - 11g Standard Edition 11.2.0.2.0 64bit Prod
    Any ideas??
    Thnks in advance.

    手動で削除してから再作成してみては如何でしょうか。
    #バックアップは取りましょう!
    <<http://docs.oracle.com/cd/E16338_01/server.112/b56301/dbcontrol005.htm#BEJJDHGB>>
    もしくは最初のdeconfigも「-repos drop」で実施してみるとか、、、

  • Can i load a class in subdirectoy  inside a jar file using applet tag?

    hi every one.. thank you for reading ... i am really in dire need for the solution..
    my problem is that i have a jar file contianing a package which inturn contains my applet class...
    i am trying to access this applet class using a applet tag in html file. this html file is in same directory as the jar file. i am having no problems in windows but when i am doing this in linux apache server i was getting class not found exception. (already checked the file permissions). and when i am successful when using simple package directory instead of jar file . so gist of my quesition is "can i load a class in subdirectoy inside a jar file using applet tag in a html file"?

    When you tested in Windows were you using Internet Explorer? On Linux you will be using a different browser, usually Mozilla of some version, or Firefox. Note that the HTML tags for applets will be different between the browsers if you are using the object tag. Principally the classid value for the object tag will differ between Firefox and Internet Explorer.

  • How to load jar file in oracle 9i???

    Hi Friends,
    Can you help me, how to load jar file oracle 9i? I have to tried to load in 10g using loadjava command but it's not working in oracle 9i because the loadjava batch file itself is not there in oralce 9i.
    Is there any other way then pls let me know.
    - Hiren Modi

    Hi,
    I have oracle version : Release 2 (9.2.0.1.0) for Windows. I have tried to execute the loadjava command from SQL prompt but its giving as below.
    H:\>loadjava
    The system cannot find the path specified.
    Do you know why its giving error like this. I have checked in dir : C:\oracle\ora92\bin but loadjava executable file is not there in it.
    - Hiren Modi

  • Load jar file into Oracle db 10.1.0.2.0.

    Hi,
    I am trying to create a Java Stored procedure that is dependent on some other classes. The java source doesn't compile since it cannot find the imported libs.
    How can I load jar files into the database so I can get my java source to compile?
    I have heard of dbms_java.loadjava procedure, but not very clear on how to use it.
    Please let me know how I can load the jar files in to the db.
    Thanks,
    -- DR.

    http://oraclesvca2.oracle.com/docs/cd/B12037_01/java.101/b12021/dbms_jav.htm

  • Urgent: Does dbms_java package is required  to load jar file into database?

    Hi, It's a urgent request. I am trying to install jar file that was created by JDeveloper into database using loadjava. But it is giving so many errors.
    Do we need to install dbms_java package in order to load jar files into the database? Thanks.

    Thanks for your reply Kamal.
    I am trying to load these jar files into Oracle 9.2.0.3.20 database.
    Could you please give me the list of the steps to enable java within the database? Thanks.

  • Loading jar files at execution time via URLClassLoader

    Hello�All,
    I'm�making�a�Java�SQL�Client.�I�have�practicaly�all�basic�work�done,�now�I'm�trying�to�improve�it.
    One�thing�I�want�it�to�do�is�to�allow�the�user�to�specify�new�drivers�and�to�use�them�to�make�new�connections.�To�do�this�I�have�this�class:�
    public�class�DriverFinder�extends�URLClassLoader{
    ����private�JarFile�jarFile�=�null;
    ����
    ����private�Vector�drivers�=�new�Vector();
    ����
    ����public�DriverFinder(String�jarName)�throws�Exception{
    ��������super(new�URL[]{�new�URL("jar",�"",�"file:"�+�new�File(jarName).getAbsolutePath()�+"!/")�},�ClassLoader.getSystemClassLoader());
    ��������jarFile�=�new�JarFile(new�File(jarName));
    ��������
    ��������/*
    ��������System.out.println("-->"�+�System.getProperty("java.class.path"));
    ��������System.setProperty("java.class.path",�System.getProperty("java.class.path")+File.pathSeparator+jarName);
    ��������System.out.println("-->"�+�System.getProperty("java.class.path"));
    ��������*/
    ��������
    ��������Enumeration�enumeration�=�jarFile.entries();
    ��������while(enumeration.hasMoreElements()){
    ������������String�className�=�((ZipEntry)enumeration.nextElement()).getName();
    ������������if(className.endsWith(".class")){
    ����������������className�=�className.substring(0,�className.length()-6);
    ����������������if(className.indexOf("Driver")!=-1)System.out.println(className);
    ����������������
    ����������������try{
    ��������������������Class�classe�=�loadClass(className,�true);
    ��������������������Class[]�interfaces�=�classe.getInterfaces();
    ��������������������for(int�i=0;�i<interfaces.length;�i++){
    ������������������������if(interfaces.getName().equals("java.sql.Driver")){
    ����������������������������drivers.add(classe);
    ������������������������}
    ��������������������}
    ��������������������Class�superclasse�=�classe.getSuperclass();
    ��������������������interfaces�=�superclasse.getInterfaces();
    ��������������������for(int�i=0;�i<interfaces.length;�i++){
    ������������������������if(interfaces[i].getName().equals("java.sql.Driver")){
    ����������������������������drivers.add(classe);
    ������������������������}
    ��������������������}
    ����������������}catch(NoClassDefFoundError�e){
    ����������������}catch(Exception�e){}
    ������������}
    ��������}
    ����}
    ����
    ����public�Enumeration�getDrivers(){
    ��������return�drivers.elements();
    ����}
    ����
    ����public�String�getJarFileName(){
    ��������return�jarFile.getName();
    ����}
    ����
    ����public�static�void�main(String[]�args)�throws�Exception{
    ��������DriverFinder�df�=�new�DriverFinder("D:/Classes/db2java.zip");
    ��������System.out.println("jar:�"�+�df.getJarFileName());
    ��������Enumeration�enumeration�=�df.getDrivers();
    ��������while(enumeration.hasMoreElements()){
    ������������Class�classe�=�(Class)enumeration.nextElement();
    ������������System.out.println(classe.getName());
    ��������}
    ����}
    It�loads�a�jar�and�searches�it�looking�for�drivers�(classes�implementing�directly�or�indirectly�interface�java.sql.Driver)�At�the�end�of�the�execution�I�have�found�all�drivers�in�the�jar�file.
    The�main�application�loads�jar�files�from�an�XML�file�and�instantiates�one�DriverFinder�for�each�jar�file.�The�problem�is�at�execution�time,�it�finds�the�drivers�and�i�think�loads�it�by�issuing�this�statement�(Class�classe�=�loadClass(className,�true);),�but�what�i�think�is�not�what�is�happening...�the�execution�of�my�code�throws�this�exception
    java.lang.ClassNotFoundException:�com.ibm.as400.access.AS400JDBCDriver
    ��������at�java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    ��������at�java.security.AccessController.doPrivileged(Native�Method)
    ��������at�java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    ��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    ��������at�sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    ��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    ��������at�java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    ��������at�java.lang.Class.forName0(Native�Method)
    ��������at�java.lang.Class.forName(Class.java:140)
    ��������at�com.marmots.database.DB.<init>(DB.java:44)
    ��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
    ��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
    ��������at�com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
    ��������at�com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
    Driver�file�is�not�in�the�classpath�!!!�
    I�have�tried�also�(as�you�can�see�in�comented�lines)�to�update�System�property�java.class.path�by�adding�the�path�to�the�jar�but�neither...
    I'm�sure�I'm�making�a/some�mistake/s...�can�you�help�me?
    Thanks�in�advice,
    (if�there�is�some�incorrect�word�or�expression�excuse�me)

    Sorry i have tried to format the code, but it has changed   to �... sorry read this one...
    Hello All,
    I'm making a Java SQL Client. I have practicaly all basic work done, now I'm trying to improve it.
    One thing I want it to do is to allow the user to specify new drivers and to use them to make new connections. To do this I have this class:
    public class DriverFinder extends URLClassLoader{
    private JarFile jarFile = null;
    private Vector drivers = new Vector();
    public DriverFinder(String jarName) throws Exception{
    super(new URL[]{ new URL("jar", "", "file:" + new File(jarName).getAbsolutePath() +"!/") }, ClassLoader.getSystemClassLoader());
    jarFile = new JarFile(new File(jarName));
    System.out.println("-->" + System.getProperty("java.class.path"));
    System.setProperty("java.class.path", System.getProperty("java.class.path")+File.pathSeparator+jarName);
    System.out.println("-->" + System.getProperty("java.class.path"));
    Enumeration enumeration = jarFile.entries();
    while(enumeration.hasMoreElements()){
    String className = ((ZipEntry)enumeration.nextElement()).getName();
    if(className.endsWith(".class")){
    className = className.substring(0, className.length()-6);
    if(className.indexOf("Driver")!=-1)System.out.println(className);
    try{
    Class classe = loadClass(className, true);
    Class[] interfaces = classe.getInterfaces();
    for(int i=0; i<interfaces.length; i++){
    if(interfaces.getName().equals("java.sql.Driver")){
    drivers.add(classe);
    Class superclasse = classe.getSuperclass();
    interfaces = superclasse.getInterfaces();
    for(int i=0; i<interfaces.length; i++){
    if(interfaces[i].getName().equals("java.sql.Driver")){
    drivers.add(classe);
    }catch(NoClassDefFoundError e){
    }catch(Exception e){}
    public Enumeration getDrivers(){
    return drivers.elements();
    public String getJarFileName(){
    return jarFile.getName();
    public static void main(String[] args) throws Exception{
    DriverFinder df = new DriverFinder("D:/Classes/db2java.zip");
    System.out.println("jar: " + df.getJarFileName());
    Enumeration enumeration = df.getDrivers();
    while(enumeration.hasMoreElements()){
    Class classe = (Class)enumeration.nextElement();
    System.out.println(classe.getName());
    It loads a jar and searches it looking for drivers (classes implementing directly or indirectly interface java.sql.Driver) At the end of the execution I have found all drivers in the jar file.
    The main application loads jar files from an XML file and instantiates one DriverFinder for each jar file. The problem is at execution time, it finds the drivers and i think loads it by issuing this statement (Class classe = loadClass(className, true);), but what i think is not what is happening... the execution of my code throws this exception
    java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at com.marmots.database.DB.<init>(DB.java:44)
    at com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
    at com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
    at com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
    at com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
    Driver file is not in the classpath !!!
    I have tried also (as you can see in comented lines) to update System property java.class.path by adding the path to the jar but neither...
    I'm sure I'm making a/some mistake/s... can you help me?
    Thanks in advice,
    (if there is some incorrect word or expression excuse me)

  • How to load jar file in one shot?

    I have a Java app refers some jar files on remote location. Loading class by class is very time consuming.
    Is it possible to load the jar files as a whole? like what applet does?
    Tried URLClass loading, even run java -jar, still those load class on demand.
    I want the jar file loaded only one time into JVM.

    I don't really understand. When you load a jar file using URLClassLoader it brings over the jar file and extracts the class files from the jar file. It does not bring over the class files as individual class files. If you mean you want to only ever bring over the jar file once then why not just copy the jar file using URLConnection and save it to disk. You can then load the jar file from disk each time the program starts.

  • How to dynamically load jar files - limiting scope to that thread

    Dynamically loading jar files has been discussed a lot. I have read a quite a few posts, articles, and demo code for doing just that. However, I have yet to find a solution to my problem. Most people modify their system class loader and are happy. I have done that and was happy for a time. Occasionally, you will see reference to an application server or tomcat or some other large project that have successfully been able to load and unload jar files, allow for dynamic deployment of code, etc. However, I have not been able to achieve similar success; And my problem is much less complicated.
    I have an application that executes a thread to send a given file/message to a standard JMS Server Queue. Depending on the parameters selected by the user, this thread may need to communicate with one of a number of JMS Servers, ie. JBoss, WebLogic, EAServer, Glassfish, etc. All of which can be done with the same code, but each needs to load their own flavor of JMS Client Jar files. In this instance, spawning a separate JVM for each communication would work from a classloader perspective. However, I need to keep it in the family and run under the same JVM, albeit each JMS Server Connection will be created and maintained in separate Threads.
    I am close, I am doing the following...
    1. Creating a new URLClassLoader in the run() method of each thread.
    2. Set this threads contextClassLoader to the new URLClassLoader.
    3. Load the javax.jms.JMSException class with the URLClassLoader.loadClass() method.
    4. Create an initialContext object within this thread.
    Note: I read that the initialContext and subsequent conext lookup calls would use the Thread�s
    contextClassLoader for finding/loading classes.
    5. Perform context.lookup calls for a connectionFactory and Queue name.
    6. Create JMS Connection, etc. Send Message.
    Most of this seems to work. However, I am still getting a NoClassDefFoundError exception for the javax.jms.JMSException class ( Note step #3 - tried to cure unsuccessfully).
    If I include one of the JMS Client jar files ( ie wljmsclient.jar for weblogic ) in the classpath then it works for all the different JMS Servers, but I do not have confidence that each of the providers implemented these classes that now resolve the same way. It may work for now, but, I believe I am just lucky.
    Can anyone shine some light on this for me and all the others who have wanted to dynamically load classes/jar files on a per Thread basis?

    Thanks to everyone - I got it working!
    First, BenSchulz' s dumpClassLoader() method helped me to visualize the classLoader hierarchy. I am still not completely sure I understand why my initial class was always found by the systemClassLoader, but knowning that - was the step I needed to find the solution.
    Second, kdgregory suggested that I use a "glue class". I thought that I already was using a "glue class" because I did not have any JMSClient specific classes exposed to the rest of the application. They were all handled by my QueueAdmin class. However...
    The real problem turned out to be that my two isolating classes (the parent "MessageSender", and the child "QueueAdmin") were contained within the same jar file that was included in the classpath. This meant that no matter what I did the classes were loaded by the systemClassLoader. Isolating them in classes was just the first step. I had to remove them from my jar file and create another jar file just for those JMSClient specific classes. Then this jar file was only included int custom classLoader that I created when I wanted to instantiate a JMSClient session.
    I had to create an interface in the primary jar file that could be loaded by the systemClassLoader to provide the stubs for the individual methods that I needed to call in the MessageSender/QueueAdmin Classes. These JMSClient specific classes had to implement the interface so as to provide a relationship between the systemClassLoader classes and the custom classLoader classes.
    Finally, when I loaded and instantiated the JMSClient specific classes with the custom classLoader I had to cast them to the interface class in order to make the method calls necessary to send the messages to the individual JMS Servers.
    psuedu code/concept ....
    Primary Jar File   -  Included in ClassPath                                                      
    Class<?> cls = ClassLoader.loadClass( "JMSClient.MessageSender" )
    JMSClientInterface jmsClient = (JMSClientInterface) cls.newInstance()                            
    jmsClient.sendMessage()                                                                      
    JMSClient Jar File  -  Loaded by Custom ClassLoader Only
    MessageSender impliments Primary.JMSClientInterface{
        sendMessage() {
            Class<?> cls=ClassLoader.loadClass( "JMSClient.QueueAdmin" )
            QueueAdmin queueAdmin=(QueueAdmin) cls.newInstance()
            queueAdmin.JMSClientSpecificMethod()
        }

  • How to load jar files from remote location

    Hi all,
    I am trying to load jar files from remote server, from a servlet which is running on OC4j.
    For doing this,First I am getting ClassLoader by using ClassLoader.getSystemClassLoader() and then type casting it to URLClassLoader.
    But by doing it I am getting ClassCastException,because oc4j returns oracle.classloader.PolicyClassLoader instead of java.net.ClassLoader.
    Appreciate if anyone can tell me how to load remote jar files using oracle.classloader.PolicyClassLoader .
    Thanks
    Harish

    Hi,
    I suppose you know about this, but just in case.
    I have used jnpl to load jar files from remote location.
    Rowan

Maybe you are looking for