Calling an EJB deployed in OC4J from Java Stored Proc in Oracle

Hello!
Trying to make a call to an EJB deployed in OCJ4 from a oracle java stored proc. After loaded orion.jar and crimson.jar lib into SCOTT schema, I can't get the JNDI Context working because of this error:
============================================
javax.naming.NoInitialContextException: Cannot instantiate class:
com.evermind.server.ApplicationClientInitialContextFactory. Root exception is
java.lang.ClassNotFoundException:
com/evermind/server/ApplicationClientInitialContextFactory
at java.lang.Class.forName0(Class.java)
at java.lang.Class.forName(Class.java)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java)
at javax.naming.InitialContext.init(InitialContext.java)
at javax.naming.InitialContext.<init>(InitialContext.java)
===============================
I did load the java with "loadjava" with on time with the "resolve" option and time time no option and still no working.
Here is the EJB client code:
=======================================
import java.sql.*;
import java.util.*;
import javax.naming.*;
import com.evermind.server.ApplicationClientInitialContextFactory;
class EmpRemoteCall {
public static void main(String[] args) {
System.out.println(getEmpName());
public static String getEmpName() {
String ejbUrl = "java:comp/env/ejb/Emp";
String username = "admin";
String password = "admin";
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
environment.put(Context.PROVIDER_URL, "ormi://127.0.0.1/testemp");
environment.put(Context.SECURITY_PRINCIPAL, username);
environment.put(Context.SECURITY_CREDENTIALS, password);
//environment.put(Context.SECURITY_AUTHENTICATION, ServiceCtx.NON_SSL_LOGIN);
//environment.put(javax.naming.Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
com.kboum.sertir.essais.EmpHome homeInterface = null;
try {
Class.forName("com.evermind.server.ApplicationClientInitialContextFactory", true, ClassLoader.getSystemClassLoader());
System.out.println("Creating an initial context");
Context ic = new InitialContext(environment);
System.out.println("Looking for the EJB published as 'java:comp/env/ejb/Emp'");
homeInterface = (com.kboum.sertir.essais.EmpHome) ic.lookup(ejbUrl);
catch (CommunicationException e) {
System.out.println("Unable to connect: " + ejbUrl);
e.printStackTrace();
//System.exit(1);
catch (NamingException e) {
System.out.println("Exception occurred!");
System.out.println("Cause: This may be an unknown URL, or some" +
" classes required by the EJB are missing from your classpath.");
System.out.println("Suggestion: Check the components of the URL," +
" and make sure your project includes a library containing the" +
" EJB .jar files generated by the deployment utility.");
e.printStackTrace();
//System.exit(1);
catch (ClassNotFoundException e) {
System.out.println("Unable to connect: " + ejbUrl);
e.printStackTrace();
//System.exit(1);
try {
System.out.println("Creating a new EJB instance");
com.kboum.sertir.essais.Emp remoteInterface = homeInterface.findByPrimaryKey(Integer.valueOf("7369"));
System.out.println(remoteInterface.getENAME());
System.out.println(remoteInterface.getSAL());
remoteInterface.setSAL(2);
System.out.println(remoteInterface.getSAL());
return remoteInterface.getENAME();
catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
return "error";
null

What I did to solve this problem was to
create a simple RMI remote object that
resides outside the database JVM and that
serves as a proxy EJB client for your java
stored procedure. The stored procedure can
invoke a method on the remote RMI object
which then looks up the EJBean's home
interface and invokes the relevant method on
the bean's remote interface, and relays any
return values back to the java stored
procedure.
Hope this helps,
Avi.
null

Similar Messages

  • How to call EJB deployed on OC4J from java stored procedure?

    Hello,
    I'd like to call EJB from java stored procedure. My example works fine from command line, but the problem seems to be with deployment of this code into database. Especialy I'm wondering how to reference jars like oc4jclient.jar, ejb.jar, ... from java stored procedure.
    Is there some example how to do that ?
    Can You help me please ?
    Many thanks,
    Radim Kolek,
    Eurotel Prague.

    Hi,
    You may want to check up this thread
    Calling JBoss EJBs from Java stored procedure
    Hope this helps,
    Sujatha.
    OTN Group.

  • Calling an EJB deployed in OC4J from a Java Stored Procedure

    Hi all,
    Well, I've been trying to figure this out for a bit now and haven't come up with a solution.
    I have a Java Stored Procedure in a 9i database and would like to call an EJB deployed in the OC4J Container but DO NOT want to load the various Orion JAR files into the database.
    I get hung up on the JNDI piece.
    Has anyone figured out how to do this?
    Got some code?
    Thanks!

    Doug,
    This is not possible in Oracle9i Release1. in the upcoming Oracle9i DB R2, we will support loading a client-side jars of oc4j (oc4jclient.jar) in the database and call-out EJBs in 9iAS
    Please look at this thread Re: Compile procedures for a detailed dicussion on this topic.
    regards
    Debu Panda
    Oracle

  • How to lookup EJBs deployed in OC4J from a standalone client application

    Hello all,
    I am trying to lookup an EJB deployed in OC4J 10.1.3 from a standalone client application using the following code:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791");
    env.put(Context.SECURITY_PRINCIPAL, "jazn.com/test");
    env.put(Context.SECURITY_CREDENTIALS, "test");
    Context context = new InitialContext(env);
    Object ref = context.lookup("ejb/Dispatch");
    I get the following error:
    javax.naming.NameNotFoundException: ejb/Dispatch not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    For the lookup string I've also tried:
    "java:comp/env/ejb/Dispatch" and "Dispatch"
    For the Context.PROVIDER_URL property I've also tried:
    opmn:ormi://localhost:6003:instance
    The result is always the same.
    I appreciate if someone could help me with this?
    Thanks,
    Georgi

    Georgi,
    Your question has been discussed many times on this forum. Search the forum archives for "RMIInitialContextFactory".
    The PROVIDER_URL needs to include the name of the deployed application that your EJB is part of, for example:
    env.put(Context.PROVIDER_URL, "ormi://localhost:23791/MyApp");The lookup name has to be the value of the "ejb-name" element in your "ejb-jar.xml" descriptor file.
    Your SECURITY_PRINCIPAL value looks strange to me. Personally, I use "principals" (and not JAZN), so I modified the "application.xml" file (in the "j2ee/home/config" subdirectory) to use "principals". Look for the following comment in that file:
    &lt;!-- Comment out the jazn element to use principals.
          When both jazn and principals are present jazn is used  --&gt;Good Luck,
    Avi.
    Message was edited by:
    Avi Abrami

  • Can't execute OS-level command from java stored proc

    I've written a couple simple java stored procs, the first of which writes an file and the second attempts a chown on it. I can write the file (which is written as the oracle user) just fine. I need to chown it, but can't. Here's the first proc:
    public static String writefile()
    String fileName = "/joetest/test.xml";
    try {
    File f = new File(fileName);
    FileOutputStream out = new FileOutputStream(f);
    PrintStream p = new PrintStream(out);
    p.println("this is only a test");
    p.close();
    return "create file successful!!!";
    } catch (Exception e) {
    return "Exception occurred writing file:"+e;
    Here's the proc I've been stuggling with:
    public static String chown(String inString)
    String[] command = {"/bin/sh", "-c", "/usr/bin/chown notjoe /joetest/test.xml"};
    if (inString != null) {
    command[2] = inString;
    try {
    Process p = Runtime.getRuntime().exec(command);
    return "Ownership change success!! "+p;
    } catch (Exception e) {
    return "Ownership change failure?? err="+e;
    The package is created with:
    CREATE OR REPLACE PACKAGE JOE.THISISATEST AS
    FUNCTION writefile
    return VARCHAR2
    AS
    LANGUAGE java
    NAME 'thisisatest.writefile() return java.lang.String';
    FUNCTION chown(Param1 VARCHAR2)
    return VARCHAR2
    AS
    LANGUAGE java
    NAME 'thisisatest.chown(java.lang.String) return java.lang.String';
    end;
    And I've granted the following privileges:
    begin
    dbms_java.grant_permission('JOE', 'java.io.FilePermission', '/joetest/test.xml', 'read, write, execute, delete');
    end;
    begin
    dbms_java.grant_permission('JOE', 'java.io.FilePermission', '/usr/bin/chown', 'execute');
    end;
    begin
    dbms_java.grant_permission('JOE', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    end;
    begin
    dbms_java.grant_permission('JOE', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    end;
    Here's the error that I'm getting:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Coincidentally, this is the same error that I used to get when I wrote the file without having been granted write privileges. Once I granted myself the proper 'write' permissions I could perform file IO just fine. Is there some runtime permission that I need to grant myself to run chown? I'm just guessing, as I can't find any permission like that in the java documentation. I have 'execute' permission on /usr/bin/chown and the oracle user can execute the command I'm attempting from the command line. ARRRRRGH.
    I am at my wits end with this. I've tried what seems like a thousand different syntaxes for the OS command and ran it from many different directories. Anyone have any thoughts at all as to why this is happening? I'm just clutching at straws now...

    Hmmmm. Granting 'execute' on '<<ALL FILES>>' to user JOE fixes this problem:
    begin
    dbms_java.grant_permission('JOE', 'java.io.FilePermission', '<<ALL FILES>>', 'execute');
    end;
    My security folks will not allow this when I port to production, but at least it is something.
    Message was edited by:
    user603023

  • REF CURSOR from Java Stored Proc

    Does Oracle 8i/9i allow to return REF CURSROR from Java Stored Procedure?

    Sorry,
    No I don't think this type of Java->SQL mapping was ever fixed. I know it was discussed here on the OTN forums as far back as the 8i driver, but I don't think they have ever implemented this. Perhaps someone who has actually made it work will speak up.

  • Java Stored Proc and Oracle 8.0.6.20?

    Hi,
    I have a customer using Oracle 8.0.6 (on multi-platforms). We'll need to implement a pl/sql which needs to execute an external script.
    My understanding is there are only 2 ways to achieve this: (a) use Java stored procedure, (b) use C/C++ library
    Question 1: Is Java Stored Proc available in 8.0.6?
    Question 2: Is there anywhere I can download Oracle 8.0.6 (Windows, or Tru64, Linux)?
    - Will

    java in the database was introduced from Oracle8i onwards. this version of Oracle does not support java virtual machine in the database.
    You would need to use C/C++ external procedures.

  • How to wake-up a Java Stored Proc at Oracle Server Startup

    Hi,
    I am writing a Java Stored Procedure responsible to
    execute periodically (daily for example) a command (the
    command and its arguments are prepared by the Java stored
    procedure and they are date and time sensitive).
    My questions are:
    1. Is there any way that my Java stored procedure is
    initially NOTIFIED (woke-up) when the Oracle server is
    started ? I noticed that there is a built-in Java stored procedure in Oracle DB declared as:
    "PROCEDURE notify_at_startup( user_schema VARCHAR2, classname VARCHAR2) ;"
    Can this be used in any way for my purpose ? If yes, how ?
    2. I can do the PERIODIC scheduling of execution of the
    command using standard (SUN) java timer/Thread
    primitives. Are there any Oracle Java classes/methods
    which can be used instead for this scheduling ?
    Thanks for any help/suggestions.
    Arminius

    I would look at two things.
    1) Create a database level trigger that fires at server start up.
    2) Define an Oracle Job that runs every xx minutes and restarts itself.
    Chet West

  • Calling a WebServices From Java Stored Proc fails with Connection refused

    I have followed the example in Note:220662.1 on Metalink step by step.
    I am using two windows machines (2000 SP4). I have Oracle 9.2.0.5 EE on one of them and OC4J 9.0.4 standalone on the other(running on JVM 1.4.2_05-b04). The 2 servers "see" each other over the network.
    I can execute the stub from the database machine:
    C:\WebServices\HelloWorld>java HelloWorldImplWSStub
    Hello World - The current time is Sat Aug 21 11:56:20 EDT 2004When running it from the database, I get:
    SQL> select ws_hello_world from dual;
    select ws_hello_world from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: [SOAPException:
    faultCode=SOAP-ENV:IOException; msg=Connection refused;
    targetException=java.net.ConnectException: Connection refused]
    Elapsed: 00:00:21.02The trace file generated on the database server machine looks like:
    [SOAPException: faultCode=SOAP-ENV:IOException; msg=Connection refused; targetException=java.net.ConnectException: Connection refused]
      at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:765)
      at org.apache.soap.rpc.Call.invoke(Call.java:261)
      at HelloWorldImplWSStub.sayHelloWorld(HelloWorldImplWSStub.java:52)Here is the stub code generated using JDeveloper 9.0.5.1:
    import oracle.soap.transport.http.OracleSOAPHTTPConnection;
    import org.apache.soap.encoding.SOAPMappingRegistry;
    import java.net.URL;
    import org.apache.soap.rpc.Call;
    import org.apache.soap.Constants;
    import java.util.Vector;
    import org.apache.soap.rpc.Response;
    import org.apache.soap.rpc.Parameter;
    import org.apache.soap.Fault;
    import org.apache.soap.SOAPException;
    import java.util.Properties;
    public class HelloWorldImplWSStub  {
      public HelloWorldImplWSStub() {
        m_httpConnection = new OracleSOAPHTTPConnection();
        m_smr = new SOAPMappingRegistry();
      public static String endpoint = "http://oc4jsrv:8888/MyWorkarea-OC4J-context-root/HelloWorldImplWS";
      public String getEndpoint() {
        return _endpoint;
      public void setEndpoint(String endpoint) {
        _endpoint = endpoint;
      private static OracleSOAPHTTPConnection m_httpConnection = null;
      private static SOAPMappingRegistry m_smr = null;
      public static String sayHelloWorld() throws Exception {
        String returnVal = null;
        URL endpointURL = new URL(_endpoint);
        Call call = new Call();
        call.setSOAPTransport(m_httpConnection);
        call.setTargetObjectURI("HelloWorldImplWS");
        call.setMethodName("sayHelloWorld");
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
        Vector params = new Vector();
        call.setParams(params);
        call.setSOAPMappingRegistry(m_smr);
        Response response = call.invoke(endpointURL, "");
        if (!response.generatedFault()) {
          Parameter result = response.getReturnValue();
          returnVal = (String)result.getValue();
        else {
          Fault fault = response.getFault();
          throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
        return returnVal;
      public void setMaintainSession(boolean maintainSession) {
        m_httpConnection.setMaintainSession(maintainSession);
      public boolean getMaintainSession() {
        return m_httpConnection.getMaintainSession();
      public void setTransportProperties(Properties props) {
        m_httpConnection.setProperties(props);
      public Properties getTransportProperties() {
        return m_httpConnection.getProperties();
       public static void main(String[] argv) throws Exception   {    
        HelloWorldImplWSStub hstub = new HelloWorldImplWSStub();    
        System.out.println(hstub.sayHelloWorld());  
    }The PL/SQL function code:
    CREATE OR REPLACE FUNCTION ws_hello_world RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'HelloWorldImplWSStub.sayHelloWorld() return java.lang.String';Any help would be greatly appreciated.

    Hello,I have the same problem. Did you find any solution to it?
    Thanks. Diego (Argentina)

  • Calling external servlet from java stored procedure

    Hello,
    I need to call an external servlet which is in 9iAS server ( unix box) from Java Stored procedure in oracle database.
    Can anybody give me an idea? is it possible?
    Thanks,
    Viswa

    I am trying the same. Here is URL which will help u.
    http://otn.oracle.com/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    Let me know when you run servlet successfully.
    Regards
    Satish

  • ResultSet from Java Stored Procedures

    Hi,
    How do I obtain a resultset from a Java Stored Procedure?
    My stored procedure, deployed in Oracle8i, has Database package as sample.Have published setConnection() and getDept() methods.
    Code for Java Stored Procedure:
    package SPPackage;
    import java.sql.*;
    public class StoredProcApplication {
    protected static Connection connection = null;
    protected static Statement stmt = null;
    protected static ResultSet res = null;
    public static void setConnection() throws SQLException {
    connection = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    public static void getDept(Object[] obj) throws SQLException {
    if (connection == null) {
    setConnection();
    if (stmt == null) {
    stmt = connection.createStatement();
    if (res == null) {
    res = stmt.executeQuery("select * from DEPT");
    obj[0] = res;
    Code for TesterApplication :
    package SPPackage;
    import java.sql.*;
    public class TesterApplication {
    private static final String URL = "jdbc:oracle:thin:@sandeep:1521:oracle8i";
    private static final String userId = "sandeep";
    private static final String password = "sandeep";
    private Connection connection;
    private CallableStatement stmt;
    private ResultSet res;
    public void setConnection() throws ClassNotFoundException,SQLException {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    connection = DriverManager.getConnection(URL,userId,password);
    public void getResultFromSP() throws SQLException {
    //prepare to call the stored procedure
    stmt = connection.prepareCall("{call sample.getDept(?)}");
    //register the OUT parameters
    stmt.registerOutParameter(1,Types.OTHER);
    //execute the query
    stmt.execute();
    ResultSet res = (ResultSet)stmt.getObject(1);
    while (res.next()) {
    System.out.print(res.getInt(1) + " | " );
    System.out.print(res.getString(2) + " | " );
    System.out.print(res.getString(3) + " \n " );
    public TesterApplication() throws SQLException,ClassNotFoundException {
    try {
    setConnection();
    getResultFromSP();
    } finally {
    if (res != null) { res.close(); res = null; }
    if (stmt != null) { stmt.close(); stmt = null; }
    if (connection != null) { connection.close(); connection = null; }
    public static void main(String[] args) {
    try {
    TesterApplication ta = new TesterApplication();
    } catch (Exception e) {
    System.err.println("Error while executing stored procedure " + e.getMessage());
    e.printStackTrace();
    When I run the TesterApplication, I get the following exception :
    java.sql.SQLException: Invalid column type: get_internal_type
    at oracle.jdbc.dbaccess.DBError.check_error(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(Compiled Code)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(Compiled Code)
    Also, if I want to execute the ResultSet in the stored proc itself, and return the values as Arrays of int[], and String[], how do I do it?By default the you can populate only int[0], String[0] , i.e. only one value!!!
    if my statement is unknown, i.e, it might return a combination of updates and resultsets, how do I go about processing the result?
    Please advise!!
    TIA
    Sandeep
    null

    Hi kkirk,
    I found the post you mentioned.Well it dates back to November 1999 - "Problem returning resultset or ARRAY from java stored proc" by Stuart Popejoy ([email protected]).Too bad, it is still not solved!!
    I am not very good at PL/SQL.However, it would still be helpful, if you could post the code here, or at my email address.
    Meanwhile, I was trying this during the week-end.There seems to be a glimmer of hope!!
    Let me know, if this makes sense :
    CallableStatement cs = connection.prepareCall("begin open ? for select * from dept; end");
    try {
    cs.registerOutParameter(1,OracleTypes.CURSOR);
    ResultSet res = ((OracleCallableStatement)cs).getCursor(1);
    while (res.next()) {
    //get the values
    } catch (Exception e) {
    e.printStacktrace();
    However, I am getting an exception trace
    Error while executing stored procedure Invalid column type: getLong
    java.sql.SQLException: Invalid column type: getLong
    at oracle.jdbc.dbaccess.DBError.check_error(Compiled Code)
    at oracle.jdbc.driver.OracleStatement.getLongValue(Compiled Code)
    Not quite sure why this is happening!!
    TIA,
    Sandeep
    null

  • Problem with java stored procs.

    Is there a restriction on accessing XML documents from Java stored procs?
    I have a Java program to parse XML document and return a string. If I run this program as a stand alone, the program runs fine.
    I loaded the oracle xmlparser.jar into ORACLE8i db sucessfully (used -resolve option). Then I loaded my .class file with -verbose and -resolve option and I did not get any erros. I created function which return string. When I ran the function, I did not get any value bacmk.
    Can I use System.out.println in java programs in ORACLE8i. If I can where can I see the output when the program runs? I not waht other mehtods I can use to debug the program running in ORACLE8i JVM.
    Thank You

    Hello again,
    I read the documentation of 9i and found some hints about different TCP/IP socket handling of 9i and a standard JVM.
    There are some parts that give hints but I couldn't find a sample code to show how to handle the differences.
    Could anyone tell me how to handle the differences or give some links to sample code?
    Thanks
    Detlev

  • Issues in looking up a ejb deployed on glassfish from tomcat.

    Hi all,
    I have followed the steps mentioned in the EJB FAQ in the glassfish site and was able to lookup a remote ejb deployed in glassfish from a standalone client.
    In case of standalone client, i set the appropriate jndi properties in the initial context as mentioned in the FAQ and added the 4 jars specified to the classpath of the application.
    It all worked perfectly well.
    But I attempted to do the same from a servlet running under tomcat.
    I set the appropriate jndi properties in the intial context and added 4 jars specified in the lib directory of the war file.
    But this did not turn out well and tomcat complained me with some servlet init errors.
    Then i searched through the web and found this posting from you:
    http://www.archivesat.com/GlassFish_Enterprise_JavaBeans_Developers/thread1399339.htm
    Then i created a folder called "shared/lib" under TOMCAT_HOME directory in my machine and ran the same example. Wow.....miraculously the application ran well.
    But i found that the "index.jsp" which i configured in the welcome file list does not appear now. But i was able to access the servlet without any problem. And the servlet was able to successfully lookup the ejb deployed in glassfish.
    Then i thought, let me try to access the ejb from a jsf application.
    Then i created a jsf application in netbeans 5.5.1 and tried to access the bean deployed in glassfish.
    (Note: the jsf application runs in tomcat 5.5.17 which is bundled with netbeans)
    OOPSS....
    Tomcat now complains me that it cannot compile the jsp page..
    This is the error i got...
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\Documents and Settings\james\.netbeans\5.5.1\apache-tomcat-5.5.17_base\work\Catalina\localhost\CityExplorer-WebClient1\org\apache\jsp\index_jsp.java:7: org.apache.jsp.index_jsp is not abstract and does not override abstract method getDependants() in org.apache.jasper.runtime.JspSourceDependent
    public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    ^
    Generated servlet error:
    C:\Documents and Settings\james\.netbeans\5.5.1\apache-tomcat-5.5.17_base\work\Catalina\localhost\CityExplorer-WebClient1\org\apache\jsp\index_jsp.java:12: getDependants() in org.apache.jsp.index_jsp cannot implement getDependants() in org.apache.jasper.runtime.JspSourceDependent; attempting to use incompatible return type
    found : java.lang.Object
    required: java.util.List
    public Object getDependants() {
    ^
    2 errors
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    Any ideas...
    Can you please help me.
    I've noticed that you were eagerly answering questions related to ejb lookup in many places.
    I feel there is some potential compatability issue between tomcat and glassfish...
    I request you to investigate on this and clarify the community with your response.
    Thanks in advance,
    James Selvakumar

    Thank you guys!
    I've found the answer myself.

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • Spring/Hibernate tier called from Java Stored Procedure

    Here is my scenario.
    Building out a new physical model alongside an old db.
    Two schema's inside same Oracle instance.
    We are building a new Java tier on top of the new schema using spring/hibernate.
    To maintain sync with the old db we are building a load of PLSQL code that will be called by PLSQL stored procs on the old schema.
    ====
    Now it occurred to me that if I could put a copy of my new java tier in the database itself then the trigger code on the old schema could call a java stored proc wrapper which in turn called into my new java tier inside the instance.
    This way I avoid duplication business logic in the db sync and the java middle tier. Basically I do away with the PLSQL sync code and just use the new java component.
    This clearly has advantages from an automated testing point of view too.
    So very interested in how/if anyone has made this work.
    Potential issues...
    - JVM version (outside the db we use Sun Java 5 - inside the db I'm not sure what is used).
    - How would spring access it's config files?

    user563578,
    You asked:
    interested in how/if anyone has made this workNot me.
    You also asked:
    Potential issues...
    - JVM version (outside db use Sun Java 5 - inside db not sure)
    - How would spring access it's config files?
    Oracle has its own JVM embedded in the database: OJVM
    In Oracle 8i it is compatible with JDK 1.2
    In Oracle 9i it is comaptible with JDK 1.3
    In Oracle 10g it is compatible with JDK 1.4
    You can access files outside of the database from OJVM, you just need to set correct permissions.
    Perhaps Kuassi Mensah's book, Oracle Database Programming Using Java and Web Services will be of help?
    Good Luck,
    Avi.

Maybe you are looking for

  • Samsung R580 , can't change brightness, a few buttons don't work

    Hi, Spent over 6 hours trying to find a solution, yet it's always on the highest brightness mode. Couldn't find the monitor with lspci (don't know if it's possible anyway), here's the vga controller : 02:00.0 VGA compatible controller [0300]: nVidia

  • How to create an Open HUB in BI 7.0 which will be scheduled by a Process ch

    Hi Gurus, Could you please explan me how to create an open HUB which will e scheduleby a process chain? Thank you. BR Pat

  • Accessing a scene from a Movie Clip

    Hi, I'm using Flash CS3 and am writing action script inside of one of my movie elements and I want to access an element that's on my main scene, "Home". How can I reference my main form that hosts the element video form my movie clip?

  • EP 2004 to Web Dynpro 2004s

    I'm having an issue with accessing NW2004s Web Dynpro content from a NW2004 portal. I'm getting this exception when I try to run the iView:   javax.naming.NoInitialContextException: Cannot instantiate class: com.sapportals.portal.prt.registry.PortalR

  • Make dreamweaver review the same.

    Hello, my dreamweaver CS6 live view and design view totally different from each others when I work on coding, also after finish coding I have to go to review on browser to see what I have done, what options I have to make all the code view,split view