Compiler Error when Loading JAR File

I am attempting to load a third party JAR file into an Oracle 8.1.6 database. Most of the packages in the JAR loaded, however one did not. It generated the following Oracle error: ORA-29545: badly formed class: sendData overrides a final method.
The loadjava command that I used was:
loadjava -u myid/mypass@mydb:1521:orcl -t -r myjar.jar.After examining the JAR file, the error statement is true. The class with the error was overriding the sendData final method of a base class. Obviously the code compiled, hence a JAR was created.
Are there options that can be set when using loadjava to ignore this?
Any help is greatly appreciated.

Update. If anyone should come across this problem, I found an option to the loadjava command for 8.1.6 called -noverify. Running loadjava with this option on, will get the compiled code into the database and validate it, without verifying the structure. This bypasses the invalid structure and everything works great.

Similar Messages

  • Compilation error when deploying EAR file on standalone OC4J...

    Hi All,
    I am getting the following error when trying to deploy an EAR File describing a web service from the Jdeveloper IDE to the stanalone OC4J server instance.
    ==========================================================
    Uploading file JavaWebServiceEmp-GetDates-WS.ear ...
    Application Deployer for JavaWebServiceEmp-GetDates-WS STARTS.
    Copy the archive to C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS.ear
    Initialize C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS.ear begins...
    Unpacking JavaWebServiceEmp-GetDates-WS.ear
    Done unpacking JavaWebServiceEmp-GetDates-WS.ear
    Unpacking WebServices.war
    Done unpacking WebServices.war
    Initialize C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS.ear ends...
    Starting application : JavaWebServiceEmp-GetDates-WS
    Initializing ClassLoader(s)
    Initializing EJB container
    Loading connector(s)
    Starting up resource adapters
    Initializing EJB sessions
    Committing ClassLoader(s)
    Initialize WebServices begins...
    Initialize WebServices ends...
    Started application : JavaWebServiceEmp-GetDates-WS
    Binding web application(s) to site default-web-site begins...
    Binding WebServices web-module for application JavaWebServiceEmp-GetDates-WS to site default-web-site under context root JavaWebServiceEmp-GetDates-context-root
    Operation failed with error:
    Error compiling :C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home\applications\JavaWebServiceEmp-GetDates-WS\WebServices: compilation error occurred
    Deployment failed
    Elapsed time for deployment: 1 minute, 50 seconds
    ==========================================================
    Please could somebody help me out with this? Basically I am not able to understand how to deploy the EAR file created under the MyWork folder under jdeveloper\jdev to the applications folder of j2ee\home. I am new to both EAR deployment as well as web services and would like to get a good understanding of the working of a web service which includes SOAP components and the like.
    Any help with regards to building and deploying a web service on standalone OC4J would be appreciated. Thanks a lot.

    Initially I followed the following steps to start up OC4J:-
    Settings :-
    1) Jdeveloper is setup under C:\Lester\Testing as Jdev10.1.3 folder
    2) I downloaded the extended oc4j zip folder and unzipped it under a new folder oc4j at the location C:\Lester\Testing\Jdev10.1.3
    Steps followed to run oc4j and deploy application
    1) Setup a standalone oc4j from the jdeveloper ide giving C:\Lester\Testing\Jdev10.1.3\oc4j as the root folder for oc4j.
    2) While doing step 1 added password and deployed it. Changed server.xml under C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/config
    to include the following:-
    <shared-library name="global.libraries" version="1.0" library-compatible="true">
    <code-source path="C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/applib"/>
    </shared-library>
    AND
    <java-compiler name="javac" in-process="false" options="-J-Xmx1024m -encoding UTF8" bindir="C:\Jdeveloper\jdk" extdirs="C:\Jdeveloper/jdk" />
    3) Opened a command prompt and went to the location C:\Lester\Testing\JDev10.1.3\oc4j\j2ee\home and ran the following command:-
    --> java -jar oc4j.jar
    4) Deployment: Then I deployed my primewebservice application from command prompt at C:\Lester\Smart Cylinder\Example code\prime\PrimeNumberService>
    using:-
    --> java -jar C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/admin.jar ormi://172.20.13.164:8888 oc4jadmin welcome -deploy -file PrimeNumberService.ear -deploymentName DocStyleWebService
    5) Web Binding: Then I bound my primewebservice application from command prompt at C:\Lester\Smart Cylinder\Example code\prime\PrimeNumberService>
    using:-
    --> java -jar C:\Lester/Testing/JDev10.1.3/oc4j/j2ee/home/admin.jar ormi://172.20.13.164:8888 oc4jadmin welcome -bindWebApp DocStyleWebService PrimeNumberService_web http-web-site /docws
    6) Steps 4 and 5 went through without error.
    7) However when trying to access the web service using the following link I get the standard HTTP 404 (Page not found) error:-
    http://localhost:8888/docws/prime
    This was before I tried deploying the web service through jdeveloper IDE.
    I had tried the document web service given at the following link:-
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/webservices/docservice/index.html
    from the web services how to links
    http://www.oracle.com/technology/sample_code/tech/java/codesnippet/webservices/index.html
    Please could somebody help me out? Also periodically I recieve the ojc.exe not found error when trying to deploy an application using jdeveloper ide. There are two conflicting jdeveloper versions one comes with this exe and one without.
    Message was edited by:
    Lester N

  • Error when loading security file .sec

    Hi
    I am getting error when tried to load security file
    Below  is extract of security file
    !FILE_FORMAT=2.0
    !VERSION=11.12
    !USERS_AND_GROUPS
    Praveen@Native Directory
    admin@Native Directory
    !SECURITY_CLASSES
    [Default]
    123
    !ROLE_ACCESS
    Provisioning Manager;Praveen@Native Directory
    Journals Administrator;Praveen@Native Directory
    Advanced User;Praveen@Native Directory
    Data Form Write Back from Excel;Praveen@Native Directory
    Inter-Company Transaction Admin;Praveen@Native Directory
    Provisioning Manager;admin@Native Directory
    Application Administrator;admin@Native Directory
    !SECURITY_CLASS_ACCESS
    123;Praveen@Native Directory;All;N
    i want to add a user and wan to give provision in the above security  file .sec (without doing it in Sharedservices )
    for the above security file i have added balaji and loaded it to HFM its not working.
    !FILE_FORMAT=2.0
    !VERSION=11.12
    !USERS_AND_GROUPS
    Praveen@Native Directory
    balaji@Native Directory
    admin@Native Directory
    !SECURITY_CLASSES
    [Default]
    123
    !ROLE_ACCESS
    Provisioning Manager;Praveen@Native Directory
    Journals Administrator;Praveen@Native Directory
    Advanced User;Praveen@Native Directory
    Data Form Write Back from Excel;Praveen@Native Directory
    Inter-Company Transaction Admin;Praveen@Native Directory
    Provisioning Manager;balaji@Native Directory
    Journals Administrator;balaji@Native Directory
    Advanced User;balaji@Native Directory
    Data Form Write Back from Excel;balaji@Native Directory
    Inter-Company Transaction Admin;balaji@Native Directory
    Provisioning Manager;admin@Native Directory
    Application Administrator;admin@Native Directory
    !SECURITY_CLASS_ACCESS
    123;Praveen@Native Directory;All;N
    123;balaji@Native Directory;All;N
    Can we add users and give provision in security file without creating user in shared services  ?
    Thanks

    If you have your application built using MSAD, then you an load the file the way you built it above, however because you're using the NativeDirectory, you need to create the user in the Directory(HSS) first.  Once the user is created, you can then go through and use the .sec method to assign access/roles, but the actual user creation can't be done through a load file.
    One of the easiest reasons to understand why this can't be done is that when you load the .sec file, you're not setting up a password for the user.

  • Errors when loading flat file data

    We just test to load a very simple flat file data with only two lines and the two lines of data in preview of InfoSource is correct.  But when run InfoPackage to load data, the monitor of the InfoPackage shows the following errors (see in between two dashed lines below):
    Error getting SID for ODS object ZDM_SUBS
    Activation of data records from ODS object ZDM_SUBS terminated
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Error when assigning SID (details in long text)
    Value 'Bottom' (hex. '0042006F00740074006F006D') of characteristic ZRATEPLN contains invalid characters
    Value 'Dealer' (hex. '004400650061006C00650072') of characteristic ZCHANNEL contains invalid characters
    Value 'Bottom' (hex. '0042006F00740074006F006D') of characteristic ZRATEPLN contains invalid characters
    Value '19884/' of characteristic 0DATE is not a number with 000008 spaces
    Value '/19812' of characteristic 0DATE is not a number with 000008 spaces
    Value '19884/' of characteristic 0DATE is not a number with 000008 spaces
    In the flat file (excel sheet saved as a CSV file), for each row of the data, there are two fields which are start_date and end_date and the date format is MM/DD/YYYY and in the Transfer Rule, we transfer the date format from MM/DD/YYYY to YYYYMMDD which is required by DATS InfoObject type in BW.  If you need the excel sheet of data in order to answer our questions about the above errors, you can give us your e-mail address and we can send the simple two rows of data excel sheet file to you.
    Thanks!

    Hi Kevin,
    1.You can use lowercase letters in the values for your characteristics provided you have checked the lowercase checkbox in the general tab page of Create characteristic screen.But when you do so no masterdata tables,text tables, or another level of attributes underneath are allowed.
                            OR
    Use only upper case letters in your characteristic unchecking the above mentioned box.
    2.The date format in the CSV file should be yyyymmdd.It should have 8 characters . I guess there is something strange in your "calendardays" since I could not find 8 characters irrespective of the order.Do not forget to use zeroes.
    Hope this works.
    Reward if it is helpful.
    Regards,
    Balaji

  • HFM APP error when loading security file

    <p><font size="2" color="black">Good Day,</font></p><p> </p><p><font size="2" color="black">I am getting this error whenloading security file in HFM APP.</font></p><p> </p><p><font size="2" color="black">User not found with identity=native://DN=cn=0a3b0f123e6a9b46:1f9eca5f:10f110fd853:-7d24,ou=People,dc=css,dc=hyperion,dc=com?USER</font></p><p> </p><p><font size="2" color="black">File: Version: 9.2.0.0.1077 Line:-1 Error: (-2147216700)(0x800412C4)(User not found with identity =native://DN=cn=0a3b0f123e6a9b46:1f9eca5f:10f110fd853:-7d24,ou=People,dc=css,dc=hyperion,dc=com?USER)File: CHsxDSSecurity.cpp Version: 9.2.0.0.1077 Line: 6859 Error:(-2147216700)(0x800412C4)() File: CHsxSecurity.cpp Version:9.2.0.0.1077 Line: 2307 Error: (-2147216700)(0x800412C4)() File:CHsvSecurityAccess.cpp Version: 9.2.0.0.1077 Line: 3980 Error:(-2147216700)(0x800412C4)() File: CHsvSecurityLoadACM.cpp Version:9.2.0.0.1077 Line: 2864 Error: (-2147216700)(0x800412C4)() File:CHsvSecurityLoadACM.cpp Version: 9.2.0.0.1077 Line: 535 Error:(-2147216700)(0x800412C4)()</font></p><p> </p><p><font size="2" color="black">Anyone seen this before.</font></p><p> </p><p><font size="2" color="black">Thanks</font></p><p> </p><p><font size="2" color="black">Azmat Bhatti</font></p>

    If you have your application built using MSAD, then you an load the file the way you built it above, however because you're using the NativeDirectory, you need to create the user in the Directory(HSS) first.  Once the user is created, you can then go through and use the .sec method to assign access/roles, but the actual user creation can't be done through a load file.
    One of the easiest reasons to understand why this can't be done is that when you load the .sec file, you're not setting up a password for the user.

  • Error when executing JAR file

    I am trying to execute a JAR file, via the command line, when I get the following error:
    Exception in thread "main" java.util.zip.ZipException: The system cannot find th
    e file specified
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    at java.util.jar.JarFile.<init>(Unknown Source)
    Any suggestions?

    I am trying to execute a JAR file, via the command
    line, when I get the following error:
    Any suggestions?How are you trying to execute the file?
    some suggestions
    create a manifest.mf file with the following content
    Main-Class:TheNameOfTheClassWithMainMethod
    and hit return
    jar this file with any other .class files folders etc like this
    java -jar manifest.mf nameUwantToGive.jar *.class
    run by double click or by with the following
    java -jar nameUwantToGive.jar
    Hope this helps
    AA

  • Error when loading flat files

    I am able to load a flat file to PSA but get problems when trying to load.  These files have been loaded to an old BW system from which the InfoObjects were copied and designed on the new system:  Thanks
    Diagnosis                                                                               
    The value '0,000 ' from field /BIC/KFMI_CCHF cannot be converted into   
        the DDIC data type DEC of the InfoObject in data record 1 . The field   
        content could not be transferred into the communication structure       
        format.                                                                               
    System response                                                                               
    The data to be loaded has a data error or field /BIC/KFMI_CCHF of the   
        transfer structure is mapped to an unsuitable InfoObject.                                                                               
    The conversion of the transfer structure into the communication         
        structure was cancelled. The processing of data records with errors was 
        continued with respect to the settings in the error handling of the     
        InfoPackage (Tab Page: Update Parameters).                              
    Procedure                                                                               
    Check the data conformity of your data source in the source system.                                                                               
    On the 'InfoObject - Field Assignment' tab page in the transfer rules, 
        check the InfoObject-field assignment of transfer structure field      
        /BIC/KFMI_CCHF .                                                                               
    If the data was temporarily saved in the PSA, you can also check the   
        received data for consistency in the PSA. If the data is available and 
        is correct in the source system and in the PSA, you have the option of 
        activating the debugging in the transfer rules by using the update     
        simulation on the tab page Detail   in the monitor. By doing this, you 
        can execute an error analysis in the transfer rules. For this you need 
        ABAP knowldege.

    If it is coming from another system/app, it could be that you don't need to change anything (assuming the file does contain data in DEC format).
    In this case, open the datafile in a hex editor, and check the content of this field (based on field position in your transfer structure, for the first row) in a hex editor. Every half-byte of this field should give you a digit (except the last) if the format is correct. eg you should see something like 000032560C if you check the field.
    It will be good to match the transfer structure alignment, it could be that the field is not in the position it was in the older system (check transfer structure tab in the infosource definition).

  • Error when loading XML file

    When using Load XML Data utility I am getting an error:
    ORA-00942: table or view does not exist
    Error loading XML.
    Loading as CSV text works except some records with new line characters.
    Also, when xml file is really small – “Load XML” works too. The actual file is ~ 12 MB.
    How to resolve this issue?
    Application Express 3.2.0.00.27
    Oracle 10.2.0.1.0
    Your help will be appreciated,
    Anatoly

    Hi Anatoly,
    I suspect this is a problem with the underlying package DBMS_XMLGEN and not directly in APEX.
    Can you reproduce this issue on apex.oracle.com?
    Joel

  • Compilation Error when Readimg XML File.....Help me plz...

    Hi Dudes,
    I am new to XML, when I am trying to read (parsing) the xml file from url, I am getting the following error.(using JAXP)
    xml2jsp.java:50: createTextNode(java.lang.String) in org.w3c.dom.Document cannot
    be applied to () Text index = request.createTextNode();
    here is the source code:
    import java.net.*;
    import java.io.*;
    import org.w3c.dom.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.xml.transform.dom.DOMSource;
    public class xml2jsp {
    private static String server
    = "http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&SubscriptionId=026CJ8XE8ZGWH4H58YG2&AssociateTag=" +
                                       "bookinscom-20&Operation=ItemLookup&IdType=ASIN&ItemId=0060006781&ResponseGroup=Reviews";
    public static void main(String[] args) {
    //String server = DEFAULT_SERVER;
    try {   
              // Build the request document
              DocumentBuilderFactory builderFactory
              = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder
              = builderFactory.newDocumentBuilder();
              Document request = builder.newDocument();
              Element methodCall = request.createElement("methodCall");
              request.appendChild(methodCall);
              Element methodName = request.createElement("methodName");
              Text text = request.createTextNode("calculatexml2jsp");
              methodName.appendChild(text);
              methodCall.appendChild(methodName);
              Element params = request.createElement("params");
              methodCall.appendChild(params);
              Element param = request.createElement("param");
              params.appendChild(param);
              Element value = request.createElement("value");
              param.appendChild(value);
              // Had to break the naming convention here because of a
              // conflict with the Java keyword int
              Element intElement = request.createElement("int");
              Text index = request.createTextNode();
              intElement.appendChild(index);
              value.appendChild(intElement);
              // Transmit the request document
              URL u = new URL(server);
              URLConnection uc = u.openConnection();
              HttpURLConnection connection = (HttpURLConnection) uc;
              connection.setDoOutput(true);
              connection.setDoInput(true);
              connection.setRequestMethod("POST");
              OutputStream out = connection.getOutputStream();
              TransformerFactory xformFactory
              = TransformerFactory.newInstance();
              Transformer idTransform = xformFactory.newTransformer();
              Source input = new DOMSource(request);
              Result output = new StreamResult(out);
              idTransform.transform(input, output);
              out.flush();
              out.close();
              // Read the response
              InputStream in = connection.getInputStream();
              Document response = builder.parse(in);
              in.close();
              connection.disconnect();
              NodeList doubles = response.getElementsByTagName("double");
              Node datum = doubles.item(0);
              Text result = (Text) datum.getFirstChild();
              System.out.println(result.getNodeValue());
    catch (Exception e) {
    System.err.println(e);
    Please send your valueable suggestions to sort out the error.
    Looking forward for your favourable reply.
    Regards
    Sridhar

    You need to spcify a string when you try to create a text node. If your goal is to have the <int> element with no content (like either <int></int> or <int/>) then do not create the text node and that will be the result.
    Dave Patterson

  • Core Data errors when loading saved files

    Hi there.
    I am working on a fairly simple Core Data document-based application that I am working on. Some files have been previously saved (in the same version of the app) using the SQLite and XML file types, but now cannot be reopened.
    The following error appears in the application;
    {quote}"The document “Test” could not be opened. The file isn’t in the correct format. The file might be corrupted, truncated, or in an unexpected format."{quote}
    The files themselves only have some text in them, and that is all.
    Does anyone know of a reason why these files cannot be reopened after saving them?
    Thanks in advance,
    Ricky.

    Does anyone know of a reason why these files cannot be reopened after saving them?
    Did you check to see if the file type/suffix was modified or perhaps added and then made invisible. Example: 'myfile.sql.txt' - do a get info, show suffix and double check that what you see is what you want. Also check permissions while you're there.
    If that fails, go to your backups and be careful how you modify your dbs in the future...don't just whack them with a text editor, etc.

  • Error in InfoPackage: Error when uploading Flat Files

    Hello Experts,
    I encoutered this error in Info Package when uploading a flat file.
    When i try to click on the "Preview" button, this errors appear:
    "Error 8 when compiling the upload program: Row
      237, message: Data Type / BIC/ CCCBMA1_COCTR2 was found in a newer"
    Please help to advise what is this error about and how to resolve this?

    hi Annie,
    run RSA1 and try again
    Error when compiling the upload program (Message no. RSAR233)
    other similar problem solved by run program(SE38)RS_TRANSTRU_ACTIVATE_ALL and relogon
    A newer version of the data type error when loading
    Flat File Preview error message
    Error when loading from Flat File
    Error message when previewing data in InfoPackage
    hope this helps.

  • Error 1 when loading flat file in BW 7.0

    Hi,
        The flat file structure is same as the transfer structure. Its a csv file and i also checked about the delimiters and stuff.The flat is not open and it is closed while i am loading it. The same file gets loaded if i try in another laptop with my id.If i use my colleague's id on my system also...it doest work...so, the basic problem is with my laptop. I know its nor related to type of data or transfer structure. Its some settings on my laptop which got changed automatically. If i install some other softwares like mozilla firefox or yahoo msg-will that create a problem? I am not at all understanding why its like this. Please help.The error msgs i get when i try to load the flat file -
    Error 1 when loading external data
    Diagnosis
    Error number 1 occurred when loading external data:
    1. Error when reading the file (access rights, file name, ...)
    2. File size or number of records does not correspond to the data in the control file
    3. Error when generating the IDoc
    4. File contains invalid data (errors with an arithmetic operation or data conversion)
    Procedure
    Check whether you have the required access rights and whether the data in the control file is correct (file names, record length, number of records, ...). Correct the data in the control file if necessary and check the data file for invalid data (values of the wrong type, values in the wrong format for conversion exit,...). Check whether the file has headers that have not been specified.
    Error when opening the data file C:\vikki1.csv (origin C)
    Message no.
    Diagnosis
    File C:\ vikki1.csv (origin C) could not be opened.
    Origin:
    A : Application server
    C : Client workstation
    Procedure
    Check whether the file entered exists and is not been used by other applications.

    Hi! Vikki,
    Error 1 means your flat file is open while uploading the data..
    your flat file should be closed while uploading data in BW.
    that is why it is saying "Error when opening the file..".
    first close that file n then upload..it will work.
    rest of the things are ok!..
    I hope this will help you.
    Regards,
    khyati.

  • Error while Building Jar files using [ejbc]

    Hi,
    I am building EJB's using [ant ejbc] for upgrade from Weblogic 6.1 to Weblogic 10.0. The code gets build fine but when creating the Jar file it is throwing me the following error :-
    [ejbc] Loading properties file: /C:/dev/MarketingOne/thirdparty/sms/lib/logging.//config/logging.properties
    [ejbc] SMS_ERROR:
    [ejbc] Properties:
    [ejbc] - Failed to load properties file: /C:/dev/MarketingOne/thirdparty/sms/lib/logging.//config/logging.properties
    [ejbc] java.io.FileNotFoundException: C:\dev\MarketingOne\thirdparty\sms\lib\logging.\config\logging.properties (The system cannot find the path specified)
    [ejbc] - Either invalid SMS_HOME: /C:/dev/MarketingOne/thirdparty/sms/lib/logging./ or invalid <I>SERVICE</I>_P
    ROPERTIES_FILE_NAME
    [ejbc] at java.io.FileInputStream.open(Native Method)
    [ejbc] please set SMS_HOME using -D option at JVM start up.
    Can anybody provide me with a solution for this as the path mentioned for SMS Logging.properties file is correct..??

    Actually the folder 'lib' consists of a logging Executable Jar file and the SMS folder consists of 'config' and 'lib' folders. Inside the 'config folder is a logging.properties file.
    But Actually I am not getting any idea as to from where this command is being triggered because my targets.xml file does not have any such command whereas it just builds all the files and then creates the jar file.
    Is it a problem of using EJB 2.0 in Weblogic 10.0 environment or jdk1.5..??

  • Compilation error when deploying bpel process

    Hi,
    When i try to compile and deploy my bpel process with jdeveloper i keep getting errors that some jar files are missing.
    managed to get few jar files, and finally am landing up with an error - jdev/jlib/repository.jar is missing.
    i tried reinstalling jdeveloper - dint help. i tried installing next version also - 10.1.3.5, still dint help.
    am a new bee to SOA suite. Can anyone help me how to solve this ?
    version of jdeveloper am using is 10.1.3.4
    Thanks in Advance
    KSV
    Edited by: user11359552 on Sep 24, 2009 4:17 AM

    I have created numerous BPEL processes in JDev 11.1.1.5.0 which im trying to deploy to the SOA domain on Weblogic 10.3.4.0 however each time the same error appears:Did you check server log? Exactly which class it is not able to find?
    Regards,
    Anuj

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

Maybe you are looking for

  • JDBC Error in allocating a connection

    Hi, I am trying to use an outbound jdbc eway to do a select, but the connection is not being established Here is the log error, java.sql.SQLException: Error in allocating a connection. Cause: com.microsoft.sqlserver.jdbc.SQLServerDriver And here are

  • Error in Apex form

    When running the following trigger, i am getting the error - ORA-01476: divisor is equal to zero ORA-06512: at "COSTMAN.CM_RECIPE_ITEM_T3_AFTER", line 22 ORA-04088: error during execution of trigger 'COSTMAN.CM_RECIPE_ITEM_T3_AFTER'      Error      U

  • How to delete photos from iPad when original pics are no longer on computer

    Hi I need to clear photos from my iPad that were synced from my computer some time agi. Since sycing those pics from the pc to the ipad, I cleared up my pc and backed up the photos onto discs. How do I now delete those pics from the iPad, as the the

  • Back to my mac and cable modem

    I can't find a definitive answer to this question. Is there a cable modem that is compatible with Comcast that supports Back to My Mac? Right now we have Comcast for business with fixed IPs, so I have just been using afp:// and vnc:// to access my ho

  • How to track data changes in SAP

    Hello experts, Iu2019m working on a project with a team of NON SAP architects and weu2019ve been asked to come up with some idea to keep a track of all the changes happened in SAP system by any user. So for instance let say if use makes a change and