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.

Similar Messages

  • 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

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

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

  • 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

  • Load jar file

    Hi
    I use EBS r12, i try to load jar file, i put it in $OA_JAVA/oracle/apps/fnd/jar and run adautocfg.sh, but the application not see the jar file?
    Is there any solution for that?
    Thanks

    Read from application developers guide for ebs developers about how to register jar files in oracle ebs. Also read these,
    Java and JAR in Oracle Apps
    http://www.exforsys.com/tutorials/oracle-apps/registering-new-forms-in-oracle-apps-11i.html
    http://www.aboutoracleapps.com/2009/01/how-to-register-shell-script-as.html

  • 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

  • Dynamically loading jar files

    Hi
    In my application I need to dynamically create objects of types specified by string which is passed as parameter. I am able to do this if the class is inside the same jar. But I need to load the class from any jar name specified. How do i go about doing this? Is there a way to dynamically loading jar files?

    It's easy. You use [url http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLClassLoader.html]URLClassLoader:String jarPath = ...;
    String className = ...;
    URLClassLoader ucl = new URLClassLoader(new URL[] { new File(jarPath).toURL() });
    Class cls = Class.forName(className, true, ucl);
    ...Regards

  • Error when trying to load jar file (loadjava)

    I have been struggling with this issue for a few days. I read all the old threads and solutions online but none of them worked. I wrote some java stored procedures and have been trying to load the required jar files. The error message I keep getting is this:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.aurora.server.tools.loadjava.ToolsError: Error during loadjava: Failures occurred during processing. Check trace file for details
    I have tried to load them using Enterprise Manager Console and the following:
    call dbms_java.loadjava(' -force -resolve
    c:\javacog\cognosClient.jar', ' -resolver "((* PUBLIC) (*
    SYS) )"')
    Any ideas? We are using Oracle 10gr2, and trying to load Cognos 8.3 SDK jar files. According to Cognos, Java 1.4 is supported.
    Edited by: user10406501 on Oct 8, 2008 2:26 PM

    Sorry to respond to an old message, I was just looking for the solution for the totally different problem.
    Key word 'Cognos' got me here.
    I've menage to load Cognos SDK onto Oracle 10.2.0.2 on Windows XP.
    I've used simple loadjava script. After that it requires some additional GRANTs, and it works.
    If you still are looking for the solution for this problem, respond to this message, and I'll post the scripts.
    Thomas

  • 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

  • Loading jar files and calling java stored procedure

    I am trying to load jai_core.jar, jai_codec.jar, mlibwrapper.jar and another class I created into my project schema. I am having problems with resolving all of the class using the "loadjava -resolve" command as well as using the "alter java class" command. The single class I authored is not in a valid state as well as the PL/SQL wrapper for the function I am calling.
    My questions are:
    1) Does the single class need to be in a valid state before the PL/SQL wrapper will compile and be in a valid state itself?
    2) Are there any special tricks to this becuase the code I am using below doesn't seem to be working correctly?
    3. Should I worry about "resolving/validating" all of the class from the jar file? I have read conflicting views on this topic.
    SQL> CREATE OR REPLACE FUNCTION get_image (p_fileName in varchar2, p_offset in number )
    2 RETURN blob AS LANGUAGE Java
    3 NAME 'gov.irs.rtr.image.ImageUtilityFunction.getImage (java.lang.String, int) RETURN oracle.sql.BLOB';
    4 /
    Warning: Function created with compilation errors.
    SQL> show err
    Errors for FUNCTION GET_IMAGE:
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    3/1 PLS-00311: the declaration of
    "gov.irs.rtr.image.ImageUtilityFunction.getImage
    (java.lang.String, int) RETURN oracle.sql.BLOB" is incomplete or
    malformed
    Any help would be greatly appreciated.
    Regards,
    Joey

    We are using Oracle 9.2.0.8 and I have written the single class in 1.3.1.
    The first loadjava commands I tried were:
    loadjava -user username/password -resolve -resolver '((* RTRPROD)(* PUBLIC))' jai_core.jar jai_codec.jar mlibwrapper_jai.jar
    loadjava loadjava -user username/password -resolve -resolver '((* RTRPROD)(* PUBLIC) (* -))' ImageUtility.class
    Then I tried:
    loadjava -user username/password -resolve -resolver '((* RTRPROD)(* PUBLIC) (* -))' jai_core.jar jai_codec.jar mlibwrapper_jai.jar
    errors : class javax/media/jai/operator/EncodeDescriptor
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/codec/ImageCodec could not be resolved
    errors : class javax/media/jai/operator/FileStoreDescriptor
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/codec/ImageCodec could not be resolved
    errors : class com/sun/media/jai/opimage/BMPRIF
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/opimage/CodecRIFUtil could not be resolved
    errors : class com/sun/media/jai/opimage/CodecRIFUtil
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/codec/ImageCodec could not be resolved
    errors : class com/sun/media/jai/opimage/EncodeRIF
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/codec/ImageCodec could not be resolved
    errors : class com/sun/media/jai/opimage/FPXRIF
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/opimage/CodecRIFUtil could not be resolved
    errors : class com/sun/media/jai/opimage/GIFRIF
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/opimage/CodecRIFUtil could not be resolved
    errors : class com/sun/media/jai/opimage/IIPCRIF
    ORA-29534: referenced object RTRPROD.com/sun/media/jai/codec/ImageCodec could not be resolved
    This error messages goes on and on for 44 files.
    I have found out that JAI is part of the Oracle 9 Release 2 but is part of the InterMedia package that is not installed. I would imagine that the JAI libraries mentioned above would be included in InterMedai. However, there are several dependencies on packages distributed in the Sun JDK but not the Oracle Runtime.
    Regards,
    Joey

Maybe you are looking for