Jenkins: "javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;" - linux

all on a sudden i am not able to trigger emails via Jenkins which is running in rhel 6.2 . It was working fine before. But i am able to sent mails via server.
Below is the error which i am getting..
ERROR: Could not connect to SMTP host: smtp.uk.ri.ad, port: 465
javax.mail.MessagingException: Could not connect to SMTP host: smtp.uk.ri.ad, port: 465;
nested exception is:
java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:317)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at hudson.tasks.MailSender.run(MailSender.java:129)
at hudson.tasks.Mailer.perform(Mailer.java:170)
at
hudson.tasks.BuildStepCompatibilityLayer.perform
(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform
(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps
(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post
(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1753)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
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 sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:625)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:286)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:205)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
... 18 more
Finished: SUCCESS
Please help to fix the issue.. Thanks in advance

Someone changed the configs of email server in the machine itself.. So when i wrote the configuration in Jenkins it was attempting to overwrite the machine configuration and eventually timed out so i removed the config and it worked fine..

Related

Getting User Creation Exception With the Jhipster Application

I have successfully generated the application using Jhipster (Angular, MySQL). As an admin, I have logged in and trying to create a new user but I am getting the below error.
2021-05-10 21:55:14.218 ERROR 29756 --- [ XNIO-1 task-2] com.kc.bsadhana.service.UserService : Exception in createUser() with cause = 'java.lang.RuntimeException: Connection refused' and exception = 'Connection refused; nested exception is java.lang.RuntimeException: Connection refused'
org.springframework.dao.DataAccessResourceFailureException: Connection refused; nested exception is java.lang.RuntimeException: Connection refused
at org.springframework.data.elasticsearch.core.ElasticsearchExceptionTranslator.translateExceptionIfPossible(ElasticsearchExceptionTranslator.java:75)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:362)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:345)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.doIndex(ElasticsearchRestTemplate.java:143)
...
Caused by: java.lang.RuntimeException: Connection refused
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.translateException(ElasticsearchRestTemplate.java:360)
... 198 common frames omitted
Caused by: java.net.ConnectException: Connection refused
at org.elasticsearch.client.RestClient.extractAndWrapCause(RestClient.java:849)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:259)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:246)
at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1613)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1583)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1553)
at org.elasticsearch.client.RestHighLevelClient.index(RestHighLevelClient.java:970)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.lambda$doIndex$0(ElasticsearchRestTemplate.java:143)
at org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate.execute(ElasticsearchRestTemplate.java:343)
... 197 common frames omitted
Caused by: java.net.ConnectException: Connection refused
at java.base/sun.nio.ch.Net.pollConnect(Native Method)
at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:589)
at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:839)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvent(DefaultConnectingIOReactor.java:174)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:148)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351)
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
... 1 common frames omitted
2021-05-10 21:55:14.238 ERROR 29756 --- [ XNIO-1 task-2] com.kc.bsadhana.web.rest.UserResource : Exception in createUser() with cause = 'java.lang.RuntimeException: Connection refused' and exception = 'Connection refused; nested exception is java.lang.RuntimeException: Connection refused'
org.springframework.dao.DataAccessResourceFailureException: Connection refused; nested exception is java.lang.RuntimeException: Connection refused
In application-dev.yml file I have entered the database credentials :
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/bsadhana?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: root
password: rxxxx!
hikari:
Even the jhipster related tables were created in my database. But when I am trying to create a new user it is throwing the above-reported error. is there anywhere else I need to enter these credentials?
The error says your app cannot connect to your Elasticsearch instance, you should make sure you started it with following command as explained in the doc:
docker-compose -f src/main/docker/elasticsearch.yml up

armitage teamserver tthrowing connection refused on startup ubuntu

I tried every possible answer online! It was running sometime back.
OS: Ubuntu 16.04
Error:
Warning: checkError(): java.lang.RuntimeException:
java.net.ConnectException: Connection refused (Connection refused) at server.sl:450

CArtAgO java.rmi.ConnectException Connection refused in a distributed environment

I am trying to connect remotely to a JaCaMo application by CArtAgO infrastructure.
In the server my jcm file is like this:
mas testsvr {
agent bob
workspace world
platform: cartago(infrastructure)
class-path: lib // java class path
asl-path: src/agt, src/agt/inc // agent source path
}
And a client application is like this:
mas testclient {
agent alice
platform: cartago()
node n1 running # 10.0.0.14
class-path: lib // java class path
asl-path: src/agt, src/agt/inc // agent source path
}
When I've run with a server listening I got the following output:
CArtAgO Http Server running on http://127.0.1.1:3273
Jason Http Server running on http://127.0.1.1:3272
Looking for rmi://10.0.0.11/cartago_node
java.rmi.ConnectException: Connection refused to host: 127.0.1.1; 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 java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
at com.sun.proxy.$Proxy6.join(Unknown Source)
at cartago.infrastructure.rmi.CartagoInfrastructureLayer.joinRemoteWorkspace(CartagoInfrastructureLayer.java:62)
at cartago.CartagoService.joinRemoteWorkspace(CartagoService.java:372)
at cartago.NodeArtifact.joinRemoteWorkspace(NodeArtifact.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at cartago.ArtifactOpMethod.exec(ArtifactOpMethod.java:39)
at cartago.Artifact.doOperation(Artifact.java:407)
at cartago.Artifact.access$200(Artifact.java:32)
at cartago.Artifact$ArtifactAdapter.doOperation(Artifact.java:1275)
at cartago.WorkspaceKernel.serveOperation(WorkspaceKernel.java:1136)
at cartago.WorkspaceKernel.access$000(WorkspaceKernel.java:48)
at cartago.WorkspaceKernel$EnvironmentController.run(WorkspaceKernel.java:1477)
When I've run without a server listening the output was:
CArtAgO Http Server running on http://127.0.1.1:3273
Jason Http Server running on http://127.0.1.1:3272
java.rmi.ConnectException: Connection refused to host: 10.0.0.11; 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 java.rmi.Naming.lookup(Naming.java:101)
at cartago.infrastructure.rmi.CartagoInfrastructureLayer.joinRemoteWorkspace(CartagoInfrastructureLayer.java:58)
at cartago.CartagoService.joinRemoteWorkspace(CartagoService.java:372)
at cartago.NodeArtifact.joinRemoteWorkspace(NodeArtifact.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at cartago.ArtifactOpMethod.exec(ArtifactOpMethod.java:39)
at cartago.Artifact.doOperation(Artifact.java:407)
at cartago.Artifact.access$200(Artifact.java:32)
at cartago.Artifact$ArtifactAdapter.doOperation(Artifact.java:1275)
at cartago.WorkspaceKernel.serveOperation(WorkspaceKernel.java:1136)
at cartago.WorkspaceKernel.access$000(WorkspaceKernel.java:48)
at cartago.WorkspaceKernel$EnvironmentController.run(WorkspaceKernel.java:1477)
So, it shows that the client found the server but something wrong happened and the connection was refused. What is happening? Which is the default CArtAgO's connection port?
CArtAgO uses Java RMI, the default port is 20100. For LipeRMI connection the default port is 20101. Other constants can be checked in http://www.emse.fr/~boissier/enseignement/maop17-spring/doc/api/cartago-api/index.html?constant-values.html
It is suggested to leave server and client with no restrictions checking whether iptables INPUT, FORWARD and OUTPUT are showing ACCEPT for any case. You can use the following command:
$ iptables -L -v
On linux with JaCaMo application running you can see if the port 20100 was opened by the app (you can use ss or netstat). The response should be "LISTEN" for 20100 port
$ ss -tnl | grep 20100
or
$ netstat -tuplen | grep 20100
It is also necessary to have DNS working for the machines because the connection will use names. You may test it by command ping using machine names. From clients:
$ ping name_server
From server (ping clients)
$ ping name_client1
In case of no DNS server to solve names, it is necessary to edit /etc/hosts file. Considering the server named 'myserver_hostname' on ip 192.168.0.1 and client named 'myclient_hostname' on ip 192.168.0.2, the file on both machines, server and client, may be like this:
127.0.0.1 localhost
#127.0.1.1 myserver_hostname -- RMI will not use it anymore
192.168.0.1 myserver_hostname
192.168.0.2 myclient_hostname

Apache James 3 unexpectedly quits after few seconds

I always get this whenever I try to add domain
Error connecting to remote JMX agent : Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused (Connection refused)]
usage: java org.apache.james.cli.ServerCmd --host <arg> <command>
-h,--host <arg> node hostname or ip address
-p,--port <arg> remote jmx agent port number
AddUser <username> <password>
RemoveUser <username>
ListUsers
Although I discovered that James quits some seconds after starting, I have jaxb jar file, I have put it in every lib folder there is to put.
Is there anything I am doing wrong? Am I to specify input mysql details and if so where, I can't seem to figure this out.

Unable to View Airpal UI

i am unable to view Airpal Homepage.
Here is my reference.yml file.
HTTP-specific options.
server:
applicationConnectors:
- type: http
port: 8010
idleTimeout: 10 seconds
adminConnectors:
- type: http
port: 8082
shiro:
iniConfigs: ["classpath:shiro_allow_all.ini"]
dataSourceFactory:
driverClass: com.mysql.jdbc.Driver
user: root
password: root
url: jdbc:mysql://localhost:3306/airpal
flywayFactory:
locations: ["classpath:db.migration.common", "classpath:db.migration.mysql"]
The URL to the Presto coordinator.
prestoCoordinator: http://presto-coordinator-url.com
Here is my error when i am running this command.
java -server \
-Duser.timezone=UTC \
-cp build/libs/airpal-*-all.jar com.airbnb.airpal.AirpalApplication server reference.yml
Error: Exception in thread "main" java.lang.RuntimeException: java.net.BindException: Address already in use
at org.eclipse.jetty.setuid.SetUIDListener.lifeCycleStarting(SetUIDListener.java:213)
at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarting(AbstractLifeCycle.java:187)
WARN [2016-02-22 20:23:50,071] org.eclipse.jetty.util.component.AbstractLifeCycle: FAILED org.eclipse.jetty.server.Server#2125ad3: java.lang.RuntimeException: java.net.BindException: Address already in use
! java.net.BindException: Address already in use
Thanks in advance...
After struggling i just stopped prestoserver and ran the airpal command and now i can see Airpal homepage

Resources