Hi all.... i have tried this simple client by using this code:

package pub;
  | 
  | import javax.jms.TopicConnectionFactory;
  | import javax.jms.TopicSession;
  | import javax.jms.Topic;
  | import javax.naming.InitialContext;
  | import javax.naming.Context;
  | import javax.jms.TopicConnection;
  | import javax.jms.ObjectMessage;
  | import javax.naming.NamingException;
  | import javax.jms.JMSException;
  | import javax.jms.TopicPublisher;
  | 
  | import java.util.Hashtable;
  | import java.io.Serializable;
  | 
  | public class Publisher {
  | 
  |     private static final String MODULE = Publisher.class.getName();
  |     //private static final Logger log = Logger.getLogger(MODULE);
  |     public Publisher() {
  |     }
  | 
  |     public void createAndSendMsg(String ibName) {
  | 
  |         try {
  |             Serializable obj = new Msg("Angelo Immediata");
  |             Context cont = getContext();
  |             System.out.println( "Cerco connection factory" );
  |             //TopicConnectionFactory factory = (TopicConnectionFactory) 
(cont.lookup("java:comp/env/jms/ConnectionFactory"));
  |             
  |             TopicConnectionFactory factory = (TopicConnectionFactory) 
(cont.lookup("java:ConnectionFactory"));
  |             System.out.println( "Ok" );
  |             Topic coda = (Topic) cont.lookup("topic/angeloRemoteTopic");
  |             System.out.println( "Ok anche la topic" );
  |             TopicConnection connessione = factory.createTopicConnection();
  |             TopicSession sessione = connessione.createTopicSession(true,
  |                     TopicSession.AUTO_ACKNOWLEDGE);
  |             TopicPublisher sender = sessione.createPublisher(coda);
  |             ObjectMessage msg = sessione.createObjectMessage();
  |             msg.setObject(obj);
  |             sender.publish(coda, msg);
  |             sessione.commit();
  |             sessione.close();
  |             connessione.close();
  |         } catch (NamingException ex) {
  | 
  |             ex.printStackTrace();
  |         } catch (JMSException ex) {
  | 
  |             ex.printStackTrace();
  |         }
  |     }
  | 
  |     private InitialContext getContext() throws NamingException {
  | 
  |         Hashtable props = new Hashtable();
  |         props.put(InitialContext.INITIAL_CONTEXT_FACTORY,
  |                   "org.jnp.interfaces.NamingContextFactory");
  |         props.put(InitialContext.PROVIDER_URL, "jnp://192.168.11.224:1099");
  |         System.out.println( "Coleghiamoci ok "+ props );
  | 
  |         return new InitialContext(props);
  |     }
  | }

well when i try this client i have this error:

anonymous wrote : Coleghiamoci ok 
{java.naming.provider.url=jnp://192.168.11.224:1099, 
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory}
  | Cerco connection factory
  | javax.naming.CommunicationException [Root exception is 
java.rmi.NoSuchObjectException: no such object in table]
  |     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:649)
  |     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
  |     at javax.naming.InitialContext.lookup(InitialContext.java:347)
  |     at pub.Publisher.createAndSendMsg(Publisher.java:35)
  |     at mai.Main.main(Main.java:7)
  | Caused by: java.rmi.NoSuchObjectException: no such object in table
  |     at 
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
  |     at 
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
  |     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
  |     at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
  |     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)
  |     ... 4 more

I really don't understand where i'm wrong...... the only thing i have done is a 
change of IP address.... from 192.168.11.xxx to 192.168.11.yyy; if my Remote 
JMS provider was 192.168.11.xxx i have no problem.... if 192.168.11.yyy i have 
the problem i have talked about.... how is it possible?

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

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


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to