Doubts with RMI

I have a custom stand-alone socket-based Client-Server application. Login validation is performed by calling a JSP(through java.net.URL) that is running on iPlanet on a completely separate machine. For each client, a unique id is generated by the login validating JSP and is stored in two Hashtables - one in its own JVM and one in the server JVM via RMI. The RMI service is started on the same machine when the server starts. The JSP uses a bean that has a static reference to the remote object. Everything works fine except when I restart the server. Then I have to restart iPlanet also.
I believe this is due to the fact that the JSP is not able to lookup the RMI service due to some reason.
Can someone tell me the exact reason for this? Also, is Activation a solution to this problem?

I too have faced this problem of static reference and solution was to get the reference again . however i am surprised at the results it gave me. The reference i had returned incorrect data and at times gave null pointer.
Is this mentioned in RMI specs that a static reference should not be held by the client or else it will not work .

Similar Messages

  • Doubt with creation of Model in the application Webdynpro Java

    Good Morning,
    I have the following doubts with the fields when i am creating a models in WebDynpro Java
    Model Package
    Source Fólder
    Default logical system name for model instances
    Default logical system name for RFC metadata
    Logical Dictionary
    Dictionary Type Package.
    Can Help me?
    Kind Regards

    Hi,
        Please check this link:
    [https://wiki.sdn.sap.com/wiki/display/WDJava/FAQ%20-%20Models%20-%20Adaptive%20Web%20Service]
    Thanks and Regards

  • Doubt with a Insert query!

    hi friends i have a doubt with a query in sql here is the following code.
    INSERT INTO
                         (SELECT employee_id, last_name,
                                      email, hire_date, job_id, salary,
                                      department_id
                           FROM employees
                          WHERE department_id = 50)
               VALUES (99999, 'Taylor', 'DTAYLOR',
                            TO_DATE('07-JUN-99', 'DD-MON-RR'),
                             'ST_CLERK', 5000, 50);The same insert statement can be achieved with
    INSERT INTO EMPLOYEES (employee_id, last_name,
                                      email, hire_date, job_id, salary,
                                      department_id)
                        VALUES (99999, 'Taylor', 'DTAYLOR',
                            TO_DATE('07-JUN-99', 'DD-MON-RR'),
                             'ST_CLERK', 5000, 50);What advantage does the first query have over the second one.
    Thanks in advance to everyone.
    Regards,
    Manoj

    Those two statements are identical.
    However this one would be different:
    INSERT INTO
      (SELECT employee_id, last_name,
            email, hire_date, job_id, salary,
            department_id
       FROM employees
       WHERE department_id = 50
       with check option )
    VALUES (99999, 'Taylor', 'DTAYLOR', TO_DATE('07-JUN-99', 'DD-MON-RR'), 'ST_CLERK', 5000, 50);The "WITH CHECK OPTION" would guarantee that only employees for department 50 are inserted.
    see also:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_10002.htm#i2066598
    Edited by: Sven W. on Mar 17, 2011 7:22 PM - typo correction

  • VersioningError when Using JDBC driver for SQL Server with RMI

    Hi,
    I wrote a simple class for inserting rows into a database. The database is SQL Server 2000, and I am using weblogic's mssqlserver4 driver. The class works fine, but when I try to export the class as a remote object (using Sun's RMI implementation, not Weblogic RMI), I get the following error:
    Exception in thread "main" weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:35) at weblogic.version.<clinit>(version.java:18)
    at weblogic.jdbc.common.internal.FileProxy.initFileHandles(FileProxy.java:30) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:215)
    at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171)
    Can anyone tell me why this happens? What is difference between using the driver standalone and using it with RMI? Does it have anything to do with the fact that I'm using Javasoft RMI and not Weblogic RMI? I'm pretty sure I have the classpaths set up correctly.
    Thanks,
    Bo

    Bo Min Jiang wrote:
    Hi,
    I wrote a simple class for inserting rows into a database. The database is SQL Server 2000, and I am using weblogic's mssqlserver4 driver. The class works fine, but when I try to export the class as a remote object (using Sun's RMI implementation, not Weblogic RMI), I get the following error:
    Exception in thread "main" weblogic.common.internal.VersioningError: No WebLogic packages defined in CLASSPATH at weblogic.common.internal.VersionInfo.<init>(VersionInfo.java:35) at weblogic.version.<clinit>(version.java:18)
    at weblogic.jdbc.common.internal.FileProxy.initFileHandles(FileProxy.java:30) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:215)
    at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171)
    Can anyone tell me why this happens? What is difference between using the driver standalone and using it with RMI? Does it have anything to do with the fact that I'm using Javasoft RMI and not Weblogic RMI? I'm pretty sure I have the classpaths set up correctly.
    Thanks,
    BoHi. Show me the whole stacktrace of the exception. The issue seems to be the driver licensing
    code, which is looking for the bea.license file, and not finding it. Have your code run a System command
    to find and print out the classpath it thinks is in effect. You will then see if the license file is there.
    Joe

  • Problem using CORBA clients with RMI/EJB servers..!!!???

    Hi,
    I have a question on using EJB / or RMI servers with CORBA clients using
    RMI-IIOP transport, which in theory should work, but in practice has few
    glitches.
    Basically, I have implemented a very simple server, StockTreader, which
    looks up for a symbol and returns a 'Stock' object. In the first example, I
    simplified the 'Stock' object to be a mere java.lang.String, so that lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case 1) and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA and RMI-to-RMI.
    But the problem arises when I tried using the RMI server (via IIOP) with the
    CORBA client, when the client tries to narrow the object ref obtained from
    the naming service into the CORBA idl defined type (StockTrader) it ends up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a PortableRemoteObject derived
    class, to make it IIOP compliant), and then the server to register the stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming =NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ": " +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to register the RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref name (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the naming
    service, the operation StockTraderHelper.narrow() fails in the segment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registered in a CORBA
    server (as opposed to an RMI server), but works correctly with no casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

    On the contrary... all that is being said is that we needed to provide clearer examples/documentation in the 5.1.0 release. There will be no difference between the product as found in the service pack and the product found in the 5.1.1. That is, the only substantive will be that 5.1.1 will also
    include the examples.
    "<=one way=>" wrote:
    With reference to your and other messages, it appears that one should not
    expect that WLS RMI-IIOP will work in a complex real-life system, at least
    not now. In other words, support for real-life CORBA clients is not an
    option in the current release of WLS.
    TIA
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    We currently publish an IDL example, even though the IDL programmingmodel in Java is completely non-functional, in anticipation of the support
    needs for uses who need to use IDL to talk to the Weblogic server,
    generically. This example illustrates the simplest connectivity; it does not
    address how
    to integrate CORBA and EJB, a broad topic, fraught with peril, imo. I'llnote in passing that, to my knowledge, none of the other vendors attempt
    this topic either, a point which is telling if all the less happy to hear.
    For the record then, what is missing from our distribution wrt RMI-IIOPare a RMI-IIOP example, an EJB-IIOP example, an EJB-C++. In this you are
    correct; better examples are forth coming.
    Still, I would not call our RMI-IIOP implementation fragile. I would saythat customers have an understandably hard time accepting that the IDL
    programming model is busted; busted in the sense that there are no C++
    libraries to support the EJB model, and busted in the sense that there is
    simply no
    support in Java for an IDL interface to an EJB. Weblogic has nothing to doit being busted, although we are trying to help our customers deal with it
    in productive ways.
    For the moment, what there is is a RMI (over IIOP) programming model, aninherently Java to Java programming model, and true to that, we accept and
    dispatch IIOP request into RMI server objects. The way I look at it is this:
    it's just a protocol, like HTTP, or JRMP; it's not IDL and it has
    practically nothing to do with CORBA.
    ST wrote:
    Eduardo,
    Can you give us more details about the comment below:
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult ot
    use an idl client in java to work.It seems to me that Weblogic's RMI-IIOP is a very fragile
    implementation. We
    don't need a "HelloWorld" example, we need a concrete serious example(fully
    tested and seriously documented) that works so that we can get a betteridea
    on how to integrate CORBA and EJB.
    Thanks,
    Said
    "Eduardo Ceballos" <[email protected]> wrote in message
    news:[email protected]...
    Please post request to the news group...
    As I said, you must separate the idl related classes (class files and
    java
    files) from the rmi classes... in the rmic step, you must set a newtarget
    (as you did), emit the java files into that directory (it's not clearyou
    did this), then remove all the rmi class files from the class path... ifyou
    need to compile more classes at that point, copy the java files to theidl
    directly is you must, but you can not share the types in any way.
    I fear that as soon as the call to narrow succeeds, the remainingapplication will fail to work correctly because it is too difficult otuse
    an idl client in java to work.
    Harindra Rajapakshe wrote:
    Hi Eduardo,
    Thanks for the help. That is the way I compiled my CORBA client, by
    separating the IDL-generated stubs from the RMI ones, but still I
    get a
    CORBA.BAD_PARAM upon narrowing the client proxy to the interfacetype.
    Here's what I did;
    + Define the RMI interfaces, in this case a StockTrader interface.
    + Implement RMI interface by extendingjavax.rmi.PortableRemoteObject
    making
    it IIOP compliant
    + Implemnnt an RMI server, and compile using JDK1.2.2
    + use the RMI implementation to generate CORBA idl, using RMI-IIOPplugin
    utility rmic;
    rmic -idl -noValueMethods -always -d idl stock.StockTraderImpl
    + generate Java mappings to the IDL generated above, using RMI-IIOPplugin
    util,
    idlj -v -fclient -emitAll -tf src stocks\StockTrader.idl
    This creates source for the package stock and also
    org.omg.CORBA.*
    package, presumably IIOP type marshalling
    + compile all classes generated above using JDK1.2.2
    + Implement client (CORBA) using the classes generated above, NOTthe
    RMI
    proxies.
    + start RMI server, with stockTrader server obj
    + start tnameserv
    + start CORBA client
    Then the client errors when trying to narrow the obj ref from the
    naming
    service, into the CORBA IDL defined interface using,
    org.omg.CORBA.Object obj =naming.resolve(nn);
    StockTrader trader =StockTraderHelper.narrow(obj); // THIS
    ERRORS..!!!
    throwing a CORBA.BAD_PARAM exception.
    any ideas..?
    Thanks in advance,
    -hari
    ----- Original Message -----
    From: Eduardo Ceballos <[email protected]>
    Newsgroups: weblogic.developer.interest.rmi-iiop
    To: Hari Rajapakshe <[email protected]>
    Sent: Wednesday, July 26, 2000 4:38 AM
    Subject: Re: problem using CORBA clients with RMI/EJBservers..!!!???
    Please see the post on june 26, re Errors compiling... somewherein
    there,
    I suspect, you are referring to the rmi class file when you are
    obliged
    to
    completely segregate these from the idl class files.
    Hari Rajapakshe wrote:
    Hi,
    I have a question on using EJB / or RMI servers with CORBA
    clients
    using
    RMI-IIOP transport, which in theory should work, but in practice
    has
    few
    glitches.
    Basically, I have implemented a very simple server,
    StockTreader,
    which
    looks up for a symbol and returns a 'Stock' object. In the firstexample, I
    simplified the 'Stock' object to be a mere java.lang.String, so
    that
    lookup
    would simply return the 'synbol'.
    Then I have implemented the above, as an RMI-IIOP server (case
    1)
    and a
    CORBA server (case 2) with respective clients, and the pair of
    client-servers work fine as long as they are CORBA-to-CORBA andRMI-to-RMI.
    But the problem arises when I tried using the RMI server (via
    IIOP)
    with
    the
    CORBA client, when the client tries to narrow the object ref
    obtained
    from
    the naming service into the CORBA idl defined type (StockTrader)
    it
    ends
    up
    with a class cast exception.
    This is what I did to achieve the above results:
    [1] Define an RMI interface StockTrader.java (extending
    java.rmi.Remote)
    with the method,
    public String lookup( String symbol) throws RMIException;
    [2] Implement the StorckTrader interface (on a
    PortableRemoteObject
    derived
    class, to make it IIOP compliant), and then the server to
    register
    the
    stock
    trader with COS Naming service as follows:
    String homeName =....
    StockTraderImpl trader =new StockTraderImpl();
    System.out.println("binding obj <" homeName ">...");
    java.util.Hashtable ht =new java.util.Hashtable();
    ht.put("java.naming.factory.initial", args[2]);
    ht.put("java.naming.provider.url", args[3]);
    Context ctx =new InitialContext(ht);
    ctx.rebind(homeName, trader);
    [3] Generate the RMI-IIOP skeletons for the Implementation
    class,
    rmic -iiop stock.StockTraderImpl
    [4] generate the IDL for the RMI interface,
    rmic -idl stock.StockTraderImpl
    [5] Generate IDL stubs for the CORBA client,
    idlj -v -fclient -emitAll StockTraderImpl.idl
    [6] Write the client to use the IDL-defined stock trader,
    String serverName =args[0];
    String symList =args[1];
    StockClient client =new StockClient();
    System.out.println("init orb...");
    ORB orb =ORB.init(args, null);
    System.out.println("resolve init name service...");
    org.omg.CORBA.Object objRef
    =orb.resolve_initial_references("NameService");
    NamingContext naming=NamingContextHelper.narrow(objRef);
    ... define a naming component etc...
    org.omg.CORBA.Object obj =naming.resolve(...);
    System.out.println("narrow objRef: " obj.getClass() ":"
    +obj);
    StockTrader trader =StockTraderHelper.narrow(obj);
    [7] Compile all the classes using Java 1.2.2
    [8] start tnameserv (naming service), then the server to
    register
    the
    RMI
    server obj
    [9] Run the CORBA client, passing it the COSNaming service ref
    name
    (with
    which the server obj is registered)
    The CORBA client successfully finds the server obj ref in the
    naming
    service, the operation StockTraderHelper.narrow() fails in thesegment
    below, with a class cast exception:
    org.omg.CORBA.Object obj =naming.resolve(...);
    StockTrader trader =StockTraderHelper.narrow(obj);
    The <obj> returned by naming service turns out to be of the
    type;
    class com.sun.rmi.iiop.CDRInputStream$1
    This is of the same type when stock trader object is registeredin a
    CORBA
    server (as opposed to an RMI server), but works correctly with
    no
    casting
    excpetions..
    Any ideas / hints very welcome.
    thanks in advance,
    -hari

  • Doubts with working in BI

    Dear Experts,
    I am sure SAP follows the same concepts in BI as just recently i have worked in JasperSoft Talend Open studio.
    But i have some doubts with BI.
    I created a RFC in ABAP. Used that RFC to bring data for a single day as parameter  on to ingres database table .The ingres table is of same schema as of structure output.Finally i find that ingres table is populated after running relevant job.
    Now i thought to work twoards report and that worked as well.But still i have doubts.
    As i am new to BI ,i dont know what advantage i got by doing this breathless activity.
    (1) I would have simply used sap itself to generate report.What was the need to bring to mysql.Load to my server remain same because definitely RFC will be executed nowhere but on server itself.
    (2)If daily i have to run the same job ,obviously i could have done same with sap.Same amount of data will be retrieved with
    same overheads.
    As i said that i am new to BI.Plz explain me about power of BI  and what i am missing to conceptualize ?

    Aditya,
    You can definitely use SAP R/3 to generate these issues - the only issues are :
    SAP R/3 is an OLTP system
    by OLTP system the system is optimized / tuned to be able to do inserts and updates to tables but then the default indices are not tuned for reads ... this might cause report performance issues...
    SAPR/3 is not supposed to hold more than 2 years of data at best ( unless your system is small enough ) whereas a BI system can hold and should hold much more information.
    Getting the master data descriptions for the data you are reporting upon and that too across languages can be a challenge - whereas it can be better handled in a BI system...
    As for extracting large volumes of data you should use the Service API that comes with SAP Bi for better extraction performance ...
    some points why you need a BI system.....

  • Any example of dynamic proxy with RMI?

    Hi, are there any good example of dynamic proxy with RMI, using the new RemoteObjectInvocationHandler class?
    I am currently implementing a Registry, and want to use dynamic proxy to wrap around the registry stub, to pass extra information to the client.
    I've tried it, but the program will hang and get this exception:
    Exception in thread "RMI TCP Connection(1616)-192.168.1.23" java.lang.OutOfMemoryError: Java heap space
    My implementation looks like this:
    public RegistryImpl extends RemoteServer Implements Registry {
        public RegistryImpl(int port, Properties... properties) throws RemoteException, ChannelException {
             // Create a reference for the registry.
         LiveRef liveref = new LiveRef(id, port);
            ref = new UnicastServerRef(liveref);
             Registry proxy = (Registry)RegistryProxy.newProxyInstance(
                  this.getClass().getClassLoader(),
                  this.getClass().getInterfaces(),
                  new RemoteObjectInvocationHandler(this.getRef()));
             /* Using dynamic proxy */
             usref.exportObject(proxy, null, true);
    public class RegistryProxy extends Proxy implements Registry {
         private InvocationHandler handler;
         public RegistryProxy(InvocationHandler handler) {
              super(handler);
              this.handler = handler;
         public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException {
              Remote result;
              try {
                   Method m = Registry.class.getMethod("lookup", new Class[]{String.class});
                   result = (Remote)handler.invoke(this, m, new Object[]{name});
              } catch (SecurityException e) {
                   throw new UndeclaredThrowableException(e);
              } catch (NoSuchMethodException e) {
                   throw new UndeclaredThrowableException(e);
              } catch (Throwable e) {
                   throw new UndeclaredThrowableException(e);
              return result;
         public void bind(String name, Remote remoteObj) throws RemoteException, AlreadyBoundException, AccessException {
         public void unbind(String name) throws RemoteException, NotBoundException, AccessException {
         public void rebind(String name, Remote remoteObj) throws RemoteException, AccessException {
         public String[] list() throws RemoteException, AccessException {
    }I am new to Java programming, any help is appriciated.
    Regards
    Eddie

    Hi Eddie,
    Perhaps you might like this one:
    http://wiki.java.net/bin/view/Communications/TransparentProxy
    it uses dynamic proxies to achieve complete RMI transparency.
    Something to consider, good luck.
    John

  • Doubt with Implicit Enhacement in SAP ABAP

    Dear.
    I have the following doubt with the Implicit Enhacement in SAP ABAP created by me in several applications standard-
    If I Create an Implicit Enhacement in SAP ABAP for a function module or program standard , when the team basis is doing an upgrade the code abap created in the Implicit Enhacement not is deleted?
    I have created several Implicit Enhacement for Applications WD ABAP and FM, but I have this doubt.
    http://wiki.sdn.sap.com/wiki/display/ABAP/HowToDoImplicitEnhancement
    Thanks a lot in advance.
    Carmen G.

    Hi,
    you code will be retain after upgrade. If you have done implicit enhancements doesnt mean your code would get deleted after upgrades.
    In some cases you might have to activate your enhancments using SPAU.
    Thanks

  • Bizzare behavior with RMI using the localhost

    I'm still new to RMI and I'm observing some strange behavior with RMI.
    I'm using RMI as a communication protocol in a client/server database application. Since I don't have access to a network at the moment I was running the application on a single host and using the local host parameter to test my RMI code.
    In my code if I do a naming lookup on the local host and it works as I would expect it to. (Note before this code fragment runs I've all ready started the rmi registry and bound the RemoteDatabase to it.)
    try{
    String name = "rmi://" + "127.0.0.1" +":"+1099+"/RemoteDatabase";
    thedb = (RemoteDB)Naming.lookup(name);
    }catch
    Now if I replace "127.0.0.1" with a garbage value such as "12453" it still works!
    This is not the behavior I expected. I expected that the Naming.lookup would throw a exception of some kind.
    Can any one explain this behavior?
    The reason I would like this to work as I expected is that in my application the IP address string and port number are variables that I allow the user to set through a dialog. If the user puts in a garbage string for the IP address I want to catch the exception and display an appropriate warning dialog to the user. I can't seem to do that since the Naming.lookup() for a garbage IP address doesn't seem to throw any exception that I have been able to detect.
    I've actually observed even stranger behavior. If I use a garbage string such as 124.4.1.2, which is invalid IP address, the Naming.lookup() will throw an exception. If I put in a garbage string such as "aaaaaa" for the IP address the Naming.lookup() throws an exception. This is the behavior I would expect.
    However as I mentioned if I use a string such as "12345" for the IP address the code works! This seemingly inconsistent behavior is driving me nuts so if any of you RMI gurus out there can help me out I would very much appreciate it.
    Thanks in advance.

    Hi, there.
    lookup uses URI parsing so the fact that your using numbers being equivalent to localhost seems to be due to the fact that that is an invalid host according to the javadocs for the getHost primitive attached below(marked the most important parts). In this case returning null is interpreted as absent , therefore => localhost. Nothing about the port! Maybe you can take it from here. Seems you'll have to make some user input validation yourself, in your application. Hope I haven't missed anything.
    Good luck.
    Nuno
    getHost
    public String getHost()Returns the host component of this URI.
    The host component of a URI, if defined, will have one of the following forms:
    A domain name consisting of one or more labels separated by period characters ('.'), optionally followed by a period character. Each label consists of alphanum characters as well as hyphen characters ('-'), though hyphens never occur as the first or last characters in a label.
    The last, or only, label in a domain name begins with an alpha character.
    A dotted-quad IPv4 address of the form digit+.digit+.digit+.digit+, where no digit sequence is longer than three characters and no sequence has a value larger than 255.
    An IPv6 address enclosed in square brackets ('[' and ']') and consisting of hexadecimal digits, colon characters (':'), and possibly an embedded IPv4 address. The full syntax of IPv6 addresses is specified in RFC 2373: IPv6 Addressing Architecture.
    The host component of a URI cannot contain escaped octets, hence this method does not perform any decoding.
    Returns:
    The host component of this URI, or null if the host is undefined
    ********************************************************************

  • IllegalAccessError passing object with RMI

    Hi,
    I am playing with RMI at the moment.
    I have a Remote class that implements a Remote interface
    The interface has one method which the class implements and this is to get a TestSerial object.
    If I run without using a Securitymanager then there are no problems.
    When I do use the SecurityManager then there is an error.
    This error remains even if set the permissions in the policy file to java.security.AllPermissions
    Does anyone know why this is?
    thanks in advance,
    J
    //Start the server....
    java -Djava.security.policy=policy HelloServer
    In main....
    HelloImpl bound in registry....
    //Run the client
    java -Djava.security.policy=policy HelloClient
    Exception in thread "main" java.lang.IllegalAccessError: tried to access TestSerial from class $Proxy0
    at $Proxy.getTestSerial(Unknown Source)
         at HelloClient.main(HelloClient.jav:23)
    * Remote interface
    public interface Hello extends java.rmi.Remote {
        TestSerial getTestSerial() throws java.rmi.RemoteException;
    * Remote class
    public class HelloImpl implements Hello {
      public HelloImpl() {
      public TestSerial getTestSerial(){
        return new TestSerial();
    * Server class
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.rmi.registry.*;
    public class HelloServer {
      public HelloServer() {
      public static void main(String args[]) {
        System.out.println("In main....");
        if (System.getSecurityManager() == null) {
          System.setSecurityManager(new SecurityManager());
        try {
          HelloImpl obj = new HelloImpl();
          Hello stub = (Hello) UnicastRemoteObject.exportObject(obj, 0);
          Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
          registry.bind("Hello", stub);
          System.out.println("HelloImpl bound in registry...."); 
        catch (Exception e) {
          System.out.println("HelloImpl exception: " + e.getMessage());
          e.printStackTrace();
    * Client class
    import java.rmi.*;
    import java.rmi.registry.*;
    import java.io.*;
    public class HelloClient {
    public static void main(String args[]) {
       if (System.getSecurityManager() == null) {
         System.setSecurityManager(new SecurityManager());
       try {
          Registry registry = LocateRegistry.getRegistry();
          Hello obj = (Hello) registry.lookup("Hello");
          TestSerial x = obj.getTestSerial();
          System.out.println(x.getName());
        catch (Exception e) {
          System.out.println("HelloClient exception: " + e.printStackTrace();
    * TestSerial class
    class TestSerial implements java.io.Serializable {
      public TestSerial(){
      public String getName(){
        return "TestSerial";
    * Policy file
    grant codeBase "file:." {
      permission java.net.SocketPermission "*:1024-", "accept,connect";
    };

    class TestSerial implements java.io.Serializable {
    public class TestSerial implements java.io.Serializable {

  • Doubt with alter system

    I have the doubt with the statement like :
    SQL> alter system set OPTIMIZER_FEATURES_ENABLE=8.1.7 scope=both;
    is going to permanently alter the system or for that particular instance or session. I mean is it done once or everytime in a new session. Also, how to see the currect value of this parameter, I mean how to query it?
    I hope, my question is clear.
    Please, help in solving the doubt.
    regards

    user574290 wrote:
    I have the doubt with the statement like :
    SQL> alter system set OPTIMIZER_FEATURES_ENABLE=8.1.7 scope=both;
    is going to permanently alter the system or for that particular instance or session. I mean is it done once or everytime in a new session. Also, how to see the currect value of this parameter, I mean how to query it?
    I hope, my question is clear. Well, here is what alter system about SPFILE is
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref445
    From it,
    >
    SCOPE = BOTH     The change is applied in both the server parameter file and memory. The effect is as follows:
    For dynamic parameters, the effect is immediate and persistent.
    For static parameters, this specification is not allowed.>
    So this setting will persist across the session logon and log off.
    Suggestion, its good to check oracle docs, choke full of useful info.
    HTH
    Aman....

  • Doubt with set_item_property

    Hi all,
    I am trying to use set_item_property in when-validate item trigger,but whenever i am trying to write the below code i am getting an error too many declarations of set_item_property match this  call
    Can someone kindly guide me how to overcome the error
    BEGIN
    IF :RHCCUSTDET.range_type = 'Bill To'
         THEN
         SET_ITEM_PROPERTY(:RHCCUSTDET.range_from,LOV_NAME,'BILL_FROM_LOV');
    ELSE     
         SET_ITEM_PROPERTY(:RHCCUSTDET.range_from,LOV_NAME,'DELIVERY_FROM_LOV');
    END IF;
    END;     Btw,my form builder version is 10.1.2.0.2
    Any help is appreciated,
    Thanks in advance!!
    Edited by: sandy on Jan 27, 2012 10:16 AM

    sandy wrote:
    Thanks for the reply.
    I do have some doubts with your explanation..Generally we keep a database item as a bind variable in Forms.But,here you are giving a single quote over here *'RHCCUSTDET.range_from'*It's not my opinion. It's from forms syntax. Here it is
    SET_ITEM_PROPERTY
      (item_name  VARCHAR2, property   NUMBER, value      VARCHAR2);So, what u'r putting for value field ? In a single quote or without ? Hope understand.. If you wish you can use Item_id in place of item_name data type of number.
    So,i have put the below code for two text items in when validate item trigger..but now i am getting error as unable to resolve reference RHCCUSTDET.customer_number.Some other reason. I don't see the RHCCUSTDET.customer_number in your code.
    The logic behind behind the dynamic LOV is..there are 6 list of values for a column Range Type..So,if one selects Bill to the corresponding details should pop up in range_from and range_to fieldsHere i have question. Does it comes from same sql ? just difference in where condition ?
    If yes. No need to create two different lov just create two record group(same sql, without where condition and with condition) and dynamically assign them to LOV.
    Hope you understand...
    If someone's response is helpful or correct, please mark it accordingly.

  • Doubt with index hint

    I have a doubt with applying the index hint to fire for multiple coulmns in a query.
    For a single column, it is ok like:-
    select /*+ index( ppbS_inv_sim_serial iss_status) */ item_type_id, status, city from
    ppbS_inv_sim_serial where status='IT';
    there is a problem with indexes firing in our database so this way, using hint, the
    indexes fire.
    But, what, if i want all 3 indexes in the query to fire like
    select count(1) from
    ppbS_inv_sim_serial where status='IT' and item_type_id='A2' and city='USA';
    I hope, my question is clear. Please, help i solving my doubt as it is urgent.
    regards.

    Fix the problem. Not the symptom.
    Using hints in SQL, especially production SQL, is a very poor way to address the problem and only fix the symptom for a period. Until the problem rears its head again and bite you in the butt - a lot more painful this time around.
    Solving performance problems start with Rule #1.
    RULE 1#. IDENTIFY THE PERFORMANCE PROBLEM
    Saying that something is slow, is not identifying the problem. The only way a problem can be solved is if you have at least some idea what the actual problem is.
    Identifying the problem will point to issues like:
    - database schema(s) not being analysed or analysed correctly
    - poorly designed and written SQL (often the case)
    - poorly configured Oracle instance
    - problem/bug(?) with the Oracle CBO
    And depending on the problem analysis, the problem can be CORRECTLY and COMPREHENSIVELY and PROPERLY addressed.
    Fixing symptoms? That is only moving the brick wall a bit further away. Allowing you to run even faster into it the next time around.

  • Can I do this with RMI?

    I have a class of methods that access an Oracle database. The Class will be sitting on a server which is connected to the database.
    What I want to do is access these methods from another web server over the internet.
    Is this something that I can do with RMI ?????
    Please Help!!
    Cheers

    yes this can be done. make your class rmi-able, and you should be pretty good. Note, that any parameters that you send this class, or return values must be either remote or serializable. That way RMI can copy them over the network. I'm doing something very similiar currently.

  • Send file with RMI

    Hi,
    I tried to send a file from client to server with RMI as follow:
    upload(String filename, InputStream in);
    however the InputStream is not a Serializable.
    1. Is it a correct method to send the file in RMI ? if not, what should be used?
    2. How to "Serialize" the InputStream, I have tried to pass the "SerailInputStream" extends from InupStream object implements Serializable as a byte array by the ObjectOutputStream and retrieve it in server successfully, but the inputstream seems cannot be used.
    Many thanks
    George

    PipedIn/OutStreams used to commnicate inter-thread transfer. I guess bschauwe are guiding the way how to smoothly handle the file transfer inside the server. The communication to server seems not through the java streams classes.
    if what you want to do is to copy a file in whole. You may send a byte array in a serializable wrapper class. You can create a byte array of a file by using ByteArrayOutputStream and call toByteArray(). Finally in the server side, with the raw byte array, you can create a new ByteArrayInputStream(byte[]). You know the rest of story.
    Or you can create a serializable class that extends InputStream and similary behaves like ByteArrayIn/OutStream. In this case, you have to know how to make a sub-class of non-serializable super class serializable. There is tutorial in the SUN site covering this subject. If you also look at the source codes of both InputStream and ByteArrayInputStream, there is no rocket-science there.
    Frankly, I have not tried myself yet. I am also looking forward to hearing the better suggestion.
    Hope it helped.

Maybe you are looking for