Loadjava error - loading JAR file

Hi,
I am trying to load a JAR file into the DB and am getting these errors:
$ loadjava -force -user user/pass javaTelnet.jar
Error while creating class javaTelnet/ScriptHandler
    ORA-29537: class or resource cannot be created or dropped directly
Error while creating class javaTelnet/TelnetClient$ReaderThread
    ORA-29537: class or resource cannot be created or dropped directly
Error while creating class javaTelnet/TelnetClient
    ORA-29537: class or resource cannot be created or dropped directly
Error while creating class javaTelnet/TelnetWrapper
    ORA-29537: class or resource cannot be created or dropped directly
Error while creating class javaTelnet/TelnetProtocolHandler
    ORA-29537: class or resource cannot be created or dropped directly
The following operations failed
    class javaTelnet/ScriptHandler: creation
    class javaTelnet/TelnetClient$ReaderThread: creation
    class javaTelnet/TelnetClient: creation
    class javaTelnet/TelnetWrapper: creation
    class javaTelnet/TelnetProtocolHandler: creation
exiting  : Failures occurred during processing
These are the only other Java class I have in the DB.
SQL> select dbms_java.longname(object_name),status
  2  from user_objects
  3  where object_type='JAVA CLASS'
  4  /
DBMS_JAVA.LONGNAME(OBJECT_NAME)
STATUS
PBoot
VALIDThe JAR contains all class files within a package named javaTelnet.
I am able to execute the JAR successfully from command line.
Thanks

Hi,
I am not able to load a simple java source/class(either one, not both) file into the DB.
$ dropjava -user user/pass -v A.java
dropping: source A
$ loadjava -user user/[email protected] -v -resolve A.java
arguments: '-user' 'user/[email protected]' '-v' '-resolve' 'A.java'
creating : source A
loading  : source A
creating : A
resolving: source A
$
SQL> select dbms_java.longname(object_name),status
  2  from user_objects
  3  where object_type like 'JAVA %'
  4  /
DBMS_JAVA.LONGNAME(OBJECT_NAME)
STATUS
PBoot
VALIDAny guess how I may be able to resolve this issue?.
Any trace files about loadjava written anywhere ?
Thanks

Similar Messages

  • Loadjava to load jar file.

    hi all,
    i created a jar file 'hello.jar' with the contents as 'hello/HelloName.class'
    here, hello is the package and HelloName.class is a Java Class.
    the jar i created with un-compression mode. so the Class file size is same in jar file and out side of jar.
    i tried to load the jar using, loadjava, here is the syntax.
    bash-3.00$ loadjava -u user/password -v /export/home/oracle/javaSrc/hello.jar
    arguments: '-u' 'spboardv2/***' '-v' '/export/home/oracle/javaSrc/hello.jar'
    creating : class hello/HelloName
    loading : class hello/HelloName
    Classes Loaded: 1
    Resources Loaded: 0
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    it seems no errors.
    when i checked in USER_OBJECTS table,
    i found the record 'hello/HelloName' as OBJECT_NAME but the STATUS is 'INVALID'.
    Please help me how to get this.
    thanks in advance.
    regards
    pavan.

    Hi,
    got the solution for this.
    in loadjava options, there is an option '-r' or '-resolve'.
    if we used this option for loading .java file, the source will get compiled and Class file will be resolved and stored in Oracle.
    if we used this option for .class file or for .jar file, the class file will be resolved and stored in Oracle.
    loadjava -u scott/tiger -r path/Hello.class
    loadjava -u scott/tiger -r path/hello.jar
    Here, resolving means, it will check each and Class file(s), for all imports. If all other Classes exists in CLASSPATH, it will load the class and the STATUS is VALID. if it failed to load any imports, the status is INVALID and means, need to set CLASSPATH.
    now, i'm struggling how to set CLASSPATH for loadjava.
    regards
    pavan.

  • Error Loading Jar file.

    I am using Java stored procedures in my project.
    I am running oracle 9.2.0.4. Part of my program parses an xml using xerces. So I tried to load the dependencies as and when i got unresolved error. However after loading all the dependencies i still couldnt resolve most of xalan files. I get following error.
    ORA-29545: badly formed class: at offset 152 of org.apache.xalan.lib.PipeDocument.usePipe expecting a class-org.xml.sax.ContentHandler but encountered a class-org.xml.sax.ContentHandler.
    Can anybody help me how to resolve this issue.

    For your information, there are already XML parsers loaded into the database. If you haven't already done so, I suggest running the following query:
    select
       DBMS_JAVA.LONGNAME(OBJECT_NAME) as Object_Name
      ,OBJECT_TYPE
      ,OWNER
      ,STATUS
    from
       ALL_OBJECTS
    where
       upper(DBMS_JAVA.LONGNAME(OBJECT_NAME)) like '%XML%'
    and
       OBJECT_TYPE like 'JAVA %'Good Luck,
    Avi.

  • 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

  • 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.

  • 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

  • MulticastSocket Multicast socket receive error: java.lang.RuntimeException: I/O error opening JAR file from file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar

    Hi,
              I need some help.
              Product=weblogic5.1.0
              Revision=(Release Level)=
              Problem Description=
              I am doing cluster of weblogic server, I have no problem to set up the
              cluster and to run servlet and EJB examples.
              However, on my command line for startcluster I got a lot of message as
              followed:
              Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket receive
              error: java.lang.RuntimeException: I/O error opening JAR file from
              file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
              java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
              Compiled Code)
              at
              weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              .java, Compiled Code)
              at
              weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              , Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled Co
              de)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              StreamBase.java, Compiled Code)
              at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
              Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled Co
              de)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              The message freshed about every 20 seconds.
              Another question, I used a iplanet web server as a proxy server with a
              cluster of two weblogic servers pluged in, although I set
              weblogic.properties to round-robin, however, when I run a fibonacci servlet,
              it does not do the round-robin. It always go to one machine for a lot of
              times. Any idea?
              Thank you for your help.
              Tom
              

    May i presume that your cluster is configured on a shared file system?.
              I have seen this problem only if you cluster is configured on different machines
              and if the directory structure is not identical.
              let us know..
              Kumar
              Cameron Purdy wrote:
              > First, update to SP4 (or SP5 if it is out now). Second, follow the cluster
              > instructions on setting up deployments for a cluster. The only
              > implementation that I have used is the single shared location that all the
              > servers load from.
              >
              > --
              >
              > Cameron Purdy
              > http://www.tangosol.com
              >
              > "Tom Gan" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hi,
              > > I need some help.
              > >
              > > Product=weblogic5.1.0
              > > Revision=(Release Level)=
              > > Problem Description=
              > > I am doing cluster of weblogic server, I have no problem to set up the
              > > cluster and to run servlet and EJB examples.
              > > However, on my command line for startcluster I got a lot of message as
              > > followed:
              > > Fri Aug 18 11:31:44 EDT 2000:<E> <MulticastSocket> Multicast socket
              > receive
              > > error: java.lang.RuntimeException: I/O error opening JAR file from
              > > file:/D:/weblogic/mycluster/server86/tmp_deployments/ejbjar-17327.jar
              > > java.util.zip.ZipException: error in opening zip file
              > > at java.util.zip.ZipFile.open(Native Method)
              > > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              > > at java.util.zip.ZipFile.<init>(ZipFile.java, Compiled Code)
              > > at weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java,
              > > Compiled Code)
              > > at
              > >
              > weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              > > .java, Compiled Code)
              > > at
              > >
              > weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              > > , Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > > jectInputStreamBase.java, Compiled Co
              > > de)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > > tStreamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > > eamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              > > StreamBase.java, Compiled Code)
              > > at weblogic.cluster.StateDump.readObject(StateDump.java, Compiled
              > > Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > > jectInputStreamBase.java, Compiled Co
              > > de)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > > tStreamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > > eamBase.java, Compiled Code)
              > > at
              > >
              > weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > > treamBase.java, Compiled Code)
              > > at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              > > Code)
              > >
              > > The message freshed about every 20 seconds.
              > >
              > > Another question, I used a iplanet web server as a proxy server with a
              > > cluster of two weblogic servers pluged in, although I set
              > > weblogic.properties to round-robin, however, when I run a fibonacci
              > servlet,
              > > it does not do the round-robin. It always go to one machine for a lot of
              > > times. Any idea?
              > > Thank you for your help.
              > > Tom
              > >
              > >
              > >
              

  • 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.

  • 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 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()
        }

  • "error loading media-file could not be played"-when viewing webcams

    When trying to load a webcam, picture loads but will not stream.
    The following error message appears "error loading media-file could not be played"
    Everything functions when using Google Chrome.
    Any help would be much appreciated. The operating system is Vista.

    Thank you for you reply - much appreciated.
    I am a bit confused - if I do not have a player installed, how come that everything is OK when I use Google Chrome as a browser?
    Many thanks,
    Jimmy

  • Error opening jar file

    I'm using WLS 5.1 SP8 on NT 4.0 and trying to setup a cluster. The cluster
              starts fine except when I try to deploy a session bean that is marked as
              clustered. I get an error about reading a jar file
              (D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar) that WLS
              created when the server started. Every server is getting this error and I
              tried setting up the same paths (D:\weblogic) but it doesn't matter. Any
              ideas?
              Wed Jan 24 15:04:10 EST 2001:<I> <WebLogicServer> WebLogic Server started
              java.util.zip.ZipException: error in opening zip file
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java:69)
              at java.util.zip.ZipFile.<init>(ZipFile.java:84)
              at
              weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java:141)
              at
              weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              .java:74)
              at
              weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              , Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled
              Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              StreamBase.java, Compiled Code)
              at weblogic.cluster.StateDump.readObject(StateDump.java:59)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              jectInputStreamBase.java, Compiled
              Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              treamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              tStreamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              eamBase.java, Compiled Code)
              at
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              treamBase.java, Compiled Code)
              at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              Wed Jan 24 15:04:19 EST 2001:<E> <MulticastSocket> Multicast socket receive
              error: java.lang.RuntimeException: I/O error
              opening JAR file from
              file:/D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar
              

    From previous posts I see this is a known bug. Is there a fix yet? btw, how
              did a bug of this magnitude
              get past QA. :(
              Elan Halfin <[email protected]> wrote in message
              news:[email protected]...
              > I'm using WLS 5.1 SP8 on NT 4.0 and trying to setup a cluster. The cluster
              > starts fine except when I try to deploy a session bean that is marked as
              > clustered. I get an error about reading a jar file
              > (D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar) that WLS
              > created when the server started. Every server is getting this error and I
              > tried setting up the same paths (D:\weblogic) but it doesn't matter. Any
              > ideas?
              >
              > Wed Jan 24 15:04:10 EST 2001:<I> <WebLogicServer> WebLogic Server started
              > java.util.zip.ZipException: error in opening zip file
              > at java.util.zip.ZipFile.open(Native Method)
              > at java.util.zip.ZipFile.<init>(ZipFile.java:69)
              > at java.util.zip.ZipFile.<init>(ZipFile.java:84)
              > at
              > weblogic.boot.ServerClassLoader.deploy(ServerClassLoader.java:141)
              > at
              >
              weblogic.cluster.AnnotatedServiceOffer.expandClassPath(AnnotatedServiceOffer
              > .java:74)
              > at
              >
              weblogic.cluster.AnnotatedServiceOffer.readObject(AnnotatedServiceOffer.java
              > , Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > jectInputStreamBase.java, Compiled
              >
              > Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > tStreamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > eamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readArrayList(WLObjectInput
              > StreamBase.java, Compiled Code)
              > at weblogic.cluster.StateDump.readObject(StateDump.java:59)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readPublicSerializable(WLOb
              > jectInputStreamBase.java, Compiled
              >
              > Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readLeftover(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectBody(WLObjectInpu
              > tStreamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObject(WLObjectInputStr
              > eamBase.java, Compiled Code)
              > at
              >
              weblogic.common.internal.WLObjectInputStreamBase.readObjectWL(WLObjectInputS
              > treamBase.java, Compiled Code)
              > at weblogic.cluster.TMSocket.execute(TMSocket.java, Compiled Code)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              > Code)
              > Wed Jan 24 15:04:19 EST 2001:<E> <MulticastSocket> Multicast socket
              receive
              > error: java.lang.RuntimeException: I/O error
              >
              > opening JAR file from
              > file:/D:/weblogic/mycluster/server196/tmp_deployments/ejbjar1559.jar
              >
              >
              

  • Error loading *.bin file

    i have a certain requirement like if plugin1 is down plugin2 has to be called,
    both plugin1 and plugin2 uses same 3rd party api for plugin implementation.But when my plugin1 is down i am getting error with plugin2 like
         "Error loading resource file: challenge.bin"
    This challenge.bin is in 3rd party api used for plugin1 and plugin2 implementation.
    Error loading resource file: challenge.bin
    java.lang.NullPointerException
    at java.io.FilterInputStream.available(Unknown Source)
    at ymsg.network.ChallengeResponseV10.<clinit>(ChallengeResponseV10.java:71)
    at ymsg.network.Session.receiveAuth(Session.java:1331)
    at ymsg.network.Session$InputThread.process(Session.java:2839)
    at ymsg.network.Session$InputThread.run(Session.java:2797)
    Did anybody had such problem earlier loding *.bin files earlier.

    Hussein,
    Thanks for your reply.
    I already checked these 2 docs from oracle support and verified the compat-db rpm version.My current version of the rpm is higher than the document mentioned version.
    FYR,
    [root@apps ~]# rpm -qa compat*
    compat-db-4.2.52-5.1
    compat-readline43-4.3-3
    compat-gcc-32-c++-3.2.3-47.3
    compat-gcc-34-3.4.6-4
    compat-dapl-utils-2.0.25-2.el5
    compat-libcom_err-1.0-7
    compat-dapl-devel-2.0.25-2.el5
    compat-dapl-static-2.0.25-2.el5
    compat-glibc-headers-2.3.4-2.26
    compat-libstdc++-33-3.2.3-61
    compat-gcc-34-g77-3.4.6-4
    compat-libstdc++-296-2.96-138
    compat-glibc-2.3.4-2.26
    compat-dapl-2.0.25-2.el5
    compat-gcc-32-3.2.3-47.3
    compat-libgcc-296-2.96-138
    compat-openldap-2.3.43_2.2.29-12.el5
    compat-libf2c-34-3.4.6-4
    compat-slang-1.4.9-27.2.2
    compat-gcc-34-c++-3.4.6-4
    compat-oracle-rhel4-1.0-5
    [root@apps ~]#
    Please check and suggest me to preceed further.
    Vijay.

  • Error Loading WSDL File

    I am trying to load a XMLA provider WSDL in creating Adaptive Web Service Model
    but I get error loading the file.  Where on earth is this log file that is referred to?

    Hi,
    You can check the  error by using ErrorLob view
    Goto Window->Show view->Other->PDE Runtim->Error Log
    Regards,Anilkumar

  • 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

  • Canu00B4t see log with J2EE Visual Admin or Standalone Log Viewer

    Bom dia! When logging on Log Viewer, it shows de error message: Unable to invoke LogControllerFacadeMBean method:"getMetaDataOfReaders" In J2EE Visual Admin the error message after click in the item Log Viewer is Error while loading service Log Viewe

  • Possible upgrade solution for people who have HD and problems in general.

    OK, for me, Leopard has been as painful as going osx from OS9, at least the upgrade has been , dunno about the retail copy., bugs, bugs, bugs with the upgrade for sure. Here is what happens generally., you upgrade and basically you need to run disk t

  • The old and the new - how to do it? cross post in Community.linux-User International

    Hello, Currently I have Netware 6.5.7 SB suite/ has GroupWise. I want to move to the Linux platform with OES2/NOWS. The "Boss" wants to keep the current domain: [email protected] He wants to change it to a new web site domain name: [email protected]

  • Running Jar Files created in Sun Java Studio

    Hi everyone, I am still trying to explore the functionalities (especially as regards deployment issues) of this robust IDE. However I do have a problem. I have developed a very basic program that connects to a database (MSSQL) using Java Studio 8. Ho

  • I-Pod stuck in test mode, how do I get out?

    I-Pod screen shows "Accessorize Test" below that reads "please plug FW" followed by "LCD ID: 1" and followed by "FWPWR : 0" If I plug it into my computer, it isn't recongized. Doesn't show up in I-Tunes or on My Computer. I've tried pressing all the