Discussion:
Connection Refused
Jaracle Zhang
2018-06-05 06:44:55 UTC
Permalink
Hi,

I got errors when I was executing james-cli.sh -h 127.0.0.1 -p 9999 adddomain test-domain.com in Docker.  Exceptions are below.
 
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)]
 
OS:
       Win10 host
       VirtualBox4.3.12 with CentOS7
Docker:
       18.05.0-CE
JAMES:
       3.0.1-app
Dockerfile:
       

       RUN sudo $jamesbin/james start
       RUN sudo sh $jamesbin/james-cli.sh -h 127.0.0.1 -p 9999 adddomain test-domain.com //Exceptions are here
 
Am I missing some configurations with JAMES or the environment problem?
 
Thanks

Jaracle Zhang
Jaracle Zhang
2018-06-06 08:55:34 UTC
Permalink
Hi Simon,

It seems not working.My code like this:

RUN sudo $jamesbin/james start && \
echo "$(<$jameshome/log/wrapper.log)" && \
sudo sh $jamesbin/james-cli.sh AddDomain test-domain.com

Before this command,I configured conf/wrapper.conf:
wrapper.java.additional.15=-Djava.rmi.server.hostname=127.0.0.1

But still the same error.As you can see,I print the wrapper.log:
--> Wrapper Started as Daemon
Launching a JVM...

And then nothing shows.Maybe the wrapper didn't start?
Because as I know,the wrapper.log will print "Apache James :: Server :: App
started." if the wrapper starts successfully.

Thanks for any help,
Jaracle Zhang
Hi Jaracle,
In a docker file, each filesystem state is saved and there is no running
processes kept between commands.
RUN sudo $jamesbin/james start && \
sudo sh $jamesbin/james-cli.sh -h 127.0.0.1 -p 9999 adddomain
test-domain.com
Give it a try.
cheers
Post by Jaracle Zhang
Hi,
I got errors when I was executing james-cli.sh -h 127.0.0.1 -p 9999
adddomain test-domain.com in Docker. Exceptions are below.
javax.naming.ServiceUnavailableException[Root exception is
java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested
java.net.ConnectException: Connection refused(Connection refused)]
Win10 host
VirtualBox4.3.12 with CentOS7
18.05.0-CE
3.0.1-app


RUN sudo $jamesbin/james start
RUN sudo sh $jamesbin/james-cli.sh -h 127.0.0.1 -p 9999 adddomain
test-domain.com //Exceptions are here
Am I missing some configurations with JAMES or the environment problem?
Thanks
Jaracle Zhang
Simon Levesque
2018-06-06 10:04:46 UTC
Permalink
Hi Jaracle,

just be because the first command returns right away (it is not waiting
that the James server is up).

maybe try
RUN sudo $jamesbin/james start && \
sleep 20 && \
echo "$(<$jameshome/log/wrapper.log)" && \
sudo sh $jamesbin/james-cli.sh AddDomain test-domain.com

HTH
Post by Jaracle Zhang
Hi Simon,
RUN sudo $jamesbin/james start && \
echo "$(<$jameshome/log/wrapper.log)" && \
sudo sh $jamesbin/james-cli.sh AddDomain test-domain.com
wrapper.java.additional.15=-Djava.rmi.server.hostname=127.0.0.1
--> Wrapper Started as Daemon
Launching a JVM...
And then nothing shows.Maybe the wrapper didn't start?
Because as I know,the wrapper.log will print "Apache James :: Server :: App
started." if the wrapper starts successfully.
Thanks for any help,
Jaracle Zhang
Hi Jaracle,
In a docker file, each filesystem state is saved and there is no running
processes kept between commands.
RUN sudo $jamesbin/james start && \
sudo sh $jamesbin/james-cli.sh -h 127.0.0.1 -p 9999 adddomain
test-domain.com
Give it a try.
cheers
Post by Jaracle Zhang
Hi,
I got errors when I was executing james-cli.sh -h 127.0.0.1 -p 9999
adddomain test-domain.com in Docker. Exceptions are below.
Error connecting to remote JMX agent : Failed to retrieve RMIServer
javax.naming.ServiceUnavailableException[Root exception is
java.rmi.ConnectException: Connection refused to host: 127.0.0.1;
nested
Post by Jaracle Zhang
java.net.ConnectException: Connection refused(Connection
refused)]
Post by Jaracle Zhang
Win10 host
VirtualBox4.3.12 with CentOS7
18.05.0-CE
3.0.1-app


RUN sudo $jamesbin/james start
RUN sudo sh $jamesbin/james-cli.sh -h 127.0.0.1 -p 9999
adddomain
Post by Jaracle Zhang
test-domain.com //Exceptions are here
Am I missing some configurations with JAMES or the environment problem?
Thanks
Jaracle Zhang
Loading...