Rmi- unknown hostname

hi
I am practicing on RMI with sun samples.
in
java -D.... hostname=localhost , I return back an error such:
unknown hostname....
i am beginner in this case.
would some body helps me??

unknown hostname what? If it's 'localhost' or some other known host you have a hosts/DNS problem. If it's 127.0.0.1 and the server is on a different host from the client you have a host/DNS problem at the server host, but you can work around it by setting -Djava.rmi.server.hostname at the server host. See the Javadoc/RMI/Guide to Features/java.rmi properties.

Similar Messages

  • Reading java.rmi.server.hostname property

    When try to read java.rmi.server.hostname property within my server I got following exception:
    Exception in thread "main" java.security.AccessControlException: access denied (
    java.util.PropertyPermission java.rmi.server.hostname read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at engine.ComputeEngine.main(ComputeEngine.java:22)
    Any idea how to read this property from program.
    Syed

    Looks as if you need to create a security manager or add a security policy file.
    To create a security manager, add:
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    to the server's 'main' method.
    Then, at program startup, pass in a security policy file:
    java ... -Djava.security.policy=[<pathname>]security.policy [<classpath>]/<RMI server name>
    Where the file security.policy might contain:
    grant {
    // Allow everything for now
    permission java.security.AllPermission;
    Amoong other privileges.

  • Unknown hostname in Terminal

    I suddenly saw that my hostname in the Terminal has changed to "unknown406c8f255bd7". I checked the Computer name under System Pref>>Sharing and its the correct one("ABC_Macbook_Pro"). I further checked the environment variable or used hostname command and i could see the unknown hostname "unknown406c8f255bd7" there.
    When i try to change the hostname thru terminal, it gives me this error "hostname: sethostname: Operation not permitted".
    I tried opening a new terminal window but it did not help.
    I searched thru the existing forum discussions but could not find anything relevant.
    Can someone tell me why the hostname under Sharing and environment variable have different values?
    Thanks

    'bash' the default shell has a default prompt that gets your hostname by taking your IP address and doing a reverse DNS lookup and if the DNS server returns a value, it uses that value. If AND ONLY IF the DNS server does not return anything will your System Preferences -> Sharing -> Computer name.
    So your DNS server has returned unknown406c8f255bd7 and bash is using it.
    You have a few choices.
    Get your DNS server to stop returning unknown406c8f255bd7
    Change your bash prompt to use something else for your command prompt.  Add the following to your .bash_profile or .bash_login or .profile (whichever one you happen to already have; if you do not have one of the above, then create your own .bash_profile using - nano .bash_profile)
                PS1='$(networksetup -getcomputername):\W \u\$ '
    Other?

  • Rebind Method and java.rmi.server.hostname

    Hello,
    We are trying to execute a server on the internet which is installed in a machine whose private IP address is 10.X.X.XX.
    To access the server by internet, the IP address is 196.XXX.XXX.XX and is converted by NAT to the IP address 10.X.X.XX.
    I start the server with the command:
    java -Djava.rmi.server.hostname=196.XXX.XXX.XXX myServer
    Also, and according some recommendation in this forum, we don't use the "rmiregistry" and instead we use the method:
    Registry r = LocateRegistry.getRegistry(MYPORT);
    r.rebind("MyServer", obj);
    However,
    And it takes about over 4 minutes for this app to execute the rebind method. Does anyone know why ?
    If I start without java.rmi.server.hostname propert. it executes immediatelly, but then I can't access the server from outside firewall.
    Am I missing something?
    Any advice or idea?
    Thanks
    Gerardo
    PS. I am using Java 1.4.1 under Linux Red Hat 9.0.

    I start the server with the command:
    java -Djava.rmi.server.hostname=196.XXX.XXX.XXX myServerThe wait is probably due to your DNS setup. Is a client inside the firewall able to reverse-resolve a 196.xxx.xxx.xxx address?
    EJP

  • Dynamically changing java.rmi.server.hostname

    Hi all,
    I am trying to change the java.rmi.server.hostname value dynamically to force my rmi stubs to be exposed on a particular ip
    The java app is started with a default value of 172.30.30.200 for the java.rmi.server.hostname attribute using the -D parameter. Before the binding is done, I set the value of the java.rmi.server.hostname in the system properties to localhost and then call the rebind (code snippet below).
    After this, if I use a jndi browser, I do not see the entries for the localhost. However, I see the entries for 172.30.30.200.
    The release notes for 1.4.2 and 1.5.0 indicate that this attribute can be changed dynamically; does not say how though.
    http://java.sun.com/j2se/1.4/docs/guide/rmi/relnotes.html
    Can anyone give me an idea as to what is happenning.
    Thanks a lot for your help
    Properties currentProperties = System.
    String ipAddr = "localhost";
    currentProperties.put("java.rmi.server.hostname", ipAddr);
    System.setProperties(currentProperties);
    UnicastRemoteObject.exportObject(this);
    InitialContext ctx=new InitialContext();
    ctx.rebind(getObjectName().toString(), this);

    java.rmi.server.hostname should be set to whatever hostname or IP address the client should use when trying to connect to the server. It only needs to be set in JVMs which export remote objects, i.e. in server JVMs.

  • Propertie java.rmi.server.hostname during 1 minute

    Hello from Spain,
    I �m developing an application using Rmi over http (tunneling)
    I execute the example of "rmiservlethandler" and it 's works fine in localnetwork mode.
    Nevertheless, when i try to execute the application accross internet i must put the propertie
    -Djava.rmi.server.hostname=<public ip of server>
    I run this server but only works during 1 minute aprox.
    Later this minute, the server is automatically shutdown and it doesn't report any errors
    What can i do?
    Please, help me and thanks in advance

    I forget say that during this minute, the examples works fine

  • Option '-Djava.rmi.server.hostname' unnecessary?

    In this tutorial:
    http://java.sun.com/docs/books/tutorial/rmi/running.html
    you start the rmi server with:
    java -Djava.rmi.server.codebase=file:/c:\home\ann\public_html\classes/
    -Djava.rmi.server.hostname=zaphod.east.sun.com
    -Djava.security.policy=java.policy
    engine.ComputeEngine
    but in this tutorial:
    http://java.sun.com/j2se/1.4.2/docs/guide/rmi/getstart.doc.html#5321
    you start it without the Djava.rmi.server.hostname option:
    java -Djava.rmi.server.codebase=http://myhost/~myusrname/myclasses/ -Djava.security.policy=$HOME/mysrc/policy examples.hello.HelloImpl
    I have also tried to omit the hostname option from the first tutorial and it works fine..
    Why is it not necessary to specify the Djava.rmi.server.hostname option to make the examples work?
    What is the function of this option?

    It's only necessary if you have a fouled-up DNS which doesn't give the right hostname by default.
    And if Sun had understood the TCP weak-end model better than they did in 1996 it wouldn't be necessary at all.

  • RMI: Unknown source problem with connection & security

    When I try to run the RMI server code, after I have granted all permissions in my policy, after compiling through RMIC generating my stub and skeleton classes, and finally after running the RMI registry, I receive an error. The error that I have been getting is pasted below. I have searched through several java forums trying to find an answer and have not found one. If you recognized this error, please let me know if you have suggestions. Thanks.
    TestRmiServer exception: access denied (java.net.SocketPermission 192.168.0.152:
    1099 connect,resolve) //note: I'm using the default RMI port
    java.security.AccessControlException: access denied (java.net.SocketPermission 1
    92.168.0.152:1099 connect,resolve)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkConnect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
    ource)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.newCall(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Unknown Source)
    at irad.nmi.services.util.testRmi.TestRmiServer.main(TestRmiServer.java:
    64)
    Anyway, a response would be welcome. Thanks.

    look at thread :
    http://forum.java.sun.com/thread.jspa?threadID=597299&tstart=0
    most likely you did not specify the -Djava.security.policy property properly.

  • Unknown hostname & DHCP

    I have a Solaris 8 IA box. During installation, a host name was never prompted for, and I selected DHCP. From comments in the forum, it appears the hostname of 'unknown' may be due to the fact that I selected DHCP.
    I have tried using admintool, the command hostname, and ifconfig to no avail.
    I would like to diable the DHCP, plus specify a new hostname. (As a matter of curiosity, can a alternate host be selected if DHCP is left enabled?)
    Can someone help?
    Thanks in advance
    Jake

    I seems also have such problem.
    And I feel it is really weird, because after I rebooted the system several times, and di "sys-unconfig" sever times (each time input and configure exactly the same), it is all OK now.
    I wonder Solaris (at least 8 for x86) sometimes do not save my configuration. One obvious example is, when I logout CDE and relogin, sometimes it will startup the default welcome screen with the Help and File folder on screen (sometime is sometime not), as if I am the first time login.
    Strange.

  • Java.rmi.server.hostname

    Hi,
    i am trying to figure out where this property comes into play. The docs say:
    "The value of this property represents the host name string that should be associated with remote stubs for locally created remote objects, in order to allow clients to invoke methods on the remote object. In 1.1.7 and later, the default value of this property is the IP address of the local host, in "dotted-quad" format."
    So i reverse engineered the stub to see if the value is inside the stub, but it isnt. I am asking because i want to run my RMI server program as a service and i dont want to define a static hostname property, because the server can be installed on several machines. Perhaps i can leave out this property completey and rely on defaults.
    So two questions remain to me:
    - Can i leave out this without getting into trouble?
    - Where is this propery used, obviously not in the stub.
    Thanks.
    marc

    Hi Marc,
    - Can i leave out this without getting into trouble?
    Possibly, see answer to your second question.
    - Where is this propery used, obviously not in the stub?
    The property is used primarily for one of two reasons, otherwise it is generally not necessary.
    1. If you have more than one network interface on a given machine, this property will specify which one to use.
    2. If you are behind a NAT router, this property will specify the actual address to use, outside the NAT subnet.
    Unspecified it will use the default network adapter address specified by your OS.
    Hope that was interesting :-)
    -John

  • Error in trying dynamic class loading in sun rmi tutorila

    Hi,
    I am trying the sun rmi tutorial http://java.sun.com/docs/books/tutorial/rmi/. I am not able to download the stub class from the codebase to client. The server is running in a linux box while the client in a w2k box.
    Linux box (server)
    ==================
    web server setting
    Alias /rmi_codebase /home/wing/try/java/rmi
    rmiregistry setting
    unset CLASSPATH
    rmiregistry
    rmi server
    classses
    /home/wing/try/java/rmi/client/ComputePi.class
    /home/wing/try/java/rmi/client/Pi.class
    /home/wing/try/java/rmi/compute/Compute.class
    /home/wing/try/java/rmi/compute/Task.class
    /home/wing/try/java/rmi/compute/ComputeEngine.class
    /home/wing/try/java/rmi/compute/ComputeEngine_Skel.class
    /home/wing/try/java/rmi/compute/ComputeEngine_Stub.class
    java.policy
    grant {
    permission java.security.AllPermission;
    startup with script as follows
    java -cp /home/wing/try/java/rmi -Djava.rmi.server.codebase=http://localhost/rmi_codebase/ -Djava.rmi.server.hostname=man82.air.com.hk -Djava.security.policy=/home/wing/try/java/rmi/java.policy
    engine.ComputeEngine
    (the server is started happyily)
    W2k box (client)
    ================
    class the same as server except removing the stub (ComputeEngine_Stub).
    java.policy
    grant {
    permission java.security.AllPermission;
    startup script
    java -Djava.rmi.server.codebase=http://man82/rmi_codebase/ -Djava.security.policy=java.policy clientComputePi man82 20
    The error encounter is
    ComputePi exception: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:83)
    at client.ComputePi.main(ComputePi.java:14)
    Caused by: java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    Is this problem related to codebase setting or security?
    BTW, I have tried to put the stub to the client as well, it works.
    Thanks in advance of any ideas or input.
    Wing

    Based on my previous post, I have performed some more testings of the tutorial code and find that the java.rmi.server.codebase could not be specified in the client side.
    Instead, the client follows the codebase set in the server, and thus, the localhost could not used in the server when the client is in separate machine.
    This is a bit different from the tutorial, please enlighten me if you have any comments.
    To make the dynamic download works,
    server side
    change the codebase property from http://localhost/rmi-codebase/ to http://man82/rmi_codebase/
    client side
    remove the codebase property http://man82/rmi_codebase/
    It is funny that if I add the codebase property when start up the client, it won't work.
    Thanks in advance for any ideas and input.
    Wing

  • "unknown user type" exception when the object don't exist for i/p key.

    Hi
    I'm using Coherence REST service(comes with the Coherence bundle) to validate my cache data.
    When I hit the cache for a valid key, I get data returned back. But for the object that don't exist in the cache I get "Internal Server" error.
    I'm fine with "Internal Server" response show in the browser, but I don't want it to be printed as part of my coherence logs.
    For example, when I hit the REST url for key that don't exist in the cache, I get below exception in coherence logs.
    How can I get rid off it (or) suppress the exception logs.
    Thanks for your time.
    (Wrapped) java.io.IOException: unknown user type: com.tangosol.coherence.rest.internal.Get
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:288)
         at com.tangosol.util.Base.ensureRuntimeException(Base.java:269)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher.packetizeMessage(PacketPublisher.CDB:23)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher$InQueue.add(PacketPublisher.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.dispatchMessage(Grid.CDB:62)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.post(Grid.CDB:31)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.send(Grid.CDB:1)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.poll(Grid.CDB:13)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.poll(Grid.CDB:11)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$BinaryMap.invoke(PartitionedCache.CDB:30)
         at com.tangosol.util.ConverterCollections$ConverterInvocableMap.invoke(ConverterCollections.java:2282)
         at com.tangosol.util.ConverterCollections$ConverterNamedCache.invoke(ConverterCollections.java:2748)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.invoke(PartitionedCache.CDB:11)
         at com.tangosol.coherence.component.util.SafeNamedCache.invoke(SafeNamedCache.CDB:1)
         at com.tangosol.coherence.rest.EntryResource.getValue(EntryResource.java:241)
         at com.tangosol.coherence.rest.EntryResource.get(EntryResource.java:85)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:616)
         at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
         at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
         at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
         at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
         at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
         at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
         at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
         at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
         at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
         at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
         at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
         at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
         at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
         at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
         at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
         at com.sun.jersey.server.impl.container.httpserver.HttpHandlerContainer.handle(HttpHandlerContainer.java:191)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:83)
         at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:86)
         at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:589)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:83)
         at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:561)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
         at java.lang.Thread.run(Thread.java:679)
    Caused by: java.io.IOException: unknown user type: com.tangosol.coherence.rest.internal.Get
         at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:351)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.writeObject(Service.CDB:1)
         at com.tangosol.coherence.component.net.Message.writeObject(Message.CDB:1)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeRequest.write(PartitionedCache.CDB:7)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.serializeMessage(Grid.CDB:14)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher.packetizeMessage(PacketPublisher.CDB:17)
         ... 42 more
    Caused by: java.lang.IllegalArgumentException: unknown user type: com.tangosol.coherence.rest.internal.Get
         at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:430)
         at com.tangosol.io.pof.ConfigurablePofContext.getUserTypeIdentifier(ConfigurablePofContext.java:419)
         at com.tangosol.io.pof.PofBufferWriter.writeUserType(PofBufferWriter.java:1671)
         at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1623)
         at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:345)
         ... 47 more

    Hi,
    I included coherence-rest-pof-config.xml as part of my pof-config as shown below.
    <pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
    xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
    <user-type-list>
    <include>coherence-pof-config.xml</include>
    <include>coherence-rest-pof-config.xml</include>
    <user-type>
    <type-id>1001</type-id>
    I also checked my coherence-rest.jar files for the configuration and the clasess, and all of them exist.
    I started my coherence by passing the classpath as below:
    $JAVAEXEC -server -Xms6g -Xmx6g -XX:+UseParNewGC -XX:MaxGCPauseMillis=50 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:CMSInitiatingOccupancyFraction=25 -XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70 -Duser.timezone=GMT -Djava.rmi.server.hostname=xx.xx.xx.xx -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=13366 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dtangosol.coherence.log.level=3 -Dtangosol.coherence.log=log4j -showversion $JAVA_OPTS -cp $COHERENCE_HOME/config/:$COHERENCE_HOME/lib/coherence.jar:$COHERENCE_HOME/lib/guidecacheclient.jar:$COHERENCE_HOME/lib/jersey-server-1.8.jar:$COHERENCE_HOME/lib/jersey-core-1.8.jar:$COHERENCE_HOME/lib/jersey-json-1.8.jar:$COHERENCE_HOME/lib/jackson-all-1.8.1.jar:$COHERENCE_HOME/lib/coherence-rest.jar:$COHERENCE_HOME/lib/log4j-1.2.16.jar -Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.localhost=xx.xx.xx.xx -Dtangosol.coherence.mode=eval com.tangosol.net.DefaultCacheServer $1
    While starting, I'm getting configuration missing exception as shown below. What am I still missing.
    Exception in thread "main" (Wrapped) (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") java.lang.IllegalStateException: Missing PofSerializer configuration (Config=pgs-pof-config.xml, Type-Id=801, Class-Name=com.tangosol.coherence.rest.internal.Get)
         at com.tangosol.coherence.component.util.Daemon.start(Daemon.CDB:52)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:7)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:6)
         at com.tangosol.coherence.component.util.SafeService.startService(SafeService.CDB:39)
         at com.tangosol.coherence.component.util.safeService.SafeCacheService.startService(SafeCacheService.CDB:5)
         at com.tangosol.coherence.component.util.SafeService.ensureRunningService(SafeService.CDB:27)
         at com.tangosol.coherence.component.util.SafeService.start(SafeService.CDB:14)
         at com.tangosol.net.DefaultConfigurableCacheFactory.ensureServiceInternal(DefaultConfigurableCacheFactory.java:1105)
         at com.tangosol.net.DefaultConfigurableCacheFactory.ensureService(DefaultConfigurableCacheFactory.java:937)
         at com.tangosol.net.DefaultCacheServer.startServices(DefaultCacheServer.java:81)
         at com.tangosol.net.DefaultCacheServer.intialStartServices(DefaultCacheServer.java:250)
         at com.tangosol.net.DefaultCacheServer.startAndMonitor(DefaultCacheServer.java:55)
         at com.tangosol.net.DefaultCacheServer.main(DefaultCacheServer.java:197)
    Caused by: (Wrapped: error creating class "com.tangosol.io.pof.ConfigurablePofContext") java.lang.IllegalStateException: Missing PofSerializer configuration (Config=pgs-pof-config.xml, Type-Id=801, Class-Name=com.tangosol.coherence.rest.internal.Get)
         at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:46)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.instantiateSerializer(Service.CDB:1)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:32)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.ensureSerializer(Service.CDB:4)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onEnter(Grid.CDB:25)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onEnter(PartitionedService.CDB:19)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:14)
         at java.lang.Thread.run(Thread.java:679)
    Caused by: java.lang.IllegalStateException: Missing PofSerializer configuration (Config=pgs-pof-config.xml, Type-Id=801, Class-Name=com.tangosol.coherence.rest.internal.Get)
         at com.tangosol.io.pof.ConfigurablePofContext.report(ConfigurablePofContext.java:1283)
         at com.tangosol.io.pof.ConfigurablePofContext.createPofConfig(ConfigurablePofContext.java:1013)
         at com.tangosol.io.pof.ConfigurablePofContext.initialize(ConfigurablePofContext.java:797)
         at com.tangosol.io.pof.ConfigurablePofContext.setContextClassLoader(ConfigurablePofContext.java:322)
         at com.tangosol.io.ConfigurableSerializerFactory.createSerializer(ConfigurableSerializerFactory.java:42)
         ... 7 more
    Thanks for your help.

  • Trouble with first RMI

    Hi,
    I just have written a simpliest RMI application with a help of a textbook.
    When I run both parts (server & client) on the same machine I get the expected output, but when I tried to run client on another machine - I got
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: SimpleRMIImpl_Stub (no security manager: RMI class loader disabled)
    I guess (no security manager: RMI class loader disabled) is the answer to my problem. But have no idea what with means and what should I do??
    C:\distr>java SimpleRMIClient my_other_machine
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: SimpleRMIImpl_Stub (no security manager: RMI class loader disabled)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Unknown Source)
    at SimpleRMIClient.main(SimpleRMIClient.java:13)
    Caused by: java.lang.ClassNotFoundException: SimpleRMIImpl_Stub (no security m
    ager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    ... 3 more
    C:\distr>

    Hello friend,
    I have the same problem have posted above, and I have try all them have showed but no way! so try my self.
    I will write in detail so you can understand our problem. but I am sorry, this is only for Windows
    This is may example from abook:
    Reverse.java file
    import java.rmi.*;
    import java.rmi.server.*;
    public class Reverse extends UnicastRemoteObject implements ReverseInterface
    public Reverse() throws RemoteException
    super();
    public String reverseString(String originalString) throws RemoteException
    int length = originalString.length();
    StringBuffer temp = new StringBuffer(length);
    for (int i = length ; i>0 ; i--)
    temp.append(originalString.substring(i-1,i));
    return temp.toString();
    public static void main(String[] args)
    if (System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    //String name = "//jamesh/com.wrox.rmi.Reverse";
    String name = "//localhost/Reverse";
    try
    Reverse r = new Reverse();
    Naming.rebind(name,r);
    System.out.println("Reverse object bound");
    catch (Exception e)
    System.out.println("Error while binding Reverse object");
    System.out.println(e.toString());
    and ReverseInterface.java file
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    public interface ReverseInterface extends Remote
    String reverseString(String originalString) throws RemoteException;
    and there is the client file for testing, Client.java
    import java.rmi.*;
    //import ReverseInterface;
    public class Client
    public static void main(String[] args)
    try
    //ReverseInterface ri = (ReverseInterface) Naming.lookup("//localhost:1099/Reverse");
    ReverseInterface ri = (ReverseInterface) Naming.lookup("//localhost:1099/Reverse");
    String result = ri.reverseString(args[0]);
    System.out.println("The reverse of " + args[0] + " is " + result);
    catch (Exception e)
    System.out.println("Error accessing remote object.");
    System.out.println(e.toString());
    this is .java.police file
    /* AUTOMATICALLY GENERATED ON Tue Jan 13 12:55:40 GMT+07:00 2004*/
    /* DO NOT EDIT */
    grant codeBase "file:${java.home}/lib/ext/*" {
    permission java.security.AllPermission;
    grant {
    permission java.lang.RuntimePermission "stopThread";
    permission java.net.SocketPermission "localhost:1024-", "listen";
    permission java.util.PropertyPermission "java.version", "read";
    permission java.util.PropertyPermission "java.vendor", "read";
    permission java.util.PropertyPermission "java.vendor.url", "read";
    permission java.util.PropertyPermission "java.class.version", "read";
    permission java.util.PropertyPermission "os.name", "read";
    permission java.util.PropertyPermission "os.version", "read";
    permission java.util.PropertyPermission "os.arch", "read";
    permission java.util.PropertyPermission "file.separator", "read";
    permission java.util.PropertyPermission "path.separator", "read";
    permission java.util.PropertyPermission "line.separator", "read";
    permission java.util.PropertyPermission "java.specification.version", "read";
    permission java.util.PropertyPermission "java.specification.vendor", "read";
    permission java.util.PropertyPermission "java.specification.name", "read";
    permission java.util.PropertyPermission "java.vm.specification.version", "read";
    permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
    permission java.util.PropertyPermission "java.vm.specification.name", "read";
    permission java.util.PropertyPermission "java.vm.version", "read";
    permission java.util.PropertyPermission "java.vm.vendor", "read";
    permission java.util.PropertyPermission "java.vm.name", "read";
    permission java.net.SocketPermission "*:1024-65535", "connect,accept";
    permission java.net.SocketPermission "*:80", "connect";
    grant {
    permission java.security.AllPermission;
    =======================end of code==============
    then there is the guide for building this example
    I save my example in:
    ReverseInterface.java file and Reverse.java
    c:\rmiexample
    client.java in c:\rmiexample\test and the policy in c:\rmiexample\policy
    1/Compile all class
    javac *.java
    2/ generate Stub and skeleton
    rmi Reverse
    3/ start RMI registry
    start rmiregistry
    4/execute remode object
    java -classpath c:\rmiexample\ -Djava.rmi.server.codebase=file:/C:\rmiExample\ -Djava.rmi.server.hostname=localhost -Djava.security.manager -Djava.security.policy=file:/C:\rmiExample\policy\.java.policy Reverse
    Reverse object bound
    5/ Run client
    java -classpath c:\rmiexample\test\ Client 123456789
    The reverse of 123456789 is 987654321
    If you system is config well you run it without any problem but, my computer have many problem with JVM, so I have to work very hard to pass this example ;-)
    The first problem is that:
    C:\rmiExample>java -classpath c:\rmiexample\test\ Client qerrewrw
    Error accessing remote object.
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: Reverse_Stub (no security manager: RMI class loader disabled)
    the second error when i change, policy folowing the guide in the book,
    C:\rmiExample>java -classpath c:\rmiexample\test\ Client qerrewrw
    Error accessing remote object.
    java.rmi.UnmarshalException: error unmarshalling return; nested exception
    java.lang.ClassNotFoundException: access to class loader denied
    as you see, I went to java.sun.com, I hope in there will help me pass my problem, but there are many guide, but you know , no thing fix with me... any way thank you very much, about the time you spend on writing the guide
    and there is the last I do myself, chand policy to
    grant {
    permission java.security.AllPermission;
    C:\rmiExample>java -classpath c:\rmiexample\test\ Client 123456789
    The reverse of 123456789 is 987654321
    of course , this is not the good solution, but I just want to show that to make it runfirst and will fine tune later.
    I hope you run all easily...
    vnnWeb.

  • Help me. I am Beginner to RMI.

    code on the server side:
    rebind("rmi://192.168.41.30:1051/toaster",p1);
    run it with:
    rmirigistry &
    java -Djava.rmi.server.hostname=192.168.41.30 ProductServer
    then the error arised as follows:
    java.rmi.ConnectException: Connection refused to host: 61.135.131.108; nested exception is:
    java.net.ConnectException: Connection timed out
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
    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.list(Unknown Source)
    at java.rmi.Naming.list(Naming.java:188)
    at TestB.main(TestB.java:9)
    Caused by: java.net.ConnectException: Connection timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
    at java.net.Socket.connect(Socket.java:425)
    at java.net.Socket.connect(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:290)
    at java.net.Socket.<init>(Socket.java:118)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:122)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
    ... 6 more
    does it related with policy???
    and how to configure policy???
    i am grateful for your help...

    u r right.
    java.rmi.registry.LocateRegistry.createRegistry(1999);
    System.setProperty("javax.net.ssl.debug","all");
    System.out.println("Constructing server implementation...");
    ProductImpl prod1=new ProductImpl("Black Toaster");
    ProductImpl prod2=new ProductImpl("Microwave Oven");
    System.out.println("Binding server implementations to rmiregistry...");
    Naming.rebind("rmi://192.168.41.30:1999/toaster",prod1);
    //Naming.rebind("toaster",prod1);
    //Naming.rebind("microwave",prod2);
    Naming.rebind("rmi://192.168.41.30:1999/microwave",prod2);
    System.out.println("Waiting for invocations from clients...");
    this is right..
    done well after specifying a port number and ipaddress.

  • RMI Client Code Issue

    Hello,
    Here is my client side RMI program:
    import java.rmi.*;
    public class MyRemoteClient {
    public static void main(String args[]) {
    MyRemoteClient mm = new MyRemoteClient();
    mm.go();
    public void go(){
    try{
    MyRemote service2 = (MyRemote) Naming.lookup("rmi://xxx.xxx.xx.xx/Hello");
    String s = service2.sayHello();
    System.out.println(s);
    } catch(Exception ex){ex.printStackTrace();}
    }Having started RMI Registry and Service Implementor code on the server, if I try to run the above code on the client it fire the following error:
    java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
    java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at MyRemoteImpl_Stub.sayHello(Unknown Source)
    at MyRemoteClient.go(MyRemoteClient.java:11)
    at MyRemoteClient.main(MyRemoteClient.java:6)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
    ... 7 more
    I am wondering as to why is it trying to connect to a local host 127.0.1.1 instead of the IP Address specified at by"xxx.xx.xx.xx" in the program?
    I have the stub class and the service interface classes on my client-side.
    Thanks.

    I am wondering as to why is it trying to connect to a
    local host 127.0.1.1 instead of the IP Address
    specified at by"xxx.xx.xx.xx" in the program?Because that only specifies where the lookup should be done, i.e. where the Registry is. This lookup() returns a stub to your remote object which has its own IP address and port embedded into it, and that's where 127.0.0.1 is coming from - you're not doing Registry.lookup at this point, you're calling your remote method.
    This indicates a DNS or /etc/hosts misconfiguration - your primary IP address is coming up as 127.0.0.1 instead of whatever your public IP address is. Famous Linux issue. You should really fix it in your DNS or /etc/hosts, but you can work around it by setting -Djava.rmi.server.hostname=<public IP address> at the server JVM.

Maybe you are looking for