Was sollte ich tun, um eine Verbindung zum remote-jms-queue?
Habe ich arbeiten JBoss AS 7 (7.1.1 final) server auf localhost mit einige Warteschlange.
Und ich will zu verbinden, dass die Warteschlange in einer desktop-Anwendung.
Also schrieb ich etwas wie:
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
InitialContext initialContext = new InitialContext(env);
ConnectionFactory connectionFactory = (ConnectionFactory)
initialContext.lookup("RemoteConnectionFactory"); //<- there is it fail
Aber es ergibt sich in diesem Ausnahme:
Exception in thread "main" javax.die Benennung.CommunicationException: Könnte
nicht erhalten, Verbindung zu einer der folgenden urls: remote://localhost:4447
und-Ermittlung ist fehlgeschlagen mit dem Fehler: javax.die Benennung.CommunicationException:
Erhalten timed out [Root exception is java.net.SocketTimeoutException:
Erhalten timed out] [Root exception
javax.die Benennung.CommunicationException: Fehler beim verbinden mit server
remote:1099 [Root exception
javax.die Benennung.ServiceUnavailableException: Failed to connect to server
remote:1099 [Root exception is java.net.UnknownHostException:
remote -]]]
Natürlich habe ich jbosscall-client.jar in der Klasse Weg.
InformationsquelleAutor Hlib | 2012-11-04
Du musst angemeldet sein, um einen Kommentar abzugeben.
Müssen Sie ersetzen die
remote
imPROVIDER_URL
mitjnp
etwas ähnliches wieändern Sie Ihren provider url " env.put(Context.PROVIDER_URL, "none://localhost:4447");
änderung none://localhost:4447. noch bekommen: Exception in thread "main" javax.die Benennung.CommunicationException: Konnte keine Verbindung zu einer der folgenden urls: 127.0.0.1:4447 und-Ermittlung ist fehlgeschlagen mit dem Fehler: javax.die Benennung.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.die Benennung.CommunicationException: Fehler beim abrufen der stub vom server 127.0.0.1:4447 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000C]]
AS7 nicht verwenden, NONE, die akzeptierte Antwort ist richtig
InformationsquelleAutor Sajan Chandran
Dieser code workl gut, wenn 'Anwender' für jboss Hinzugefügt wurden.
InformationsquelleAutor Hlib