Jms

  • Автор темы Alex_Sun
  • Дата начала
A

Alex_Sun

Вот простой скрипт, отправляющий одно сообщение

[codebox] try {
com.sun.messaging.ConnectionFactory myConnFactory = new com.sun.messaging.ConnectionFactory();
myConnFactory.setProperty(ConnectionConfiguration.imqAddressList, "192.9.200.54:7676,broker2:5000,broker3:9999");
Connection myConn = myConnFactory.createConnection();
Session mySess = myConn.createSession(false, Session.CLIENT_ACKNOWLEDGE);

Queue myQueue = new com.sun.messaging.Queue("q");
MessageProducer myMsgProducer = mySess.createProducer(myQueue);

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter message: ");
String str = in.readLine();

TextMessage myTextMsg = mySess.createTextMessage();
myTextMsg.setText( str );
System.out.println("Sending Message: " + myTextMsg.getText());
myMsgProducer.send(myTextMsg);

mySess.close();
myConn.close();
} catch (Exception jmse) {
System.out.println("Exception occurred : " + jmse.toString());
jmse.printStackTrace();
}[/codebox]

Всё работает когда брокер на локалхосте, но когда он на другой машине начинаются проблемы, причём только если это "desktop application".
Консольное приложение отрабатывает без проблем, а Desktop Application возвращает ошибку при попытки создания конекции(Connection myConn = myConnFactory.createConnection())

Exception occurred : com.sun.messaging.jmq.jmsclient.ConnectException: [C4003]: Error occurred on connection creation [192.9.200.54:7676,broker2:5000,broker3:9999].

Может на десктопное приложение действуют какие-то политики безопасности?
 

Kmet

Well-known member
25.05.2006
904
8
BIT
0
Exception occurred : com.sun.messaging.jmq.jmsclient.ConnectException: [C4003]: Error occurred on connection creation [192.9.200.54:7676,broker2:5000,broker3:9999].
стэктрейс в студию

com.sun.messaging.ConnectionFactory myConnFactory = new com.sun.messaging.ConnectionFactory();
вы уверены, что в используемой вами реализации JMS именно так надо созадвать фабрику?
 
A

Alex_Sun

Реализации JMS - Sun Java SystemMessageQueue 4.3

[codebox]10.04.2009 11:10:02 com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
WARNING: [C4003]: Error occurred on connection creation [192.9.200.54:7676]. - cause: java.net.SocketException: Malformed reply from SOCKS server
10.04.2009 11:15:07 com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
WARNING: [C4003]: Error occurred on connection creation [broker2:5000]. - cause: java.net.SocketException: Malformed reply from SOCKS server
10.04.2009 11:20:12 com.sun.messaging.jmq.jmsclient.ExceptionHandler throwConnectionException
WARNING: [C4003]: Error occurred on connection creation [broker3:9999]. - cause: java.net.SocketException: Malformed reply from SOCKS server
com.sun.messaging.jmq.jmsclient.ConnectException: [C4003]: Error occurred on connection creation [192.9.200.54:7676,broker2:5000,broker3:9999].
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew(Connecti
onInitiator.java:309)
Exception occurred : com.sun.messaging.jmq.jmsclient.ConnectException: [C4003]: Error occurred on connection creation [192.9.200.54:7676,broker2:5000,broker3:9999].
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:208)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:158)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:807)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.java:1509)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.jav
a:2280)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:1012)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:414)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:60)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:147)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:132)
at desktopapplication1.DesktopApplication1View.jms(DesktopApplication1View.java:251
)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAct
ion.java:662)
at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.jav
a:698)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.jav
a:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273
)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

###### Connect exception for : mq://192.9.200.54:7676/jms
com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [192.9.200.54:7676]. - cause: java.net.SocketException: Malformed reply from SOCKS server
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.throwConnectionException(Except
ionHandler.java:274)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException(Exceptio
nHandler.java:220)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClien
t.java:234)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:148)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClient.java:90)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init>(TCPConnectionHandler.java:130)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConnection(TCP
StreamHandler.java:135)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:778)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew(Connecti
onInitiator.java:254)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:208)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:158)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:807)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.java:1509)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.jav
a:2280)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:1012)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:414)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:60)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:147)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:132)
at desktopapplication1.DesktopApplication1View.jms(DesktopApplication1View.java:251
)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAct
ion.java:662)
at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.jav
a:698)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.jav
a:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273
)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.net.SocketException: Malformed reply from SOCKS server
at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClien
t.java:214)
... 49 more

###### Connect exception for : mq://broker2:5000/jms
com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [broker2:5000]. - cause: java.net.SocketException: Malformed reply from SOCKS server
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.throwConnectionException(Except
ionHandler.java:274)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException(Exceptio
nHandler.java:220)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClien
t.java:234)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:148)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClient.java:90)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init>(TCPConnectionHandler.java:130)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConnection(TCP
StreamHandler.java:135)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:778)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew(Connecti
onInitiator.java:254)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:208)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:158)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:807)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.java:1509)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.jav
a:2280)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:1012)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:414)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:60)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:147)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:132)
at desktopapplication1.DesktopApplication1View.jms(DesktopApplication1View.java:251
)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAct
ion.java:662)
at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.jav
a:698)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.jav
a:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273
)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.net.SocketException: Malformed reply from SOCKS server
at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClien
t.java:214)
... 49 more

###### Connect exception for : mq://broker3:9999/jms
com.sun.messaging.jms.JMSException: [C4003]: Error occurred on connection creation [broker3:9999]. - cause: java.net.SocketException: Malformed reply from SOCKS server
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.throwConnectionException(Except
ionHandler.java:274)
at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException(Exceptio
nHandler.java:220)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClien
t.java:234)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.java:148)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClient.java:90)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init>(TCPConnectionHandler.java:130)
at com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConnection(TCP
StreamHandler.java:135)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:778)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew(Connecti
onInitiator.java:254)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:208)
at com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(ConnectionI
nitiator.java:158)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.java:807)
at com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.java:1509)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.jav
a:2280)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:1012)
at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:414)
at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:60)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:147)
at com.sun.messaging.BasicConnectionFactory.createConnection(BasicConnectionFactory
.java:132)
at desktopapplication1.DesktopApplication1View.jms(DesktopApplication1View.java:251
)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAct
ion.java:662)
at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.jav
a:698)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.jav
a:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273
)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.net.SocketException: Malformed reply from SOCKS server
at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:87)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:429)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at java.net.Socket.<init>(Socket.java:366)
at java.net.Socket.<init>(Socket.java:180)
at com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMapperClien
t.java:214)
... 49 more[/codebox]
Вот ещё пробовал вот так
[codebox] Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
env.put(Context.PROVIDER_URL, "file:///H:/fi");
InitialContext ctx = new InitialContext(env);
javax.jms.ConnectionFactory myConnFactory = (javax.jms.ConnectionFactory) ctx.lookup("cf_sol");

Connection myConn = (Connection) myConnFactory.createConnection();[/codebox]
Эффект тот же, но а это уж вырезка из родных примеров.
На консольном приложении всё работает, на десктопном нет(если конектица не к локалхосту).
Ну явно тут из сооброжений безопасности не пускают за пределы локалхоста, вопрос только в том, как это обойти. Может как-то подписать надо(по аналогии с апплетами)?

Всё происходит на винде, ещё пробовал на солярисе, там всё работает.
 

Kmet

Well-known member
25.05.2006
904
8
BIT
0
На консольном приложении всё работает, на десктопном нет(если конектица не к локалхосту).
Ну явно тут из сооброжений безопасности не пускают за пределы локалхоста, вопрос только в том, как это обойти. Может как-то подписать надо(по аналогии с апплетами)?
консольное в смысле запускаемое через java.exe, а десктопное через javaw.exe? Если да, то очень похоже что файрвол режет.
или еще какие отличия?

в броузере прокси прописан?

откройте Java Control Panel/Network Settings уставите Direct Connect
 
A

Alex_Sun

Консольное - это просто класс с с методом main, запускаемый как обычно при помощи Java.exe.
десктопное - это с использованием пакета org.jdesktop.application, в нетбинсе это New project > Java > Java Desctop Application. Запускается оно также с помощью Java.exe, требует appframework-1.0.3.jar, также юзаю классы пакета javax.swing(swing-worker-1.1.jar).

Щас пробую настроить политики(policytool.exe), пока чёт не помогло.

Прокси используется, установил Direct Connect, не помогло.
Соответствинно файрвол тоже не причём т.к. для него и то и другое просто Java.exe.
Да и не стои он.


Вот ОнО!!!
Цитата взятая вот отсюда

Убрал из настроек IE прокси, и все заработало. Оказалось, не я один мучился.
Почему выставленное DirectConnection игнорировалось, да и вариант без GUI работал - не знаю.
Всем спасибо, вопрос закрыт.

Баг походу...
Проблема решена, всем спасиба.
 

Kmet

Well-known member
25.05.2006
904
8
BIT
0
just for notice
Запускается оно также с помощью Java.exe,
как определяли? в ява нет деления на консольные и десктопные приложения.
просто к приложениям которые запускаются через java.exe, приатачивается консоль.
 
A

Alex_Sun

как определяли?
Ну во первых я сам его запускаю java.exe -jar ... , во вторых в процессах он видется как java.exe.
А десктоное приложение(Java Desctop Application) это термин просто взят из нетбинся и означает он приложение с использованием пакета org.jdesktop.application. И как я писал вышо, по каким-то, непонятным мне причинам, в вслучае использования org.jdesktop.application игнарируются настройки самой джава машины и берутся настройки прокси из эксплорера, и замачено это не только мной(смотрите ссылку).
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!