Calling java classes from plsql procedures

I'm attempting to call java classes from plsql procedures which will create cmsdk users, folders, groups etc, however when I attempt to load a java class into the oracle schema using the command:
loadjava -user user/password@database -resolve classname.class
It generates error messages to the effect that classes (cmsdk classes) required by the class cannot be found. The class is loaded and marked with the status "invalid". Is it therefore necessary for me to load the cmsdk packages into the schema?
Cheers
David

Using CMSDK Java API within the database has never been supported
(see Problems loading IFS's java class into database
When we needed to invoke CMSDK code from our PL/SQL code, we used one of two approaches:
(1) use advanced queues to send requests to an external Java program (the CMSDK code, running outside the database) and receive the results back (asynchronous choice); or
(2) make an HTTP request to a Java servlet (the CMSDK code, running in some Java web container like iAS) and get the response back in some custom format (XML or something) (synchronous choice).
It seems to me that the CMSDK Java API was designed to be used only in middle-tier, not in database tier.
Regards,
Daniel.

Similar Messages

  • Calling java class from PLSQL  that returns date/time a file was saved

    Does anybody know, is there a java class I can compile into Oracle DB, and call from PLSQL that returns me the date/time a file was saved.
    As far as I'm aware this cannot be achieved using UTL_FILE.
    Please advise
    Thanks
    Warren

    I found this thread from before that might be helpful
    how to connect to UNIX OS from oracle stored procedure

  • How to call java webservice from plsql procedure.

    Hi,
    Could any one please provide any reference document for invoking a java webservice from pl/sql procedure.
    regards,
    Venkat

    Hi,
    There are basically various platforms where u develop the code with different patterns, though the idea is same everywhere.
    1. If you want develop a Java Client to call a WebService from NWDS then Pls refer >>
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/cb2e29578c0262e10000000a11466f/frameset.htm
    Note: By default the WebService developed under NWDS is Document Based WebService (i.e. In WSDL the style element would be 'document')
    2. If you want to call a WebService from the platform other than NWDS than, Sun's official site would be the best choice to go for.
    Pls refer >>
    http://java.sun.com/developer/technicalArticles/J2EE/j2ee_ws/#design
    Would appreciate if you reward the points if the answer is helpful.
    Regards,
    Arvind Kugasia [[email protected]]

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • Oracle BI 11.1.1.7.1: Calling BI webservices from Plsql Procedure: ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError

    Hi,
         I have a requirement of calling BI webservices from Plsql stored procedure. I generated all my wsdl java classes and loaded them into the database. However, when I tried to call one of my java class using stored procedure, it is giving me"ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError".
    *Cause:    A Java exception or error was signaled and could not be
               resolved by the Java code.
    *Action:   Modify Java code, if this behavior is not intended.
    But all my dependency classes are present in database as java class objects and are valid. Can some one help me out of this?

    Stiphane,
    You can look in USER_ERRORS to see if there's anything more specific reported by the compiler. But, it could also be the case that everything's OK (oddly enough). I loaded the JavaMail API in an 8.1.6 database and also got bytecode verifier errors, but it ran fine. Here are the errors I got when loading Sun's activation.jar, which ended up not being a problem:
    ORA-29552: verification warning: at offset 12 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):12 by a throw at offset 18 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):18 by a throw at offset 30 of <init> void (java.lang.String, java.lang.String) cannot access class$java$io$InputStream
    verifier is replacing bytecode at <init> void (java.lang.String, java.lang.String):30 by a throw
    Hope this helps,
    -Dan
    http://www.compuware.com/products/devpartner/db/oracle_debug.htm
    Debug PL/SQL and Java in the Oracle Database

  • How to call java class from pl/sql procedure ?

    Hello everyone,
    My query is..
    There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
    and the other thing is.. oracle is in one machine and java is in another .. :(
    hope ..u can help me out !!
    Thank in advance !!

    but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
    so how to call java class file which is on another machine and oracle in another..

  • Calling Java Methods from Stored Procedures

    Can I call Java Methods from Oracle Stored Procedures? I have a Java framework that logs events and would like to reuse it for logging events that occur in stored procedures.
    null

    You need to publish java class methods to plsql.
    Attached below is some information.
    Although both PL/SQL modules and Java classes are stored in the database
    and are managed by many of the same mechanisms, each of them resides in
    its own namespace. Therefore, Java methods are not accessible from SQL
    and PL/SQL by default. In order to expose Java methods to the SQL and
    PL/SQL engines, first publish that Java method to the SQL namespace using
    a 'Call Spec'.
    Note: A 'Call Spec' does not create an additional layer of
    execution so there is no performance penalty incurred.
    A 'Call Spec' is simply a syntactical mechanism used to
    make a method known in the SQL namespace.
    The SQL name established by the 'Call Spec' can be top-level or packaged.
    The syntax differs only slightly and is consistent with that used for
    PL/SQL procedures and packages. For more information on the exact
    syntax, see the references listed in 'Related Topics'.
    In general, a top-level procedure 'Call Spec' takes the form:
    CREATE OR REPLACE PROCEDURE procname ( pname mode ptype, ... )
    AS LANGUAGE JAVA NAME 'javaname ( javatype, ... )';
    Where: procname is the SQL name you wish to publish
    pname is the name for a parameter to procname
    mode is the parameter mode (i.e. IN, OUT, IN OUT)
    ptype is a valid SQL type (e.g. NUMBER, CHAR, etc.)
    javaname is the fully qualified name of the Java method
    javatype is a Java type for the corresponding parameter
    Likewise, a top-level function 'Call Spec' takes the form:
    CREATE OR REPLACE FUNCTION fname ( pname mode ptype, ... ) RETURN rtype
    AS LANGUAGE JAVA NAME 'javaname ( javatype, ... ) return javatype';
    Where: fname is the SQL name you wish to publish
    rtype is the SQL return type of the function
    Note: Within the NAME clause, everything within quotes is case
    sensitive. For example, if the keyword 'return' is in all
    CAPS, this Call Spec will not compile.
    Other optional parts of this syntax have been omitted here for simplicity.
    Additional examples in subsequent sections illustrate some of these options.
    eg
    CREATE PROCEDURE MyProc (rowcnt IN NUMBER, numrows OUT NUMBER)
    AS LANGUAGE JAVA NAME 'MyClass.MyMethod(int, int[])';
    There are several important things to note here:
    1.) The 'Call Spec' for a JSP must be created in the same schema as the
    corresponding Java class that implements that method.
    2.) IN parameters are passed by value. This is the only parameter mode
    available in Java. OUT parameters, therefore, must be passed as single
    element arrays in order to emulate pass by reference.
    3.) Parameter names do not need to match, but the number and types of
    the parameters must match (with just one exception - see item 5 below).
    Oracle 8i supports conversions between an assortment of SQL and Java.
    See the references listed in 'Related Topics' for additional information.
    4.) Primitive types (e.g. int, float, etc.) are not required to be fully
    qualified with any package name. However, standard Java object types
    (e.g. String, Integer, etc.) as well as any user defined object types
    (e.g. like those generated by JPublisher) must be prefixed with a
    corresponding package name (e.g. java.lang) if applicable.
    5.) The 'main' method which takes a single String[] parameter can be
    mapped to any PL/SQL procedure or function which takes some number
    of VARCHAR2 or CHAR type IN parameters. For example, the java method:
    public static void main ( String[] args ) { ... }
    can be mapped to each of the following:
    PROCEDURE MyProc2 ( arg1 IN CHAR ) ...
    PROCEDURE MyProc3 ( arg1 IN CHAR, arg2 IN VARCHAR2 ) ...
    PROCEDURE MyProc4 ( arg1 IN VARCHAR2, arg2 IN VARCHAR2 ) ...
    and so forth. Parameters map to the corresponding element of the String
    array (e.g. arg1 -> args[0], arg2 -> args[1], etc.).
    null

  • Can we call Java class from LiveCycle Process?

    hi..
    I have a general query, is it possible to call customeized java class from Workbench Process?
    I found dat we can invoke a web service... is there some operation like that for calling a java class...
    Thanks and Regards,
    Ambika

    Yes.
    You can use the Script service and put your Java code in there
    Or build your own component, which is really a Java pojo, and deploy it to LiveCycle. See http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000934.html.
    Jasmin

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How to call Java class from Forms 6i?

    Hi friends,
    I need to call a Java class from my Forms 6i application.
    (It runs under WIndows XP. It's a client/server application and I have only the client and the Form builder installed on my PC)
    I don't know almost anything about Java's world so your help would be very useful for me.
    Could you tell me exactly what i have to do?
    I've read in metalink several Notes, but they supposed that the Java architecture is already installed in the computer.... I only have the default installation of Developer 6i... so I would need to know:
    - How to install/configure the neccesary to execute Java classes without problem
    - How to invoke the .class from Forms 6i.
    Thanks a lot
    Jose.

    And also this one:
    Problem Description
    Installed Forms 6i Rel 2 on a MS Windows machine. When trying to Import the Java
    Classes getting the errors
    PDE-UJI0001 Failed to create the JVM
    Solution Description
    You need to to install JDK 1.2.2 to run the Java Importer. And set the PATH's
    and classpath's correctly.
    Explanation
    1. Download and install the JDK 1.2.2.
    Possibly available at: http://java.sun.com/products/archive/
    2. Assuming the JDK 1.2.2 is installed in c:\jdk1.2.2 directory and the JRE in
    C:\PROGRA~1\JAVASOFT\JRE\1.2 directory; ORACLE_HOME=C:\Dev6iR2.
    Set the PATH to
    set PATH=c:\jdk1.2.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin\classic;%PATH%
    ( If you are using ias9i then the JDK 1.2.2 comes with the ias installtion ,
    in this case please set the PATH to
    D:\ias9i\Apache\jdk\bin;D:\ias9i\Apache\jdk\jre\bin;D:\ias9i\Apache\jdk\jre\bin\classic;%PATH% )
    3. Set the CLASSPATH to set CLASSPATH=%CLASSPATH%;C:\Dev6iR2\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
    (If you do not set the CLASSPATH correctly you will get the error
    PDE-UJI002 Unable to find the required java importer classes)
    4. Now run the Forms Builder by using the command.
    C:\Dev6iR2\bin\ifbld60.exe
    Now the Java Importer Should Run fine.
    Francois

  • Call java class from xquery

    Hi All,
    I'm working on osb 11.1.1.5 version.As per my requirement i want to call the external java class from the Xquery (version 1.0).Anybody can u please provide me any links or examples?
    Thanks in Advance!
    Radhika.

    Hi Prabu Thx for ur reply....without custom functions is there any possibilities to do this from xquery?

  • Calling java class from SLSB

    I am trying to call a java class from SLSB . There are external jars which are imported in my java class . When i try to instatiate the java class in SLSB. It ia not able to access the external jars. It gives the following exception :
    0000002e ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "applyRules" on bean "BeanId(MDB_SLSBEAR#MDB_SLSB.jar#msgProcess, null)". Exception data: java.lang.NoClassDefFoundError: org.springframework.context.ApplicationContext
    My code is as follows :
    SLSB:
    package com.vsnl.ejbs;
    import com.vsnl.pricing.bizObjects.CustomizedRateRequest;
    import com.vsnl.pricing.bizObjects.RateRequest;
    import com.vsnl.pricing.dao.ARR.AutoprocsMain;
    import org.springframework.context.ApplicationContext;
    * Bean implementation class for Enterprise Bean: msgProcess
    public class msgProcessBean implements javax.ejb.SessionBean {
    static final long serialVersionUID = 3206093459760846163L;
    private javax.ejb.SessionContext mySessionCtx;
    * getSessionContext
    public javax.ejb.SessionContext getSessionContext() {
    return mySessionCtx;
    * setSessionContext
    public void setSessionContext(javax.ejb.SessionContext ctx) {
    mySessionCtx = ctx;
    * ejbCreate
    public void ejbCreate() throws javax.ejb.CreateException {
    * ejbActivate
    public void ejbActivate() {
    * ejbPassivate
    public void ejbPassivate() {
    * ejbRemove
    public void ejbRemove() {
    public void applyRules(CustomizedRateRequest customizedRateRequest){
    System.out.println("RR ID in SLSB***"+customizedRateRequest.getProductCustomerId());
    System.out.println("RR ID in SLSB$$$"+customizedRateRequest.getIsDestFlag());
    try{
    System.out.println(" before the callng of commented function ");
    AutoprocsMain autoprocsMain = new AutoprocsMain();
    System.out.println(" after making instance ");
    //autoprocsMain.applyRules(customizedRateRequest);
    catch(Exception e){
    e.printStackTrace();
    My Java Class:
    package com.vsnl.pricing.dao.ARR;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import java.util.ArrayList;
    import java.util.List;
    import com.vsnl.pricing.dao.ARR.Base;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.apache.log4j.Logger;
    import org.drools.FactHandle;
    import org.drools.RuleBase;
    import org.drools.RuleBaseFactory;
    import org.drools.WorkingMemory;
    import org.drools.compiler.PackageBuilder;
    import org.drools.rule.Package;
    import org.springframework.context.ApplicationContext;
    import com.vsnl.pricing.bizObjects.Customer;
    import com.vsnl.pricing.bizObjects.RateRequest;
    import com.vsnl.pricing.interfaces.ARR.IARRDAO;
    import com.vsnl.util.VSNLLogger;
    import com.vsnl.pricing.bizObjects.InnerObject;
    import com.vsnl.pricing.bizObjects.CustomizedRateRequest;
    public class AutoprocsMain extends Base{
    private static Log log=LogFactory.getLog(AutoprocsMain.class);
    private static Logger logger = Logger.getLogger(Invoker.class);
    ApplicationContext ctx;
    //ApplicationContext ctx;//=configure();
    IARRDAO autoprocsDAO;//=(IAutoprocsDAO)ctx.getBean("autoProcDAOTarget");
    public AutoprocsMain() {
    System.out.println(" inside the Autoproc constructor");
    //VSNLLogger.debug(logger, "before creatiom of CTX");
    //System.out.println(" before creation of CTX ");
    try{
    //System.out.println(" inside the Autoproc constructor");
    ApplicationContext ctx=configure();
    autoprocsDAO=(IARRDAO)ctx.getBean("arrTarget");
    catch(Exception e)
    //VSNLLogger.error(logger, e.getMessage());
    //VSNLLogger.debug(logger, "after creation of CTX");
    //System.out.println(" after creation of CTX ");
    public void applyRules(CustomizedRateRequest customizedRateRequest)throws Exception{
    RateRequest rateRequest=new RateRequest();
    List rateRequestObjs= new ArrayList();
    List<CustomizedRateRequest> CustomizedRateRequestObjs=new ArrayList<CustomizedRateRequest>();
    try{
    //rateRequest= autoprocsDAO.getRecord();
    rateRequestObjs=autoprocsDAO.getAllRateRequests();
    //VSNLLogger.debug(logger, " AFTER THE CALL OF getAllRateRequests() function ");
    CustomizedRateRequestObjs=autoprocsDAO.getCustomizedObjects(rateRequestObjs);
    catch(Exception e)
    //VSNLLogger.error(logger, e.getMessage());
    RuleBase ruleBase=readRule();
    WorkingMemory workingMemory = ruleBase.newStatefulSession();
    FactHandle handle =workingMemory.insert(customizedRateRequest);
    //customizedRateRequest.setContinueRule("1");
    workingMemory.fireAllRules();
    if(CustomizedRateRequestObjs.size()>0)
    FactHandle handle =workingMemory.insert(CustomizedRateRequestObjs.get(0));
    for(int i=0;i<CustomizedRateRequestObjs.size();i++)
    CustomizedRateRequest customizedRateRequest=CustomizedRateRequestObjs.get(i);
    customizedRateRequest.setContinueRule("1");
    workingMemory.modifyInsert(handle,customizedRateRequest );
    workingMemory.fireAllRules();
    System.out.println(" after the firing of all rules ");
    public static void main (String args[])
    AutoprocsMain procsMain = new AutoprocsMain();
    try{
    procsMain.applyRules();
    catch(Exception e)
    e.printStackTrace();
    private static RuleBase readRule() throws Exception {
    System.out.println(" ****** inside readrule &&&& ");
    //read in the source
    Reader source = new InputStreamReader( AutoprocsMain.class.getResourceAsStream( "/Sample.drl" ) );
    // Reader source1 = new InputStreamReader( AutoprocsMain.class.getResourceAsStream( "/com/vsnl/resources/Sample2.drl" ) );
    //Reader source = new InputStreamReader( AutoprocsMain.class.getResourceAsStream( "/com/vsnl/resources/CustomerDiscount.drl" ) );
    //optionally read in the DSL (if you are using it).
    //Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) );
    //Use package builder to build up a rule package.
    //An alternative lower level class called "DrlParser" can also be used...
    System.out.println(" after package builder ");
    PackageBuilder builder = new PackageBuilder();
    System.out.println(" after package builder ");
    //this wil parse and compile in one step
    //NOTE: There are 2 methods here, the one argument one is for normal DRL.
    builder.addPackageFromDrl( source );
    System.out.println(" after add package source");
    //builder.addPackageFromDrl(source1);
    System.out.println(" after add package source1");
    //Use the following instead of above if you are using a DSL:
    //builder.addPackageFromDrl( source, dsl );
    //get the compiled package (which is serializable)
    Package pkg = builder.getPackage();
    System.out.println(" after get package ");
    //add the package to a rulebase (deploy the rule package).
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    System.out.println(" end of read rule function");
    return ruleBase;
    public IARRDAO retBean()
    return null;
    }

    Hi i am new to EJB .
    please explain me the problem ..and kindly tell me to how to add this in classpath. I am using webSphere application server.
    I added this in the classpath in the startup script.
    I also added all the required jars in the EAR libraries ( I am using the RAD IDE).
    Please help.

  • Calling java-class from c++ misses

    Hello,
    if I call a java-class from c++-code and the java-class imports a package (not java packages, but writen by myself), then the calling misses :-(
    If I call this class without the imports - it works!
    C++-Code:
        jclass cls = env->FindClass(javaClassname.c_str());
        if (cls == 0) {
              //error     - cls is 0 if the java-class has imports  
        }Java-Includes:
    import mypackage.Conn;
    import mypackage.Para; I set the classpath to the .jar-files. Did I forget anything else?
    Thx...

    Hello,
    if I call a java-class from c++-code and the
    java-class imports a package (not java packages, but
    writen by myself), then the calling misses :-(
    If I call this class without the imports - it works!
    C++-Code:
    jclass cls =
    env->FindClass(javaClassname.c_str());
    if (cls == 0) {
    /error     - cls is 0 if the java-class has imports
    code]
    Java-Includes:import mypackage.Conn;
    import mypackage.Para;
    I set the classpath to the .jar-files. Did I forget
    anything else?
    Thx...
    From the JNI Specification: http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html
    =======
    FindClass
    jclass FindClass(JNIEnv *env, const char *name);
    This function loads a locally-defined class. It searches the directories and zip files specified by the CLASSPATH environment
    variable for the class with the specified name.
    LINKAGE:
    Index 6 in the JNIEnv interface function table.
    PARAMETERS:
    env: the JNI interface pointer.
    name: a fully-qualified class name (that is, a package name, delimited by �/�, followed by the class name).
    If the name begins with �[� (the array signature character), it returns an array class.
    The string is encoded in modified UTF-8. ==============================
    So, to find the Conn class, you need to use:
    env->FindClass("mypackage/Conn");

  • Calling Java Class from  C++

    Hi,
    I am trying to call a Java Class from a C++ program without using GNI.
    will that be possible?
    If Yes,how colud it be done.
    Thanks in Advance.
    Vimal

    Could you please put me in detail.
    I need to send a string from C++ as a parameter to a class in Java where the parameter is being processed.
    So please throw light on this question.
    Thanks,
    Vimal

Maybe you are looking for

  • Audio No Longer Working on USB Output

    Hi, I've been using Audirvana, Bit Perfect, and other music software applications with iTunes.  Last night I unhooked the power cord and the music stopped playing.  I've tried everything and anything to fix this but I am no longer getting audio out f

  • Windows update error: Code 80072F8F

    CODE 800A1391       80072F8F

  • Master Data Source Enhancement

    Hi Gurus I have a table in SAP which has customer, Sales Organization, Distribution Channel, Language (which is in EN always) and Customer Sales Text... The Customer Sales Text is maintained at Sales Organization and Distribution Channel level..below

  • JRE 7u67 Exception Error

    Hello Folks, I'm new here and have an issues regarding the installation of JRE 7u67 on a Windows 7 tablet PC. I have installed Java runtime on a tablet PC, based on Intel Atom N2600. Once installed, I can verify java by going straight to the verifica

  • Restoring a photo from the iTunes backup of the iPhone

    My son deleted a picture of himself (he's 11) from my iPhone that he didn't want me to have. I wanted to restore it from a backup of the phone that I made last week. How do I do that? Lisa