Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
- Cannot connect to a RMI server (RMI) from J

- Cannot connect to a RMI server (RMI) from J

2007-08-10       - By analorite

 Back
Hi everyone. I hope I am in the right forum.

I have problems to access to a remote RMI server from JBoss. I mean JBoss is
the client.

My application run under Unix. My JBoss version is 4.0.2.

Following i describe my scenario:

- The Server: a pure java RMI server:

step 1) i start the RMI Registry:
agilent:/> rmiregistry -J-Djava.class.path=. &

step 2) i run the java rmi server.
agilent:/> java HelloServer
Hello Server is going to be already....
Hello Server already!

 My server code is the following:
 HelloImpl obj = new HelloImpl();
       System.setProperty("java.security.policy", "java.policy");
       System.setSecurityManager(new RMISecurityManager());    
       System.out.println("Hello Server is going to be already....");
       Naming.rebind("HelloServer", obj);
       System.out.println("Hello Server already!");
                           
- The Client: A class within JBoss. My client code is the following:

String server = "rmi://10.95.18.121:1099/HelloServer";
           
try {          
   if (System.getSecurityManager()== null){
        log.debug("GestorColeta::executeRemote ==> Crear RMISecurityManager");
        System.setSecurityManager(new RMISecurityManager());
   }else log.debug("GestorColeta::executeRemote ==> Ya existe
RMISecurityManager");      
     
   Registry registry = LocateRegistry.getRegistry("10.95.18.121");
                     
   if (registry != null){
         String[] entries = registry.list();
             
         if (entries != null){
                  for (int x = 0; x < entries.length; x++){
                      log.debug("GestorColeta::executeRemote ==> Vinculos
disponibles[" + x + "]:" + entries[x] );
                  }
               }else log.debug("GestorColeta::executeRemote ==> Fallo al
obtener v??nculos disponibles");
            } else log.debug("GestorColeta::executeRemote ==> Fallo al obtener
el registro");                                                                
           
            /*Properties prop = new Properties();
            prop.put("java.naming.factory.initial","org.jnp.interfaces
.NamingContextFactory");
            prop.put("java.naming.provider.url","rmi://10.95.18.121:1099");
            prop.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp
.interfaces");
           
            Context c = new InitialContext(prop);*/

            log.debug("GestorColeta::executeRemote ==> Naming lookup...");
            //Hello gestor = (Hello) c.lookup("HelloServer");    
            Hello gestor = (Hello) registry.lookup(server);
            log.debug("GestorColeta::executeRemote ==> Naming lookup... OK!!");

   And i obtain the next:

12:52:42,472 DEBUG [uploadmanager] GestorColeta::executeRemote ==> Ya existe
RMISecurityManager
12:52:42,488 DEBUG [uploadmanager] GestorColeta::executeRemote ==> Vinculos
disponibles[0]:HelloServer
12:52:42,488 DEBUG [uploadmanager] GestorColeta::executeRemote ==> Naming
lookup...
12:52:42,511 ERROR [uploadmanager] GestorColeta::GestorColeta: ==> rmi://10.95
.18.121:1099/HelloServer
12:52:42,511 ERROR [uploadmanager] GestorColeta::GestorColeta: ==> java.rmi
.NotBoundException

   As you can see, i get the entries list from the registry... but i cannot
lookup the HelloServer service. :-(

   I tried to run the commented code: Hello gestor = (Hello) c.lookup(
"HelloServer"); but i had no good news:

13:56:16,949 DEBUG [uploadmanager] GestorColeta::executeRemote ==> Ya existe
RMISecurityManager
13:56:16,967 DEBUG [uploadmanager] GestorColeta::executeRemote ==> Vinculos
disponibles[0]:HelloServer
13:56:16,968 DEBUG [uploadmanager] GestorColeta::executeRemote ==> Naming
lookup...
13:56:21,983 ERROR [uploadmanager] GestorColeta::GestorColeta: ==> Receive
timed out
13:56:21,984 ERROR [uploadmanager] GestorColeta::GestorColeta: ==>  javax
.naming.CommunicationException
13:56:21,985 ERROR [uploadmanager] GestorColeta::GestorColeta: ==>  java.net
.SocketTimeoutException: Receive timed out

   I changed the rmi.codebase.server in my JBoss run.sh: -Drmi.codebase.server
.... (by default is http://10.95.18.121:8083/ ) but if i change this property
all my EJBeans and Servlets fail

    Reading the forums i could obtain the list of the rmi services on the
server... And i knew that JBoss use JNDI instead RMI so I tried jnp:// instead
of rmi://. Nothing.

This topic is very interesting http://www.jboss.org/index.html?module=bb&op
=viewtopic&t=56265

anonymous wrote : Oh, your using the rmi registry Naming.list, not the jndi
Context.list as I thought. JBoss does not implement an rmi registry. Use jndi.

so:  how can I use JNDI to connect to a RMI server?

   I am literally desesperated. Can anyone give me a ray of light? It will be
really appreciated. :)

   Thanks in advance.
 
   Ana.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4072999#4072999

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4072999

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.