JavaStoredProcedure as RMI client

Hello,
please can you help me with the following problem ?
I made RMI server object, which runs on a remote machine.
I call this object from a java stored procedure on 8.1.7 DB. It works fine, but when the server object throws some exception (some standard or exception defined by myself), the following exception occurs in the stored procedure, but If I call the RMI object from my standalone client, the exception is correctly thrown and I can catch it in the client... Isn't it some security problem on the DB side ?
java.lang.NullPointerException
at sun.rmi.server.LoaderHandler$LoaderKey.<init>(LoaderHandler.java)
at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
Long postings are being truncated to ~1 kB at this time.

I have created a JAVA STORED PROCEDURE !
package com.etisalat.psm.appserver;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import com.etisalat.psm.appserver.PSMNotification;
import com.etisalat.psm.appserver.PSMNotificationHome;
import javax.naming.NamingException;
public class PSMNotificationClient
public static String callPSMRule(String type,String id,String code,int version) {
     String returnValue = "Coool";
try {
Context context = getInitialContext();
PSMNotificationHome pSMNotificationHome = (PSMNotificationHome)PortableRemoteObject.narrow(context.lookup("PSMNotification"), PSMNotificationHome.class);
PSMNotification pSMNotification;
pSMNotification = pSMNotificationHome.create();
pSMNotification.callPSMRule(type,id,code,version);
}catch(Throwable ex){
     returnValue = ex.getMessage();
ex.printStackTrace();
     return returnValue;
private static Context getInitialContext() throws NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.PROVIDER_URL, "ormi://10.99.25.217:23891/current-workspace-app");
return new InitialContext(env);
loadjava -u owf_mgr/[email protected]:1529:cbcm -v -r -t ejb.jar
loadjava -u owf_mgr/[email protected]:1529:cbcm -v -t oc4jclient.jar
loadjava -u owf_mgr/[email protected]:1529:cbcm -v -r -t PSMNotification.java
EXECUTION in SQLPLUS*
SQL> create or replace FUNCTION PSMNotificationClient(type VARCHAR2,id VARCHAR2,code VARCHAR2,version NUMBER) RETURN VARCHAR2 as language java name 'com.etisalat.psm.appserver.PSMNotificationClient.callPSMRule(java.lang.String,java.lang.String,java.lang.String,int) return java.lang.String';
SQL> variable str VARCHAR2(1000);
SQL> call PSMNotificationClient('SERVICE','ID','CODE',1) into :str;
Call completed.
SQL> print str;
STR
Cannot instantiate class: com.evermind.server.rmi.RMIInitialContextFactory
After execution we get RMIInitialContextFactory, why is this ?

Similar Messages

  • RMI client-side - how to encrypt,decrypt  in client-side

    I write javacard RMI style. My problem is...
    Source code below is work when it write in applet (card - side)
    but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. Did I misunderstand?
    if it make for use in applet only, how is possible to do like this " card use privatekey to sign message and send to reader , reader use card's publickey to verify that card sign this signature or not."
    or
    "card use reader's publickey to encrypt message and send to reader, then reader use privatekey to decrypt message (reader authencate itself) "
    because I can't do any of cipher , keybuilder in RMI-client side(reader)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    it will throw nullPointerException
    and if (change false to true)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
    throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    after that I swap this line with
    pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
    since it will do this first (i swap the line already) it also throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    also be the same result with swap
    kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
    to a first line
    it throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    Please help me
    RSAPrivateKey pri_key;
    RSAPublicKey pub_key;
    KeyPair kp;
    Cipher RSAcipher;
    RSAcipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
    pub_key =(RSAPublicKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC,KeyBuilder.LENGTH_RSA_512, false);
    kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
    kp.genKeyPair();
              pri_key = (RSAPrivateKey) kp.getPrivate();
              pub_key = (RSAPublicKey) kp.getPublic();
    //ENCRYPT
    RSAcipher.init(pri_key, Cipher.MODE_ENCRYPT);
    t_cipherLengthRSA = RSAcipher.doFinal(plaintxt,(short)0, (short)plaintxt.length, t_cipherText, (short)0);
    //DECRYPT
    RSAcipher.init(pub_key, Cipher.MODE_DECRYPT);
    RSAcipher.doFinal(ciphertxt,(short)0,(short) t_cipherLengthRSA, temp1, (short)0);

    I write javacard RMI style. My problem is...
    Source code below is work when it write in applet (card - side)
    but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw
    exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHMYou can not share code between card and client. On the card use the classes of javacardx.crypto and on the client side those of javax.crypto and java.security.
    It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. That is right.
    if it make for use in applet only, how is possible to
    do like this " card use privatekey to sign message
    and send to reader , reader use card's publickey to
    verify that card sign this signature or not." or
    "card use reader's publickey to encrypt message and
    send to reader, then reader use privatekey to decrypt
    message (reader authencate itself) "On each platform you have classes that provide the same cryptographic operations but the interface of these classes is different (because of the limitations of the java card platform).
    because I can't do any of cipher , keybuilder in
    RMI-client side(reader)Use the java.security.KeyFactory instead.
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    it will throw nullPointerException
    and if (change false to true)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
    throw exception 0x3 -
    javacard.security.CryptoException.NO_SUCH_ALGORITHMCryptographic support on java cards is optional. Not every card supports every algorithm. Try to use another algo.
    Jan

  • How do I make a RMI client running in Bea find a remote, non Bea, RMI server?

    On my stand alone test system I run a RMI server in one JVM,
    registry.exe and a RMI client in its own JVM. The client uses
    java.rmi.Naming.lookup() to find the RMI server, and this works fine.
    If I run the same RMI client class within Bea the naming lookup fails! I
    guess this is due to Bea using it own RMI registry rather than the
    registry.exe I started separately(?)
    QUESTION: How do I make a RMI client running in Bea find a remote,
    non-Bea, RMI server?
    Of course, in the final environment the server will run on a system
    remote from Bea.
    The RMI client calls are done from a servlet, not from a EJB.
    The doumentation about using RMI with Bea is focused on running the RMI
    server within Bea. This might be the "normal" thing to do, but in our
    case Bea is the client, not the server. Do I still need to use
    weblogic.rmi.*....? If so, where?
    Grateful for any tip.
    Göran Hagnell

    On my stand alone test system I run a RMI server in one JVM,
    registry.exe and a RMI client in its own JVM. The client uses
    java.rmi.Naming.lookup() to find the RMI server, and this works fine.
    If I run the same RMI client class within Bea the naming lookup fails! I
    guess this is due to Bea using it own RMI registry rather than the
    registry.exe I started separately(?)
    QUESTION: How do I make a RMI client running in Bea find a remote,
    non-Bea, RMI server?
    Of course, in the final environment the server will run on a system
    remote from Bea.
    The RMI client calls are done from a servlet, not from a EJB.
    The doumentation about using RMI with Bea is focused on running the RMI
    server within Bea. This might be the "normal" thing to do, but in our
    case Bea is the client, not the server. Do I still need to use
    weblogic.rmi.*....? If so, where?
    Grateful for any tip.
    Göran Hagnell

  • RMI Client on Linux issue.

    I am facing Java RMI problem on Suse Linux.
    RMI server running on solaris and RMI client running on Solaris ---> works fine
    RMI server running on solaris and RMI client running on Linux ---> gives error
    Pls note that RMI server running fine. When invoking remote method from RMI client on Suse Linux, I get following error.
    Java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: RemoteVtskImpl_Stub
    Any help/pointers will be useful.

    Even we tried setting the CLASSPATH to point to those jar files. But still the problem persist.
    At run time is there any way to see what all the _stub files are downloaded in the JVM at the client machine (linux machine in our case) from the server machine (solaris machine in our case).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Running applet as RMI client from remote computer

    Hi,
    I am doing this project that requires that i run an applet (which is an RMI client) from a computer different than the one that has the RMI server running.
    Right now, i can run my server and applet on the same computer and it all works fine. But i don't know how to make the applet communicate with an RMI server that resides on another computer. Does this has anything to do with TOMCAT.
    I was wondering if this is possible.
    Thank you in advance.

    Do This
    RemoteInterfaceName server = (RemoteInterfaceName) Namin.lookup("rmi://yourserver/server/YourServerName");
    server.methodName(args);
    suppose you have your server in the dir path
    c:\prj\server
    then set your webserver's root dir to c:\prj\server how this is done will be in the web server's documentation
    Try It otherwise we'll see it again
    Bye !!!

  • Rmi client throws Connection Refused exception

    My Rmi client throws a Connection Refused exception when i try to run it on remote machine (in this case i run it on my virtualbox macine).
    The virtualbox machine network is in NAT mode (host machine ip should be 10.0.2.2).
    When rmi client starts get registry instance and print in standar output:
    RegistryImpl_Stub[UnicastRef2 [liveRef: [endpoint:[//10.0.2.2/:1099,util,RmiInstances$1@1275d39](remote),objId:[0:0:0, 0]]]]But when rmi client trys to use any of remote methods it throws Connection Refused, but it's to strange because the Connection Refused has 127.0.1.1 as ip.
    java.rmi.ConnectException: Connection refused to host: 127.0.1.1; ....In client RmiInstances code (this class contains all remote implementations) is:
    public class RmiInstances {
        private static RmiInstances instance;
        private IUserManage userManage;
        private IAnalysis analysis;
        private IPacientManage pacientManage;
        private IInsuranceManage insuranceManage;
        private Config config;
        private RmiInstances()
                throws RemoteException, NotBoundException, IOException {
            this.config = Config.getInstance();
            Registry registry = LocateRegistry.getRegistry(config.getServerUrl()+"/",
                    1099, new RMIClientSocketFactory() {
                @Override
                public Socket createSocket(String host, int port) throws IOException {
                    try {
                        URI uri = new URI(config.getServerUrl()+
                                ":"+config.getServerPort());
                        return new Socket(uri.getHost(), uri.getPort());
                    } catch (URISyntaxException ex) {
                        ex.printStackTrace();
                        return null;
            System.out.println(registry);
            userManage = (IUserManage)registry.lookup("RUserManage");
            analysis = (IAnalysis)registry.lookup("RAnalysis");
            pacientManage = (IPacientManage)registry.lookup("RPacientManage");
            insuranceManage = (IInsuranceManage)registry.lookup("RInsuranceManage");
    ...And server code is the next:
    public static void main(String[] args) {
         System.out.println("GNULab Server " + VERSION + " starting...");
         System.setProperty("java.rmi.server.codebase",
              "file:/home/zarovich/workspace/labserver/bin");
         try {
             // Loading config
             System.out.println("Loading config...");
             Config config = Config.getInstance();
             // inicializando rmi registry
             Registry registry;
             if (config.isSsl()) {
              registry = LocateRegistry.createRegistry(
                   config.getServerPort(), new RmiSSLClient(),
                   new RmiSSLServer());
             } else
              registry = LocateRegistry
                   .createRegistry(config.getServerPort());
             // instanciando implementaciones
             RAnalysis rAnalysis = new RAnalysis();
             RInsuranceManage rInsuranceManage = new RInsuranceManage();
             RPacientManage rPacientManage = new RPacientManage();
             RUserManage rUserManage = new RUserManage();
             // registrando interfaz rmi
             registry.rebind("RAnalysis", (IAnalysis) UnicastRemoteObject.exportObject(rAnalysis, 0));
             registry.rebind("RInsuranceManage", (IInsuranceManage) UnicastRemoteObject.exportObject(rInsuranceManage, 0));
             registry.rebind("RPacientManage", (IPacientManage) UnicastRemoteObject.exportObject(rPacientManage, 0));
             registry.rebind("RUserManage", (IUserManage) UnicastRemoteObject.exportObject(rUserManage, 0));
             System.out.println("GNULab Server " + VERSION + " listening ...");
             System.out.println("Registry instance: " + registry.toString());
         } catch (RemoteException e) {
             e.printStackTrace();
            * catch (MalformedURLException e) { e.printStackTrace(); }
            */catch (IOException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         } catch (JDOMException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
    ...

    I'm solved my problem.
    I just need run my server with -Djava.rmi.serverhost=10.0.2.2 and my client running on my virtualbox machine works!

  • Rmi client and jApplet

    Hi,
    I am trying to use a jApplet as an rmi client. However, either creating a new instance of the class i created, that extends jApplet, in the rmi client class i created or creating a new instance of the rmi client in the class that extends jApplet results in error.
    What is the correct way to go about doing this? I developed the jApplet thinking it could be simply used with the rmi client.
    instanciating the rmi client in the jApplet class gives :
    java.lang.OutOfMemory Error
    instanciating the jApplet class in the rmi client class gives other errors I am unable to reproduce at the moment :(
    thanks for any help
    -Paulo Murphy de Freitas

    Hi,
    I am trying to use a jApplet as an rmi client. However, either creating a new instance of the class i created, that extends jApplet, in the rmi client class i created or creating a new instance of the rmi client in the class that extends jApplet results in error.
    What is the correct way to go about doing this? I developed the jApplet thinking it could be simply used with the rmi client.
    instanciating the rmi client in the jApplet class gives :
    java.lang.OutOfMemory Error
    instanciating the jApplet class in the rmi client class gives other errors I am unable to reproduce at the moment :(
    thanks for any help
    -Paulo Murphy de Freitas

  • 10.1.3.1 and standalone RMI client

    I'm migrating our J2EE applications from 10.1.2.0.1 to 10.1.3.1.0. I also have a custom JAAS login module that is used by our applications. I have the login module working successfully and web applications that can call EJBs.
    But I am unable to get a simple RMI client to call the EJBs. I can see from the server logs that the JAAS module executes successfully, but then I get a ClassNotFoundException (seems to be from the server) when the client tries to access the JNDI tree (see stack below on the client; I can't find any log relating to this event on the server).
    I had real problems with RMI access in 10.1.2, seems that Oracle AS isn't really thought through with respect to simple RMI client access. In the system-jazn-data.xml file I have granted my custom principals the RMI login permission. I tried to raise a TAR but it's been rejected because 10.1.3.1.0 is a "preview" version. (Don't you guys want to know about bugs before a release goes into production?)
    Any ideas?
    27-Sep-2006 14:50:46 oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_R
    EMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    java.lang.ClassNotFoundException: com/evermind/server/ejb/EJBHomeObjectInfo
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at com.evermind.io.ClassLoaderObjectInputStream.resolveClass(ClassLoader
    ObjectInputStream.java:33)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:153
    8)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    693)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1628)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1293)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    at java.util.HashMap.readObject(HashMap.java:1013)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    713)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    at com.evermind.server.rmi.RMIClientConnection.handleListContextResponse
    (RMIClientConnection.java:768)
    at com.evermind.server.rmi.RMIClientConnection.handleOrmiCommandResponse
    (RMIClientConnection.java:242)
    at com.evermind.server.rmi.RMIClientConnection.dispatchResponse(RMIClien
    tConnection.java:205)
    at com.evermind.server.rmi.RMIClientConnection.processReceivedCommand(RM
    IClientConnection.java:187)
    at com.evermind.server.rmi.RMIConnection.handleCommand(RMIConnection.jav
    a:152)
    at com.evermind.server.rmi.RMIConnection.listenForOrmiCommands(RMIConnec
    tion.java:127)
    at com.evermind.server.rmi.RMIConnection.run(RMIConnection.java:107)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
    utor.java:814)
    at java.lang.Thread.run(Thread.java:595)
    javax.naming.NamingException: com/evermind/server/ejb/EJBHomeObjectInfo [Root ex
    ception is java.lang.ClassNotFoundException: com/evermind/server/ejb/EJBHomeObje
    ctInfo]
    at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:1
    00)
    at com.evermind.server.rmi.RMIClientConnection.waitForJndiResponse(RMICl
    ientConnection.java:334)
    at com.evermind.server.rmi.RMIClientConnection.list(RMIClientConnection.
    java:293)
    at com.evermind.server.rmi.RMIClient.list(RMIClient.java:392)
    at com.evermind.server.rmi.RMIClientContext.getListValues(RMIClientConte
    xt.java:95)
    at com.evermind.server.rmi.RMIContext.listBindings(RMIContext.java:444)
    at com.evermind.naming.FilterContext.listBindings(FilterContext.java:91)
    at com.evermind.server.ApplicationClientContext.listBindings(Application
    ClientContext.java:127)
    at javax.naming.InitialContext.listBindings(InitialContext.java:406)
    at com.axiomsystems.common.tools.test.APITester.getEJBs(APITester.java:2
    06)
    at com.axiomsystems.common.tools.test.APITester.<init>(APITester.java:17
    3)
    at com.axiomsystems.common.tools.test.APITester.main(APITester.java:68)
    Caused by: java.lang.ClassNotFoundException: com/evermind/server/ejb/EJBHomeObje
    ctInfo
    at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_
    SERVER(RMICall.java:109)
    at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:9
    1)
    ... 11 more

    Hi Debu,
    I have found the problem and a workaround in my code.
    I obtained the initial context ctx with the following properties set:
    Context.INITIAL_CONTEXT_FACTORY (= oracle.j2ee.naming.ApplicationClientInitialContextFactory)
    Context.PROVIDER_URL (= opmn:ormi://myHost:myPort:myOC4J/myApp)
    Context.SECURITY_PRINCIPAL (= my username)
    Context.SECURITY_CREDENTIAL (= my password)
    then I did
    NamingEnumeration en = ctx.listBindings("ejb/myJndiName")
    which resulted in the exception.
    Changing this to
    Context ctx2 = (Context)ctx.lookup("ejb/myJndiName");
    NamingEnumeration en = ctx2.listBindings("");
    has resolved the problem. I'm not sure why this behaves differently, I suppose it may have something to do with the fact that ctx2 is not an InitialContext object. It is an adequate workaround for my application.
    Once I have an EJB reference, invoking methods over RMI works as expected.
    Thanks,
    Keith

  • Quartz schedular problem accessing thru RMI client

    Hi,
    I am trying to access Quartz scheduler through RMI client/server.
    Quartz scheduler RMI is starting up properly.
    When I run the RMI client I am receiving the following error.
    =================================================================
    org.quartz.SchedulerException: Error communicating with remote scheduler. [See nested exception: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
         java.io.InvalidClassException: oracle.classloader.util.AnnotatedNoClassDefFoundError; local class incompatible: stream classdesc serialVersionUID = -4364152148004017014, local class serialVersionUID = -687990861161016914]
         at org.quartz.impl.RemoteScheduler.invalidateHandleCreateException(RemoteScheduler.java:135)
         at org.quartz.impl.RemoteScheduler.scheduleJob(RemoteScheduler.java:335)
         at net.nighttale.scheduling.rmi.QuartzClient.main(QuartzClient.java:17)
    * Nested Exception (Underlying Cause) ---------------
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
         java.io.InvalidClassException: oracle.classloader.util.AnnotatedNoClassDefFoundError; local class incompatible: stream classdesc serialVersionUID = -4364152148004017014, local class serialVersionUID = -687990861161016914
         at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:217)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
         at org.quartz.core.QuartzScheduler_Stub.scheduleJob(Unknown Source)
         at org.quartz.impl.RemoteScheduler.scheduleJob(RemoteScheduler.java:332)
         at net.nighttale.scheduling.rmi.QuartzClient.main(QuartzClient.java:17)
    Caused by: java.io.InvalidClassException: oracle.classloader.util.AnnotatedNoClassDefFoundError; local class incompatible: stream classdesc serialVersionUID = -4364152148004017014, local class serialVersionUID = -687990861161016914
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836
    =============================================================
    My client and server quartz properties are as follows.
    Client properties
    org.quartz.scheduler.instanceName = DefaultQuartzScheduler
    org.quartz.scheduler.rmi.proxy = true
    org.quartz.scheduler.rmi.registryHost = 127.0.0.1
    org.quartz.scheduler.rmi.registryPort = 1098
    Server properties
    # Default Properties file for use by StdSchedulerFactory
    # to create a Quartz Scheduler Instance, if a different
    # properties file is not explicitly specified.
    org.quartz.scheduler.instanceName = DefaultQuartzScheduler
    #org.quartz.scheduler.instanceName = Sched1
    org.quartz.scheduler.rmi.export = true
    #org.quartz.scheduler.rmi.proxy = false
    org.quartz.scheduler.rmi.registryHost = 127.0.0.1
    org.quartz.scheduler.rmi.registryPort = 1098
    org.quartz.scheduler.rmi.createRegistry = true
    org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
    org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
    org.quartz.threadPool.threadCount = 10
    org.quartz.threadPool.threadPriority = 5
    org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
    org.quartz.jobStore.misfireThreshold = 5000
    #org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
    org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
    org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
    org.quartz.jobStore.useProperties = false
    org.quartz.jobStore.dataSource = demoDS
    org.quartz.jobStore.tablePrefix = QRTZ_
    org.quartz.jobStore.isClustered = false
    #============================================================================
    # Configure Datasources
    #============================================================================
    org.quartz.dataSource.demoDS.driver = oracle.jdbc.driver.OracleDriver
    org.quartz.dataSource.demoDS.URL = jdbc:oracle:thin:@demou.abc.com:1521:orcl
    org.quartz.dataSource.demoDS.user = demo
    org.quartz.dataSource.demoDS.password = oracle
    org.quartz.dataSource.demoDS.maxConnections = 5
    org.quartz.dataSource.demoDS.validationQuery=select 0 from dual
    #org.quartz.dataSource.demoDS.validationQuery=select lock_name from qrtz_locks where lock_name = 'TRIGGER_ACCESS'
    #============================================================================
    # Configure Plugins
    #============================================================================
    # Uncomment the following to get logging of job execution events...
    #org.quartz.plugin.jobHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin
    # Uncomment the following to get logging of trigger firing events...
    #org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
    #============================================================================
    # Configure Listeners
    #============================================================================
    #org.quartz.jobListener.dummy.class = org.quartz.examples.DumbJobListener
    Appreciate your quick response.
    Regards,
    Nishi

    What I did today is that we connected the client PC directly with the server through a switch. So keep in mind please, that for the following informations there is no firewall involved whatsoever.
    I've just checked the communication log on the server with the microsoft network monitor. the communication proceedes in the following manner:
    1) the client calls the server from a random source port(src) onto the specified destination port(dst) 1088.
    2) the server application replies from (src)1088 to (dst)1052.
    3) now comes two client calls again from (src)1052 to (dst)1088.
    4) and then the server sends something two times from 1088 to 1052
    and that's it! end of communication. of course then it comes the above mentioned error.
    What the most amazes me is that although I explicitly specify for the client as well, that the rmi registry should be available on the remote port 1088, still it uses a random port (in this case 1052). Could this be alright? After all, what port the client uses to reach for the remote registry could be random I guess...
    What I see on the client side with the trace prints is that during the client initialization first a connection will be made on a local machine with port # -1 and just after that calls the remote server. But in that case I don't get it why it prints the 1088 if under the hood is a 1052 or other random port...
    Meanwhile, on the server side I get a trace message from the custom security manager that an accept on the random port (1052) has been successful. but after that no more printouts.
    Oh, and one more thing... did I mentioned that I implemented a pure socket client/server thingy and it works just fine? with or without firewall.

  • RMI Client on Web browsers

    Hello All,
    I have a basic question about RMI. Usually we run RMI client like:
    java -dcodebase=http://mysite.com -djava.securit.policy=mypolicy.policy client
    Is it possible to run RMI client on web browsers, say, through Java servlet, Tomcat is installed?
    If possible, how to configure Tomcat and the client, may be servlet? I don't think RMI server need change.
    Thanks
    Chen

    Tomcat is for servers. Why would that change the
    client?Thanks for the reply. I want to put RMI client in Tomcat, the RMI client connect to RMI server (not in the Web server, some other place). The questionis :
    Every RMI client need start like this:
    java -Djava.rmi.security=my.policy myclient
    But in Tomcat, we only have classes. The servlet call the class(es) to finish the request and return response. In fact my question is how to provide security policy to these classes?
    Merry Xmas!
    CL

  • No security manager: RMI class loader disabled Error at RMI client programm

    Got following error on invoking remote method from RMI client,
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: com.rmi.RmiImpl_Stub (no security manager: RMI class loader disabled)
    Please let me know solution.

    Hello JAAZ,
    I got the same error yesterday. I was a little frustrated, because the day before everything was fine...
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
            java.lang.ClassNotFoundException: uk.co.it.ete.server.ETE_Server (no security manager: RMI class loader disabled)
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)The solution was, that I did some refactoring and some of the classes were now in different packages. I updated the system on the client-side and now everything works again.
    I think debugging RMI-applications is not as easy as "normal" applications ..
    maybe this helps..
    Regards
    tk

  • Force RMI client to connect to one Port

    Hi,
    Is there a way to force an RMI client to connect to a specific port.
    Any hint will be greatly appreciated
    Wafic

    Not really since it needs 2 ports, one for the RMI registry and other for the remote object.
    You can set these ports to what you like though (not the same).
    First port you set when you create/start your rmiregistry, the second when you create the UnicastRemoteObject, in its constructor you can specify it with the constructor UnicastRemoteObject(int port).
    This is only available since JDK1.2 though. When you connect with the client to the rmiregistry and the remote object, you specify the port in the URL from the client side like:
    rmi://localhost:port/remoteobjectname
    just replace localhost with the address of the server.
    The remote object port is passed to the client by the rmiregistry.

  • Servlet acts as an RMI client to get the current time of day

    my application is servlet acts as an RMI client to get the current time of day from the DaytimeServlet RMI server so iam not getting the correctime....
    import java.io.*;
    import java.rmi.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DaytimeClientServlet extends
    HttpServlet
    DaytimeServer daytime;
    protected DaytimeServer getDaytimeServer() {
    DaytimeServer stub.
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new
    RMISecurityManager());
    try {
    Registry registry =
    LocateRegistry.getRegistry(getRegistryHost(),
    getRegistryPort());
    return
    (DaytimeServer)registry.lookup(getRegistryName());
    catch (Exception e) {
    getServletContext().log(e, "Problem getting
    DaytimeServer reference");
    return null;
    private String getRegistryName() {
    String name = getInitParameter("registryName");
    return (name == null ? "DaytimeServlet" : name);
    private String getRegistryHost() {
    return getInitParameter("registryHost");
    private int getRegistryPort() {
    try { return
    Integer.parseInt(getInitParameter("registryPort");
    catch (NumberFormatException e) { return
    Registry.REGISTRY_PORT; }
    public void doGet(HttpServletRequest req,
    HttpServletResponse res)
    throws
    ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();
    if (daytime == null) {
    daytime = getDaytimeserver();
    if (daytime == null) {
    throw new UnavailableException(this, "Could
    not locate daytime");
    out.println(daytime.getDate().toString());
    please help me out

    Hi lucentb,
    what i observed from your code is some simple coding faults are there.. so i am giving you some test code..
    i hope this will help you out.
    import java.io.*;
    import java.rmi.*;
    import java.rmi.registry.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DaytimeClientServlet extends HttpServlet
    DaytimeServer daytime;
    protected DaytimeServer getDaytimeServer()
    if (System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    try {
    Registry registry = LocateRegistry.getRegistry(getRegistryHost(),
    getRegistryPort());
    return
    (DaytimeServer)registry.lookup(getRegistryName());
    catch (Exception e) {
    getServletContext().log(e, "Problem getting DaytimeServer reference");
    return null;
    private String getRegistryName()
    String name = getInitParameter("registryName");
    return (name == null ? "DaytimeServlet" : name);
    private String getRegistryHost() {
    return getInitParameter("registryHost");
    private int getRegistryPort()
    try
    return
    Integer.parseInt(getInitParameter("registryPort")); }
    catch (NumberFormatException e)
    return
    Registry.REGISTRY_PORT;
    public void doGet(HttpServletRequest req,
    HttpServletResponse res)
    throws
    ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();
    if (daytime == null) {
    daytime = getDaytimeServer();
    if (daytime == null) {
    // Couldn't get it, so report we're
    unavailable.
    throw new UnavailableException(this, "Could
    not locate daytime");
    out.println(daytime.getDate().toString());
    If you have any problem after this please send me the exceptions and problem situations with deatils codes..
    Regards,
    TirumalaRao
    Developer Technical Support,
    Sun Microsystems, India.

  • Serlet acting as RMI client

    hi all
    i have a servlet acting as a RMI client, the container of choice is Oracle Application Server or Tomcat
    how to set the security / persmision settings ?

    * Withdrawer.java
    * This is a non-thread-safe subclass ofAccountHolder that implements the run method
    * in such a way as to iterate a fixed number of times, making
    * a fixed withdrawal on its (shared) Account object.
    * @author Chad Salinas
    * @version 12/15/03
    * sources credited: Chad Salinas
    * Chad Salinas Open issues:
    Chad Salinas package cscie160.hw6;
    public class Withdrawer extends AccountHolder
    public static final float AMOUNT = 200;
    // Chad Salinas default constructor that won't be used
    public Withdrawer()
    // Chad Salinas the one-arg constructor requiring taking an Account object
    Chad Salinas public Withdrawer(Account oneAccount)
    Chad Salinas {
    Chad Salinas theAccount = oneAccount;     
    Chad Salinas }     
    public void run()
         for(int i = 0; i < 10; i++)
         Chad Salinas boolean finished = false;
         Chad Salinas while(!finished)
              Chad Salinas if(theAccount.getBalance() >= AMOUNT)
         Chad Salinas theAccount.withdraw(AMOUNT);
         Chad Salinas finished = true;
              else
              try
              Chad Salinas Thread.sleep(100);
              Chad Salinas catch(Exception e)
    Chad Salinas sample source
    Chad Salinas factory design pattern

  • Detect RMI client problem. Gotta be anothe way...

    For a while, I've been searching how to detect RMI client unexpected disconnection but there is no real answer for that. There is NO other way to let server know that client is disconnected beside using call back or using periodically checking client?? Something like unreferenced() to tell specific client is not holding the reference or something like that..

    In our system, almost every Remote interface has a void ping() method, and we periodically call this, and if there is an Exception thrown we do whatever we need to, to clean up.
    Often we create a local (static) proxy class to the Remote object that knows how to do the clean up, and has same methods but doesn't throw exceptions. it does NOT implement the Remote interface so there is no need to catch exceptions at every point it is called. This proxy can control the periodic pinging.
    I guess you could extend remote and add a ping method to it (call this PingableRemote), then extend this new interface instead of Remote directly.
    Also create a class that takes a PingableRemote and some callback object in it's constructor, which could then take care of the pinging and "remoteLost" notification in a form that can be re-used.
    Bruce

Maybe you are looking for

  • Update the set of item category in IMG

    Hi All, When I am trying to update the set of item category, here is the path that I'm using in the IMG: Sales and Distribution/Basic Functions/Account Assignment-Costing/Revenue Recognition/Set Revenue Recognition For Item Categories.  When I go to

  • New fonts not working in photoshop...

    I have installed new fonts on my mac but they will not work in Photoshop.. can somoene help me? I don't know if I have done something wrong or need to take another step.. I am running CS4 and OS 10.6.4. The message I get when I try to use a font I re

  • Alternative to passing JFrame parameter?

    I have a class (in a file) that handles the menu, hence the name "MenuHandler". The calling class is the main app and passes the "frame" as a parameter. Is there an alternative to get the "handle" of the frame of the main app. It is the root object,

  • Continue a script in Photoshop

    Hi I need to write a script that export artboards as PSD then open these files in Photoshop in order to continue the processing. So here´s basically the concept: #target illustrator ...body of the code to be executed in Illustrator, concluding with t

  • Multiple User access in ATP

    I am designing custom ATP for our client. Actually, this logic accesses batch classification data and the calculation logic also differs. The concern that I have is if one user (say A) creates a sales order item and runs a successful Availability che