HOWTO: RMI without rmiregistry

I'm putting this here for future common reference.
Usually you go start rmiregistry in the background, get your app to register with the registry and everything is fine. Internally RMI keeps an index of the objects being exported. It associates the index with a name inside an RMI registry. Without the registry you can export an object but noone knows what the index is so you're screwed.
This means that you've got to deploy rmiregistry and your application. What you want to do for smallish/simple applications is install both rmiregistry and your remote objects on the same port internal to your app.
Lets say we want our application on port 2004.
Registry localreg = LocateRegistry.createRegistry(2004);
MyService svc = new MyService(2004);
localreg.bind("FlikFlak",svc);
public class MyService extends UnicastRemoteObject
public MyService(int port)
super(port);
And thats it. One port with an internally bound rmiregistry. Other applications would continue as normal using that port for both your application and that object.
eg:
MyService svc = (MyService)Naming.lookup("//machine:2004/FlikFlak");

Hi!
I have tried the following example:
Interface:
=======
public interface RmiService extends Remote
    public void print(String txt) throws RemoteException;
}Rmi server:
=========
public class RmiServer extends UnicastRemoteObject implements RmiService
    public RmiServer(int port) throws RemoteException
        super(port);
    public void print(String txt) throws RemoteException
        System.out.println(txt);
    public static void main(String[] args)
        if (System.getSecurityManager() == null)
            System.setSecurityManager(new RMISecurityManager());
        try
            Registry rmiRegistry =  LocateRegistry.createRegistry(9999);
            RmiService rmiService = new RmiServer(9999);
            rmiRegistry.bind("RmiService", rmiService);
        } catch (Exception ex)
            ex.printStackTrace();
}Client:
=====
public class RmiClient
    public static void main(String[] args)
        if (System.getSecurityManager() == null)
            System.setSecurityManager(new RMISecurityManager());
        try
            RmiService remoteService = (RmiService) Naming.lookup("//192.1.50.109:9999/RmiService");
            remoteService.print("Hello World!!!");
        }  catch (Exception ex)
            ex.printStackTrace();
}Security policy file (security.txt):
==============
grant
    Permission java.security.AllPermission;
};I startet the server: java -Djava.security.policy=security.txt RmiServer, which seems to work, but when I start the client: java RmiClient, I get the following exception:
java.security.AccessControlException: access denied (java.net.SocketPermission 192.1.50.109:9999 connect,resolve)
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
     at java.security.AccessController.checkPermission(AccessController.java:401)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
     at java.lang.SecurityManager.checkConnect(SecurityManager.java:1026)
     at java.net.Socket.connect(Socket.java:446)
     at java.net.Socket.connect(Socket.java:402)
     at java.net.Socket.<init>(Socket.java:309)
     at java.net.Socket.<init>(Socket.java:124)
     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
     at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
     at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
     at java.rmi.Naming.lookup(Naming.java:84)
     at RmiClient.main(RmiClient.java:21)
java
How can I make this example work?
Regards,
--Alex

Similar Messages

  • RMI, eclipse, rmiregistry and codebase

    Hi all,
    I'm trying to get sun's RMI hello world (http://java.sun.com/javase/6/docs/technotes/guides/rmi/hello/hello-world.html) to work under eclipse.
    This works without problems, but only if i start the rmiregistry from the root of the class tree. (I use a command shell (linux) to start rmiregistry outside of eclipse.) In this case, i don't need to specify a value for the codebase property when starting the server. I don't like this solution because of its ad-hoc-ness, and i would rather set the codebase property and start the rmiregistry from anywhere.
    In my run configuration i use the VM argument
    -Djava.rmi.server.codebase=file:${workspace_loc:/HelloRMIServer/}but that doesn't work, i get an exception:
    Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: example.hello.Hello
    (etcetera...)What am i doing wrong? What is the correct run-configuration in eclipse?
    Thanks in advance. Michiel.

    Actually I am having a similar problem and it is really strange.
    I set the VM Arguments to: -Djava.rmi.server.codebase=file:${workspace_loc}/RMI/ example.hello.Serverand I get: Coult not find the main class. Programm will exit.
    Whatever I change in the VM Arguments, the error is the same! I know that this is a question related to Eclipse mainly, but I will appreciate any help!

  • Possible to use RMI without IIOP for EJBs?

    Is it possble to use RMI on a client to connect to a remote EJB without using CORBA
    (IIOP)?
    How might I do it?
    I'd like to avoid the CORBA overhead if possible.
    Thanks.

    Do I just have to replace iiop:// with t3:// in the url?
    Andy Piper <[email protected]> wrote:
    "Tom Hennen" <[email protected]> writes:
    Is it possble to use RMI on a client to connect to a remote EJB withoutusing CORBA
    (IIOP)?
    How might I do it?
    I'd like to avoid the CORBA overhead if possible.Use t3
    andy

  • Doing RMI withou rmiregistry?

    I export object on the server:
    Hello stub = (Hello)UnicastRemoteObject.exportObject(obj, 5000);
    Is there a simple way to get the remote object reference for the client without running the rmiregistry? because I know all the information about the remote object: host, port, remote interface.

    You still don't know the objectID it was exported with.
    However you don't need the Registry specifically: any technique which can transport the stub returned by exportObject to the client is OK, e.g. a serialized file.

  • Do you know some registries for rmi without unserialization at binding ?

    Hello,
    I'm looking for different implementations of rmi registry in different application servers, and I'm asking the reason why it's type of implementation is not used.
    Thank you for your opinion !
    Fran�ois

    It can be a problem because the classes need to be present in the classpath or downloaded by the rmiclassloader. For me, when the registry is started in an other jvm, the unserialization is useless since the registry is never accessed locally, so the serialized form could be stocked and not the object its-self.

  • RMI without extends/implements Remote stuff

    Hi RMI-Experts,
    is there a way to avoid the extends/implements Remote stuff with RMI.
    Where can I find information about my topic?
    It's not only that I'm lazy, but I want to have arbitrary interfaces exported to RMI also.
    If you have a solution, is it possible for both 1.3 and 1.4?
    Cheers,
    Peter

    Hi RMI-Experts,
    is there a way to avoid the extends/implements Remote
    stuff with RMI.No, extends Remote is neccesary.
    Where can I find information about my topic?In the tutorials section of this site, look for the RMI tutorial.
    It's not only that I'm lazy, but I want to have
    arbitrary interfaces exported to RMI also. That is not possible. Because an RMI call is over the network, there is a whole bunch of things that can go wrong. Since it is neccesary to signal these failures, all methods must be declared to throw a RemoteException.
    It might however be possible to autogenerate a Remote version of an arbitrary interface, assuming that all used types are at least serializable. I really wouldn't recommend this.
    If you have a solution, is it possible for both 1.3
    and 1.4?I dont think it is possible
    Cheers,
    Peter

  • A rmi problem about exporting a remote object

    here is the code:
    public interface Hello extends Remote {
    String sayHello() throws RemoteException;
    public class HelloImpl extends UnicastRemoteObject
    implements Hello {
    public HelloImpl() throws RemoteException {
    super();
    public String sayHello() {
    return "Hello World!";
    public static void main(String args[]) {
    if (System.getSecurityManager() == null) {
         System.setSecurityManager(new RMISecurityManager());
    try{
         HelloImpl obj = new HelloImpl();
         Naming.rebind("//192.168.10.2:2001/HelloServer", obj);
         System.out.println("HelloServer bound in registry");
    }catch (Exception e) {
         System.out.println("HelloImpl err: " + e.getMessage());
    e.printStackTrace();
    public class HelloClient{
    public static void main(String[] args){
    Hello obj = null;
    String message="nobody say hello to me";
    if (System.getSecurityManager() == null) {
         System.setSecurityManager(new RMISecurityManager());
    try {
         obj = (Hello)Naming.lookup("//192.168.10.2:2001/HelloServer");
         message = obj.sayHello();
    }catch (Exception e) {
         System.out.println("exception: "+e.getMessage());
         e.printStackTrace();
    System.out.println(message);
    where 192.168.10.2 is the ip address of my computer.
    i'm using an mini-http server provided by sun,that is,ClassFileServer
    here is my command lines:
    java examples.classServer.ClassFileServer 2003 d:\java\rmi
    start rmiregistry 2001
    java -Djava.rmi.server.codebase=http://192.168.10.2:2001/
    -Djava.security.policy=server.policy HelloImpl
    then encountered the exception.
    can someone tell me how can i export the HelloImpl and
    make it can be invoked by client.
    thanks a lot!

    thank you for your reply,i tried it again like below:
    java examples.classServer.ClassFileServer 2001 d:\java\rmi
    start rmiregistry
    java -Djava.rmi.server.codebase=http://192.168.10.2:2001/
    -Djava.security.policy=server.policy HelloImpl
    java HelloClient
    but could not work,the exception raised at the client point is like that:
    java.rmi.Naming.lookup(unknown source)....
    i want to know how could the client know how to contact with
    rmiregistry,where the client trying to lookup(//192.168.10.2:2001/HelloServer)
    while rmiregistry running on the port 1099.
    thank you!

  • JavaFx + rmi server problem

    I have a problem not with code but with the way how rmi is working. I have such a classes for Server side which is RmiServer.java RmiInterface.java and UNode.java (this one is for supporting linked lists on server side) and my client side looks like main.fx, list.fx RmiClient.java and RmiInterface.java. The problem is that server files and client files are suppose to be in the same directory. Im using netbeans and I can not create an fx project with two main classes. So what i was trying to do is to create two projects one for server and second for client + fx script. But then I get the error about paths. And I can not copy those files because If i do so they immediately appear in second project. So guys do you have any idea how can I solve this problem. If it is helpful I can attach java files. Because what I understood is the server side is suppose to run all the time and different clients get connected to it so it can not be in the same project.
    P.S. When I was checking the rmi without connecting it to javafx it was working properly.
    Sorry for my English:P
    Edited by: ZIelonyWpaletki on Oct 21, 2009 1:11 PM

    Sometimes you are starting the RMI Registry with the correct classpath, or in the correct directory, and sometimes you aren't.

  • JavaCode as String to RMI Task.

    I am creating a load balancing application that consists of many clients and one server. The client will read in a JOB file that consists of "java functions" I then want to remotely execute this function using RMI. The problem however is how do I take the function code and use it with RMI without a wrapper class and compiling (if possible)
    Weldon

    the suggestion is the standard client invokes methods to execute at the server.
    my understanding of your requirement is to load balance, with one server, where is the load balancing with this approach?
    you could export the clients and have the servers pass an instantiated interface with arguments, and have client call the method to execute it at the client side. the server must know how to dispense work.
    Hi.
    I think the simplest solution is :
    You have Remote interface of your server with amethod
    known to all client, for example "Object
    performJob(String jobName, Object[]jobParameteres)".
    Where jobName is name of java function, and
    jobParameteres is necessary data to pass in thisjava
    function.
    In implementation of performJob(..) method (onserver
    side) you may call right method using reflectionapi
    (you know method name and parameters)
    If it is acceptable for you, I may respond to your
    additional questions. :)Is there a way to take actual java code (not compiled)
    and then run it with RMI?

  • RMI running application

    HI
    i'm a new in RMI developpement, for a first time i try to run un exemple from a net , i find this error( i use IDE netbeans 6.1):
    Exception in thread "main" java.lang.InternalError: internal error: SHA-1 not available
    before this ,i have modified a java.security file, i think that it's a raison for that.but i don't know how can repair this.
    help me, i passed 5 days in thid problem
    tks,

    think you for your answer,
    but i have changed all , i desinstaled my JDK, and i went to developped under Eclipse, but i explored a new problemes.
    i don't know from any one i will begin, the first i run an example from this link [http://www.labo-sun.com/resource-fr-videos-1092-0-java-reseau-rmi-applications-distribuees.htm] , i followed all stepes of a video one by one but i find this error runtime for server
    {exception in thread "main" java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
         at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
         at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
         at java.rmi.Naming.bind(Naming.java:111)
         at server.Launch.main(Launch.java:18)
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:180)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
         ... 6 more
    from a client
    java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
         at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:322)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Naming.java:84)
         at client.Launch.main(Launch.java:17)
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:180)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
         ... 6 more
    add to this , i used a plug in spcialy for RMI (rmic, rmiregistry,....) [http://www.genady.net/rmi/index.html]
    it's so long time for a technology which told that it's so easy.i lost a many time for a bit of code so plz SOS,SOS
    HELP! thks

  • Java SE Embedded for ARM9 (ARMv5 Linux - Headful) gets rmiregistry failure

    Hi, all,
    I am using a embedded platform with TI Davinci ARM9 processor. I meet a technical problem when using Java SE Embedded 6 for ARM9 (ARMv5 Linux - Headful). I have a Java program working well in the PC with Java virtual machine.
    However, when this Java program can not run in the embedded platform. There is an error reported: "failed to start rmiregistry". The detailed error message is below:
    rmi:
    [java] rmiregistry not running
    [java] The RMI registry is not running, it will be started now.
    [java] If running under Windows you may have to hit ctrl-C after
    [java] it has been started and re-run the ant command.
    [java] Trying to start rmi registry: rmiregistry
    [java] Trying to start rmi registry: nullrmiregistry
    [java] Trying to start rmi registry: /bin/rmiregistry
    [java] Trying to start rmi registry: null/bin/rmiregistry
    [java] Trying to start rmi registry: \bin\rmiregistry.exe
    [java] Trying to start rmi registry: null\bin\rmiregistry.exe
    [java] rmiregistry not running
    [java] rmiregistry not running
    [java] rmiregistry not running
    [java] rmiregistry not running
    [java] rmiregistry not running
    [java] java.rmi.ConnectException: Connection refused to host: ; nested exception is:
    [java]      java.net.ConnectException: Connection refused
    I searched in the Java SE Embedded, there is no the file named rmiregistry. However, there is a file named rmiregistry in the PC's Java. Is it the reason caused the failure? Is the package of Java SE Embedded not complete? Anyone get idea how to solve this problem?
    Thanks.
    Best Rgds,

  • How EJB can be replaced for RMI When...

    Hi All
    How EJB can be a replacement for RMI , when all the EJB functionalities can be done with RMI.
    For example middle-ware services available in both EJB and RMI. In EJB it's been taken care by the container. in RMI we have to write it explicitly.
    What's the difference then....?
    Aravind

    I believe there must be something more than that ...in EJBOfcourse there are so many.
    Actually when RMI came into existance then Java used to use that JRMP (Java remote method protocol) meaning is that there was not support for non-java clients. Then after that IIOP came into picture (Internet Inter ORB protocol) means CORBA compliant, thereby allowed non-java clients to get connected to ur java severs.
    What I think is ....main feature that EJB have is that they are transactions aware. I don't know How to do it in RMI so robustly. One thing more, CMP Entity beans provide you an easy way to store ur data, I don't think, u can do so in RMI without writing complex queries.
    I myself not very sure about RMI, but EJBs are makets. I have never done any realworld work with RMI but for EJBs I have gone through 3-4 live realworld projects.
    Hope this helps !!!
    Cheers.
    Sanjeev

  • RPC Style Web Service and SSL

    Hi,
    Has anyone tried (and maybe succeeded) in accessing an
    RPC-style Web Service deployed on WebLogic Server 6.1 using
    SSL? I have a Web Service deployed and am able to access it using JNDI and the
    weblogic.soap.http.SoapInitialContextFactory
    INITIAL_CONTEXT_FACTORY. However, when I try to set the
    Context.SECURITY_PROTOCOL to "ssl" and access the secure port,
    I get a "java.net.SocketException: Unexpected end of file from
    the server" error message.
    Does the weblogic.soap.http.SoapInitialContextFactory not
    support SSL? Do I need to do the SOAP/XML messaging myself,
    without being able to make use of the WebLogic convenience
    classes? Thanks! Rob

    Alright!
    Glad you got it working ;-)
    Actually, the problem with the protocol being hardcoded to http in the wsdl.jsp,
    is a bit strange. It's unusual that the BEA engineers that coded the wsgen component
    and support classes, didn't use something like the following:
    <soap:address location="<%= request.getScheme() + "://" + request.getServerName()
    + ":" + request.getServerPort() %>/security/examples/webservices/security/PhoneBookService"/>
    I don't use wsgen too much, because I need to have more control over the J2EE
    packaging. It (wsgen) is great for spitting out stuff, but not really setup for
    doing Web service packaging that use classes (i.e. helper files, frameworks, etc.)
    that it doesn't generate. I think they (BEA) might be looking into integrating
    the Web Services assembly process with other tools like WebGain, Forte, etc. to
    alleviate these types of issues.
    Anyway, glad you got it working, so now you can help somebody else (time permitting,
    of course) with this topic in the future!
    Regards,
    Mike Wooten
    "Rob Nelson" <[email protected]> wrote:
    >
    Mike,
    Thank you very much for your response! The next to
    last sentence did it for me (when you mentioned checking
    that the location attribute of the soap:address element
    was set properly)! I noticed that when I viewed the WSDL
    file via the browser (by clicking on the link in the
    index.html page), I saw http://host:<unsecure_port> when
    I requested it over the unsecure port, but I saw
    http://host:<secure_port> when I requested the WSDL over
    the secure port. Notice it did not say https!
    So, I unjarred the EAR file that was generated by my
    wsgen task, and then unjarred the generated WAR file
    contained therein. When I looked at wsdl.jsp, I noticed
    that "http" was hard-coded in the location attribute, but
    that the host name and port number were dynamically
    generated. So I added a scriplet to dynamically place an
    "s" after "http" (if request.isSecure()) and rejarred up
    the WAR and EAR files.
    Now when I deployed the EAR file, I see "https" when
    I request the WSDL over the secure port, and my client
    (actually your client;) works! Awesome! I really appreciate
    your help! Now my only issue is why did the wsdl.jsp have
    "http" hard-coded, not accounting for secure requests.
    These files were generated by the WSGEN task in ANT.
    I figure it's either: I have a configuration problem,
    I have a problem with my ANT build script, my version of
    WebLogic Server (6.1 w/SP1 built 9/18/2001) has a bug, or
    maybe you just have to manually go in and modify the wsdl.jsp
    file if you want to use https :(. Please let me know if
    you have any insight on this, and I will also follow up
    with WebLogic support. Thanks again! Rob
    "Michael Wooten" <[email protected]> wrote:
    Hi Rob,
    I am absolutely sure the code I posted works, so we need to approach
    this from
    a different angle ;-)
    First, I know why the Context.SECURITY_PROTOCOL approach doesn't works.
    It's because
    the namespace in the Web Services code examples is not the same oneas
    the one
    used for RMI objects, EJBs, JDBC Data Sources, etc. For those objects,
    the Context.PROVIDER_URL
    is something like "t3://localhost:7001", and the INITIAL_CONTEXT_FACTORY
    is "weblogic.jndi.WLInitialContextFactory".
    The one being used with WebLogic Web Services, is mainly just functioning
    as a
    mechanism for manufacturing WebServiceProxy objects, because it is a
    non-instanciable!
    It does this by using a subclass of javax.naming.Context called SOAPContext,
    which
    is completely hidden from you, but also doesn't do much except implement
    the lookup()
    method. The implementation of this method ignores the Context.SECURITY_URL
    property,
    but it does pay attention to the "java.naming.security.principal" and
    "java.naming.security.credentials"
    properties. You don't need these properties for SSL, just Basic Authentication.
    Enough about that, though. The service end-point is a servlet right?
    So this means
    it has a URL that begins with http or https, which in turn means the
    WebLogic
    servlet engine gets the SOAP request and sends it to the StatelessSessionAdapter
    servlet. To WLS, this is just like any other HTTP/HTTPS request sent
    to it ;-)
    There is no special "SOAP-related" HTTP/HTTPS handler in WLS, but the
    SSL challenge
    dance still happens. So my first question is, are you sure you havethe
    HTTPS
    attributes set properly in the WebLogic console. SSL/HTTPS should be
    enabled and
    the "Hostname Verification Ignored" checkbox should be checked. Next,
    are you
    sure the URL assigned to the location attribute of the <service> element
    in the
    WSDL is correct (i.e. https://localhost:7002)? Are you using the "dynamic
    client"
    approach?
    Regards,
    Mike Wooten
    "Rob Nelson" <[email protected]> wrote:
    Mike,
    Thanks for your response. I downloaded the code example that
    you
    posted
    last week, as well as the code example that you posted in October for
    a similar
    request (BEA Support pointed me towards that). Unfortunately, I still
    can't get
    the Web Service to respond to the client request when the client uses
    the HTTPS
    port for the WebLogic Server.
    I tried two different client approaches. The first uses the client
    code
    that you posted in October, the WebServiceProxy approach. The second
    approach
    is based on the example in the WebLogic documentation, which uses the
    weblogic.soap.SoapInitialContextFactory
    class with the javax.naming.Context object to perform a lookup on the
    service
    (which closely resembles rmi without the narrowing).
    Both client classes fail to invoke the the service itself viaHTTPS
    (although
    they both work when making HTTP requests to the unsecure port). However,
    when
    I run the client based on the client class that you posted in October
    and make
    an HTTPS request, I can see in the output where it is able to download
    the WSDL
    file and use it (via the WebServiceProxy) to describe the availablemethods
    for
    the associated Web Service. It is only when the actual invoke() method
    is called
    on the SoapMethod object (which in turn sends the XML request to the
    Web Service
    Servlet), that the server doesn't respond, and the client fails with
    an UnexpectedEndOfFileException
    (i.e. no response).
    So, do you know why the servlet that the RPC-style Web Serviceuses
    to handle
    requests would not respond to HTTPS requests, when it processes HTTP
    requests
    without a problem (using the same client code that fails with the HTTPS
    request)?
    I am using WebLogic Server 6.1 w/SP1 on a Solaris 8 platform. Thanks
    for any
    advice you can give me! Rob
    "Michael Wooten" <[email protected]> wrote:
    Hi Rob,
    Check out the attached zip for "insights" into how to do this. It
    contains
    the
    code for two Web service "consumers" (that the new fangled word fora
    "client")
    and the web.xml and weblogic.xml for the RPC-style Web Service, that
    they consume.
    Hope this helps,
    Mike Wooten
    "Rob Nelson" <[email protected]> wrote:
    Hi,
    Has anyone tried (and maybe succeeded) in accessing an
    RPC-style Web Service deployed on WebLogic Server 6.1 using
    SSL? I have a Web Service deployed and am able to access it using
    JNDI
    and the
    weblogic.soap.http.SoapInitialContextFactory
    INITIAL_CONTEXT_FACTORY. However, when I try to set the
    Context.SECURITY_PROTOCOL to "ssl" and access the secure port,
    I get a "java.net.SocketException: Unexpected end of file from
    the server" error message.
    Does the weblogic.soap.http.SoapInitialContextFactory not
    support SSL? Do I need to do the SOAP/XML messaging myself,
    without being able to make use of the WebLogic convenience
    classes? Thanks! Rob

  • ExternalizableLite outside of cluster and licensing?

    Hi!
    To avoid creating redundant temporary objects I would like to pass objects extracted from a Coherence cache on to a client using Java RMI "as is" (by letting the classes implement both ExternalizableLite for optimal storage and transfer withing the cluster and normal Java Externalizable for the RMI transport out of the cluster) but then I belive will get a problem to de-serialize then in my client unless I have the Coherence.jar available there (since the ExternalizbleLite interface is otherwise missing).
    My question is if I (according to the tangosol license - I am very bad at reading legal language so I better sort it out this way!) am allowed to install the coherence jar on the client (for this sole purpose of de-serialization of my objects passed over standard Java RMI) without paying a license fee for the client machines?
    If the answer to the first question is yes, am I also allowed to re-package the ExternalizableLite class into one of my own jar-files to avoid having to have the whole coherence.jar at the client?
    The ideal solution (if the intention is that one should be allowed to use this single interface on machines outside the cluster without having a license for them) would be if it by tangosol could be packaged in some separate "coherence_export.jar" file or something similar...
    Best Regards
    Magnus

    Magnus -
    This month, we are announcing some licensing changes that should make this extremely easy and efficient for you. Previous to our 3.2 release, the client needed to be licensed using a "client" or "local" license to use any of our code. With the new licensing model, that particular type of license will be available for no additional fee.
    Please don't take this as a "legal" answer, but simply as an explanation of the direction that we are headed in. Your account manager (Charlie, I believe) will have all the materials to walk you through it within a few weeks time.
    Peace,
    Cameron.

  • HOWTO: Use BC4J With or Without DB Triggers

    This HowTo describes how to use BC4J, database sequences and triggers
    and what are the ramifications.
    INTRODUCTION
    BC4J has the ability to work with database sequences in order to obtain a
    unique value when inserting records. BC4J also has the ability to
    work either with a 'before insert' trigger which automatically creates
    a new unique value for the primary key or without a trigger. When not using
    a database trigger, BC4J also has the ability to obtain the sequence value
    and set the primary key value.
    Before discussing the ramifications of using one approach or the other, let's
    show examples of how to use both approaches:
    BC4J & sequences WITH a database trigger
    and
    BC4J & sequences WITHOUT a database trigger
    HOWTO DEMONSTRATION STEPS
    To illustrate both scenarios a simple database setup script is provided which
    creates two tables:
    CUSTOMER_NT which DOES NOT have a before insert trigger and
    CUSTOMER_WT which DOES have a trigger.
    Database Install Script:
    <code>
    drop trigger customer_insert_trigger;
    drop table customer_wt;
    drop table customer_nt;
    drop sequence customer_wt_seq;
    drop sequence customer_nt_seq;
    create sequence customer_wt_seq start with 1;
    create sequence customer_nt_seq start with 101;
    create table customer_wt(
    id number,
    name varchar2(30),
    constraint
    customer_wt_pk
    primary key (id)
    create table customer_nt(
    id number,
    name varchar2(30),
    constraint
    customer_nt_pk
    primary key (id)
    prompt Inserting data...
    insert into customer_wt (id, name)
    values (customer_wt_seq.nextval, 'Mickey');
    insert into customer_wt (id, name)
    values (customer_wt_seq.nextval, 'Goofy');
    insert into customer_nt (id, name)
    values (customer_nt_seq.nextval, 'Daffy');
    insert into customer_nt (id, name)
    values (customer_nt_seq.nextval, 'Porky');
    commit
    prompt Creating trigger
    create trigger customer_insert_trigger
    before insert on customer_wt for each row
    begin
    select customer_wt_seq.nextval into :new.id from dual ;
    end;
    </code>
    The next step is to create the DEFAULT Entity Objects and View Objects using
    the Business Components Wizard.
    USING BC4J WITH A DATABASE TRIGGER
    Let's modify the entity object CustomerWt so it can use the database trigger.
    Edit the entity object CustomerWt by right-clicking in the navigator.
    Click on the 'Attribute Settings' tab and edit the ID attribute.
    - Uncheck 'Mandatory'checkbox. This allows you to insert without a value for the primary key
    - Check 'Refresh after Insert'. This obtains the value from the database generated by the trigger.
    - Check 'Updateable While New'. Id is only updateable when inserting.
    Click finish to complete the wizard. Save all and recompile the project.
    Now let's test our work.
    In the navigator right-click the application module and select 'Test..'. This will launch
    BC4J's built in tester. Connect to the application.
    In the tester double-click the CustomerWtView view object to run a test edit form.
    After the edit form renders, navigate through the existing records using the navigate
    buttons on the edit form. Now let's insert a record to execute the trigger.
    click on the '+' button to insert a record. Enter a value in the 'Name' field and commit the change.
    Observe that a new value has automatically been inserted into the Id field.
    That's it! You have successfully used BC4J and a database trigger.
    Now let's try it without a trigger..
    USING BC4J WITHOUT A DATABASE TRIGGER
    Now edit the entity object CustomerNT so it doesn't need a database trigger.
    Similar to before, edit the entity object CustomerNt by right-clicking in the navigator.
    Click on the 'Attribute Settings' tab and edit the ID attribute.
    - Uncheck 'Mandatory'checkbox.
    - Check 'Updateable While New'.
    An additional step is also required. The Create method will have to be modified to extract
    the value of the sequence.
    In the Edit EntityObject Wizard click the Java tab and select Create method and click Finish.
    The create method is generated in your Java fil e. In the Workspace view of the Navigator,
    expand the CustomerNt entity object in the navigator. Double-click
    CustomerNtImpl.java to open it in the Source Editor. In the Structure pane, double-click
    create(AttributeList). Modify the Create method so it looks like this:
    <code>
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl s = new SequenceImpl("customer_nt_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setId(new Number(next.intValue())); }
    </code>
    Save and compile the project.
    Now test the ViewObject CustomerNtView using the tester as before.
    In the edit form of CustomerNTView click on the '+' to insert a record. Observe that
    just as before a new value has automatically been inserted in the ID field!
    TO USE A DB TRIGGER OR NOT TO USE A DB TRIGGER.
    Using a Database trigger sometimes preferable if you have non BC4J applications
    also sharing the database. In this case it is still safest to just let the database
    update it's own primary keys.
    If you don't have any other non-BC4J applications sharing the database, then not using
    a database trigger is perfectly acceptable and can have slightly better performance.
    The important thing to remember is that the option is yours to use either approach!
    null

    Thank you for the reply Jonathon. I am using a ViewObject which
    consist of several tables. I haven't tried the DB trigger
    approach but just using the BC4 approach in overriding the
    create method.
    Here is the parent class create as a part of the
    FasNameImpl.java file which does the job correctly.
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    SequenceImpl l_seq = new SequenceImpl
    ("SEQ_CUSTOMER_ID",getDBTransaction());
    Integer l_next = (Integer)l_seq.getData();
    setCustomerId(new Number(l_next.intValue()));
    This is when I triedpassing the value to the child table. But I
    can't figure it out. I think the link is working fine if I had a
    ViewLink deployed but it doesn't look like it's doing the job
    for ViewObject.
    I am trying to call the childclass.method
    (FasCustomer.setCustomerId(l_next);
    But I am getting error.
    Thanks a lot for your suggestions,
    Kamran
    703 696 1121

Maybe you are looking for

  • Transfering iTunes from old PC and Managing Multiple Devices in 1 Account

    Hi, I have 3 devices (iPhone 4, iPod Touch and iPod Nano).  I want to set up iTunes so that I can manage the content for all 3 devices under a single account, but keep the content separate, possibly using Libraries, but I'm not sure what other option

  • Safari could not download the file because there is not enough free disk

    I'm trying to download to the desktop and there is 257GB of space available. It will allow me to download to a folder in my documents. The finder keeps asking for my password when trying to trash items, I type it and then get a message that I don't h

  • Random photos in slideshow

    I forgot how to show my photos randomly in Slideshow using the Ken Burns effect.

  • Cannot open the SWF file with firefox

    right click open SWF files with IE,it's ok , but with firefox opening it ,point out that can't find the application

  • IPhone charging on Win 2000 PC

    I have a spare iPod cable that I want to use to charge my iPhone up at work through the PC I have with Windows 2000 through USB. When I plug it in I doesnt find the driver for the iPhone obviously and wont go further and isnt supplying power down the