Bugs item #803797, was opened at 2003-09-10 17:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=803797&group_id=22866

Category: JBossMX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Marek Lange (mlange99)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bug in RMIConnectorImpl.start()?

Initial Comment:
I am trying talk to a remote MBean server. I am using 

the RMIConnector implementation. This is working when I 

deploy my app in 3.0. However, when I try to talk to a 

remote mbean server using 3.2 I get 

a "NameNotFoundException". I tracked down the problem 

to the RMIConnectorImpl class in 

org.jboss.jmx.connector.rmi.



The exception occurs in "start()". From the log output I 

discovered that the naming.provider.url is missing in the 

jndi environment:



[RMIConnectorImpl] Using Naming Context: 

[EMAIL PROTECTED], environment: 

{java.naming.factory.initial=org.jnp.interfaces.NamingCon

textFactory, 

java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.int

erfaces}



As I understand, the default url is set to localhost and 

this fails understandably.



This does not happen in 3.0 where I can see the correct 

url:



[STDOUT] RMIClientConnectorImp.start(), got Naming 

Context: [EMAIL PROTECTED], 

environment: 

{java.naming.provider.url=192.168.1.15:1099, 

java.naming.factory.initial=org.jnp.interfaces.NamingCont

extFactory, java.na

ming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

:org.jboss.naming:org.jnp.interfaces}, name in 

namespace:



There are differences in the "start()" implementation of 

RMIConnectorImpl. I am not sure if there is an error.



3.0:

public void start(Object pServer) throws 

IllegalArgumentException 

 {

      if( pServer == null ) 

      {

         throw new IllegalArgumentException( "Server 

cannot be null. "

            + "To close the connection use stop()" );

      }

      try 

      {

         InitialContext lNamingContext = new InitialContext

();

         System.out.println( "RMIClientConnectorImp.start

(), got Naming Context: " +   lNamingContext +

            ", environment: " + 

lNamingContext.getEnvironment() +

            ", name in namespace: " + 

lNamingContext.getNameInNamespace()

         );

         // This has to be adjusted later on to reflect the 

given parameter

         mRemoteAdaptor = (RMIAdaptor) new 

InitialContext().lookup( "jmx:" + pServer + ":rmi" );

         System.err.println( "RMIClientConnectorImpl.start

(), got remote connector: " + mRemoteAdaptor );

         mServer = pServer;

      }

      catch( Exception e ) 

      {

         e.printStackTrace();

      }

   }



3.2:

public void start(Object pServer) throws Exception

{

      log.debug( "Starting");

      

      if( pServer == null ) 

      {

         throw new IllegalArgumentException( "Server 

cannot be null. "

            + "To close the connection use stop()" );

      }



      InitialContext ctx = new InitialContext();

      

      try 

      {   

         log.debug("Using Naming Context: " + ctx +

                   ", environment: " + ctx.getEnvironment() +

                   ", name in namespace: " + 

ctx.getNameInNamespace());

         

         // This has to be adjusted later on to reflect the 

given parameter

         mRemoteAdaptor = (RMIAdaptor)ctx.lookup

( "jmx:" + pServer + ":rmi" );

         log.error( "Using remote adaptor: " + 

mRemoteAdaptor );

         mServer = pServer;



         ctx.close();

      }

      finally 

      {

         ctx.close();

      }

   }



Perhaps there is a problem here or somewhere before.



Thanks,



-marek

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=803797&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to