I am trying to connect to glassfish server but everytime I run the pre written program I get this error. I have followed installation of netbeans and glassfish 3 correctly and have set up the server so I'm out of ideas. The error is below. Thanks a lot!
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
Can't join the chat roomjava.net.ConnectException: Connection refused: connect
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:241)
at guiclient.ChatRoom.<init>(ChatRoom.java:30)
at guiclient.GuiChatClientMain.main(GuiChatClientMain.java:17)
It may be the problem that your connection port is occupied. try to change the connection port number and connect again. find th Domain.xml file in the directory \glassfish-3.0\glassfish\domains\domain1\config and change the port no 8080 to any other like 9999 in following line -
<network-listener name="http-listener-1" port="8080" thread-pool="http-thread-pool" transport="tcp" protocol="http-listener-1"/>
close the file and restart the glassfish server and re run your program.
Related
I have installed xamarin in VS2015 and VS2017 both.I am facing some package issues in VS2015 and in VS2017 I am getting renderer problem.
In VS2017, I am facing problems while viewing activity_main.xml file as
Connection to layout renderer failed. This may be caused due to misconfiguration of java.
Details are as follow:
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at mono.android.HostProcessConnection.Connect(HostProcessConnection.java:23)
at mono.android.AndroidDesignerHost.run(AndroidDesignerHost.java:58)
at mono.android.AndroidDesignerHost.main(AndroidDesignerHost.java:47)
Please see the image below:
This is not misconfigured java, but networking problem[s].
Search after "java.net.ConnectException: Connection timed out: connect" shows some relevant SO answers:
Why would a "java.net.ConnectException: Connection timed out" exception occur when URL is up?
Set your timeout to some higher value
I am trying to enable distributed caching on ehcache for one of my projects between 2 nodes but I am running into issues.
I am using ehcache core 2.6.11 in a Java Spring project
Here are relevant portions of my ehcache config on each of the servers
Node 1
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="
peerDiscovery=manual,
rmiUrls=//node2.mydomain.com:40002/myCache1|//node2.mydomain.com:40002/myCache2"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=40001"/>
Node 2
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="
peerDiscovery=manual,
rmiUrls=//node1.mydomain.com:40001/myCache1|//node1.mydomain.com:40001/myCache2"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=40002"/>
When I update my cache and expect it to be replicated - here are the errors I get on my nodes
Node 1
03.03.2016 06:44:50 DEBUG [net.sf.ehcache.distribution.RMICacheManagerPeerProvider.lookupRemoteCachePeer():126] Lookup URL //node2.mydomain.com:40002/myCache1
03.03.2016 06:44:50 WARN [net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.writeReplicationQueue():325] Unable to send message to remote peer. Message was: Connection refused to host: <node 2 IP Address>; nested exception is:
java.net.ConnectException: Connection refused
java.rmi.ConnectException: Connection refused to host: <node 2 IP Address>; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130)
at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.writeReplicationQueue(RMIAsynchronousCacheReplicator.java:314)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.replicationThreadMain(RMIAsynchronousCacheReplicator.java:127)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.access$000(RMIAsynchronousCacheReplicator.java:58)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator$ReplicationThread.run(RMIAsynchronousCacheReplicator.java:389)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at net.sf.ehcache.distribution.ConfigurableRMIClientSocketFactory.createSocket(ConfigurableRMIClientSocketFactory.java:70)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 8 more
Node 2
03.03.2016 06:44:50 DEBUG [net.sf.ehcache.distribution.RMICacheManagerPeerProvider.lookupRemoteCachePeer():126] Lookup URL //node1.mydomain.com:40001/myCache1
03.03.2016 06:44:50 WARN [net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.writeReplicationQueue():325] Unable to send message to remote peer. Message was: Connection refused to host: <node 2 IP Address>; nested exception is:
java.net.ConnectException: Connection refused
java.rmi.ConnectException: Connection refused to host: <node 2 IP Address>; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130)
at net.sf.ehcache.distribution.RMICachePeer_Stub.send(Unknown Source)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.writeReplicationQueue(RMIAsynchronousCacheReplicator.java:314)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.replicationThreadMain(RMIAsynchronousCacheReplicator.java:127)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator.access$000(RMIAsynchronousCacheReplicator.java:58)
at net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator$ReplicationThread.run(RMIAsynchronousCacheReplicator.java:389)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at net.sf.ehcache.distribution.ConfigurableRMIClientSocketFactory.createSocket(ConfigurableRMIClientSocketFactory.java:70)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 8 more
UPDATE
I have changed my configuration now to use Automatic Discovery instead of Manual.
I have 4 servers, 2 in Site A and 2 in Site B.
The replicated is now working as expected on Site A between both nodes but no replication is occuring on Site B or between Site A and Site B.
I used netcat and telnet between each node and the other nodes and all connections were accepted.
Here are the relevant sections of my ehcache config for the automatic discovery
<cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
properties="peerDiscovery=automatic,
multicastGroupAddress=230.3.0.0,
multicastGroupPort=4700,
timeToLive=255"/>
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="port=43000,
socketTimeoutMillis=20000"/>
Could anyone offer any insight into how the replication is not working on Site B or any ideas I could try?
Thanks
Please check the below steps to fix this issue
Add the host name in the Listener as below.
<cacheManagerPeerListenerFactory
class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
properties="hostName=localhost,port=40001"/>
Check the port 40002 is open for access, so that It can be accessed from node1. Means node2.mydomain.com:40002 should be accessible from node1. From console, you can use telnet program to check it. Similarly, check if node1 is accessible from node2. (I believe this is what causing the issue)
Optional: You don't need to have different ports in the two servers. It can have the same port number 40001.
I reverted back to the manual discovery approach as we received advice from a Networking specialist that using Multicast accross data centers opens up a whole world of pain.
Using the manual approach with Thanga's suggestions has worked
I am running activemq-5.9 on Ubuntu 12.04 and it would be fair to say that I am new to active MQ.
I suspect that I am queueing records and not de-queueing them, so I am looking into using JMX to connect to my active MQ broker and see what's going on. Jconsole fails.
This is hard because most of the docs on how to do this is old, but I finally get down to running activemq list. When I do, it throws a rather lengthy stacktrace:
Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
ERROR: java.lang.RuntimeException: Failed to execute list task. Reason: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused]
...
Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:118)
... 21 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 26 more
Is there still something I have configured wrong? I have no firewall rules. I can't think what else to look for.
There is no 'failure to retrieve RMI server stub' here. There is a failure to connect to the RMI registry. Either it isn't running at all or you're looking in the wrong host, or port.
Make sure your RMI registry is running. You can do this with rmiregistry in another terminal, providing it's in the same working directory.
After installing avasty greenfoot a simple java programm to learn java isnt working on my windows 8 machine. In the log there is more information provided, but i as java beginner dont really understand the problem ! I hope somebody can help me!
Greenfoot run started: Thu Oct 24 17:29:03 CEST 2013
Greenfoot version: 2.3.0
Java version 1.7.0_21
Virtual machine: Java HotSpot(TM) Client VM 23.21-b01 (Oracle Corporation)
Running on: Windows 8 6.2 (x86)
Java Home: E:\jdk\jre
----
Internal error: Could not launch RMI server
Exception message: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection timed out: connect
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection timed out: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at rmiextension.BlueJRMIServer.<init>(BlueJRMIServer.java:111)
at rmiextension.RMIExtension.startup(RMIExtension.java:60)
at bluej.extmgr.ExtensionWrapper.safeStartup(ExtensionWrapper.java:533)
at bluej.extmgr.ExtensionWrapper.newExtension(ExtensionWrapper.java:209)
at bluej.extmgr.ExtensionsManager.loadDirectoryExtensions(ExtensionsManager.java:164)
at bluej.extmgr.ExtensionsManager.loadExtensions(ExtensionsManager.java:100)
at bluej.extmgr.ExtensionsManager.getInstance(ExtensionsManager.java:61)
at bluej.Main.processArgs(Main.java:179)
at bluej.Main.access$000(Main.java:55)
at bluej.Main$1.run(Main.java:97)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:146)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 29 more
Commencing network test...
Local host address = 212.5.13.214
Local host ip = 212.5.13.214
Addresses for 'localhost':
-> 127.0.0.1
-> 0:0:0:0:0:0:0:1
(end of list).
Creating unbound server socket...
Successful.
Creating server socket bound to 127.0.0.1...
Successful.
Attempting to connect to 127.0.0.1:52317 with NO_PROXY...
(!!) Couldn't accept connection: Accept timed out
(!!) Exception class: java.net.SocketTimeoutException
Creating server socket bound to 0:0:0:0:0:0:0:1...
Successful.
Attempting to connect to 0:0:0:0:0:0:0:1:52319 with NO_PROXY...
Successful.
Attempting to connect to 0:0:0:0:0:0:0:1:52319...
Successful.
Creating server socket bound to 212.5.13.214...
Successful.
Attempting to connect to 212.5.13.214:52322 with NO_PROXY...
(!!) Couldn't accept connection: Accept timed out
(!!) Exception class: java.net.SocketTimeoutException
Network test complete.
(!!) Couldn't connect to local address: Connection refused: connect
(!!) Exception class: java.net.ConnectException
(!!) Couldn't connect to local address: Connection refused: connect
(!!) Exception class: java.net.ConnectException
If you get a connection timeout to 127.0.0.1 there is something severely wrong with your network configuration.
Why is when I setHostName("mail.metaregistrar.com") and sending the mail to use the SMTP on localhost?
Java code:
SimpleEmail email = new SimpleEmail();
email.setHostName(host);
email.setStartTLSEnabled(true);
email.setSmtpPort(25);
email.setAuthenticator(new DefaultAuthenticator(username, password));
email.setFrom(from);
email.setSubject(subject);
email.setMsg(message);
for (String address : addresses) {
email.addTo(address);
}
email.send();
Exception stack trace:
org.apache.commons.mail.EmailException: Sending the email to the following server failed : mail.metaregistrar.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1401)
at org.apache.commons.mail.Email.send(Email.java:1428)
at com.metaregistrar.mailer.Mailer.mail(Mailer.java:66)
at com.metaregistrarv2.schedule.ExternalPollMessageIisseHandler.handleUpdateMessage(ExternalPollMessageIisseHandler.java:88)
at com.metaregistrarv2.schedule.ExternalPollMessageIisseHandler.handleExternalPollMessage(ExternalPollMessageIisseHandler.java:67)
at com.metaregistrarv2.schedule.PollTaskTimer.handleStoredMessages(PollTaskTimer.java:58)
at com.metaregistrarv2.schedule.PollTaskTimer.execute(PollTaskTimer.java:38)
at com.metaregistrarv2.schedule.EppPollerTimedTaskAdapter.execute(EppPollerTimedTaskAdapter.java:28)
at com.metaregistrar.scheduling.TimedTask.run(TimedTask.java:22)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
at com.metaregistrar.concurrent.PoolThread.run(PoolThread.java:26)
Caused by: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused))
at javax.mail.Transport.send(Transport.java:163)
at javax.mail.Transport.send(Transport.java:48)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1391)
... 17 more
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
at javax.mail.Service.connect(Service.java:254)
at javax.mail.Service.connect(Service.java:85)
at javax.mail.Service.connect(Service.java:70)
at javax.mail.Transport.send(Transport.java:94)
... 19 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:237)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
... 24 more
I don't know if you got this figured out, but I was having the same problem. Here's what I found:
The email.send() calls Transport.send(), which was using the server's default settings for the outgoing socket binding for that SMTP port (I'm running JBoss EAP 6.2). It was configured to use localhost on port 25... so every time I tried to send mail, it was trying to send to localhost:25.
I changed settings for that socket binding and now everything works.