Deploying java application using capistrano - java

I am trying to get my java application deployed on tomcat server (in windows), I am getting the following error. Please help me with some guideline on the following connection error. I have admin privilege and server is running in local.
C:\builds>cap local deploy
DL is deprecated, please use Fiddle
* 2013-04-01 14:19:06 executing `local'
* 2013-04-01 14:19:06 executing `deploy'
* 2013-04-01 14:19:06 executing `deploy:update'
** transaction: start
* 2013-04-01 14:19:06 executing `deploy:update_code'
* executing "xcopy C:/_Savita/app/my-app \"C:/builds/releases/20
130401084906\" /S/I/Y/Q/E && (echo > C:/builds/releases/20130401084906/REVISION
)"
servers: ["localhost"]
*** [deploy:update_code] rolling back
* executing "rm -rf C:/builds/releases/20130401084906; true"
servers: ["localhost"]
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionErr
or, connection failed for: localhost (Errno::ECONNREFUSED: No connection could b
e made because the target machine actively refused it. - connect(2))
connection failed for: localhost (Errno::ECONNREFUSED: No connection could be ma
de because the target machine actively refused it. - connect(2))
Please find below the deploy script used
set :application, "myApp"
#set :scm, "git"
set :repository, "C:/_Savita/app/my-app"
#set :branch, "master"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
task :local do
roles.clear
server "localhost", :app
set :user, "Savita Doddamani"
set :java_home, "C:/Program Files (x86)/Java/jdk1.6.0_25"
set :tomcat_home, "C:/Program Files (x86)/Apache Software Foundation/Tomcat 6.0"
set :tomcat_manager, "user"
set :tomcat_manager_password, "pwd"
set :maven_home, "C:/_Savita/softwares/apache-maven-2.2.1"
set :deploy_to, "C:/builds/"
set :use_sudo, false
namespace :tomcat do
task :deploy do
puts "==================Building with Maven======================" #Line 22
run "export JAVA_HOME=#{java_home} && cd #{deploy_to}/ && #{maven_home}/bin/mvn clean install package -DskipTests"
puts "==================Undeploy war======================"#Line 24
run "curl --user #{tomcat_manager}:#{tomcat_manager_password} http://$CAPISTRANO:HOST$:8080/manager/text/undeploy?path=/#{application}"
puts "==================Deploy war to Tomcat======================" #Line 26
run "curl --upload-file #{deploy_to}/current/target/dist/local/#{application}*.war --user #{tomcat_manager}:#{tomcat_manager_password} http://$CAPISTRANO:HOST$:8080/manager/text/deploy?path=/#{application}"
end
end
after "deploy", "tomcat:deploy" #Line 30
after "tomcat:deploy", "deploy:cleanup" # keep only the last 5 releases
end

ECONNREFUSED is the return from the connect(2) system call. It means that the server process is not listening on TCP port 8080. Java takes time to start up and you may be attempting to connect via curl too soon or you have not configured Tomcat to listen on port 8080 or you have not started Tomcat at all.

Related

Jenkins-slave failing due to jarCache error

I have a jenkins master running in VM and docker running on another VM, I have setup all the required things for making docker as a build-agent for jenkins-master.
Now When I am running simple job on docker-build agent, I am getting following error.
SSHLauncher{host='192.168.33.15', port=49162, credentialsId='dock-cont-pass', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
[08/02/21 11:00:36] [SSH] Opening SSH connection to 192.168.33.15:49162.
[08/02/21 11:00:36] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
[08/02/21 11:00:37] [SSH] Authentication successful.
[08/02/21 11:00:37] [SSH] The remote user's environment is:
BASH=/usr/bin/bash
BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=([0]="0")
BASH_ARGV=()
BASH_CMDS=()
BASH_EXECUTION_STRING=set
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="5" [1]="0" [2]="17" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
BASH_VERSION='5.0.17(1)-release'
DIRSTACK=()
EUID=1000
GROUPS=()
HOME=/home/jenkins
HOSTNAME=7bf4435f24c4
HOSTTYPE=x86_64
IFS=$' \t\n'
LOGNAME=jenkins
MACHTYPE=x86_64-pc-linux-gnu
MOTD_SHOWN=pam
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PIPESTATUS=([0]="0")
PPID=72
PS4='+ '
PWD=/home/jenkins
SHELL=/bin/bash
SHELLOPTS=braceexpand:hashall:interactive-comments
SHLVL=1
SSH_CLIENT='192.168.33.10 37292 22'
SSH_CONNECTION='192.168.33.10 37292 172.17.0.3 22'
TERM=dumb
UID=1000
USER=jenkins
_=']'
Checking Java version in the PATH
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~20.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
[08/02/21 11:00:37] [SSH] Checking java version of /jdk/bin/java
Couldn't figure out the Java version of /jdk/bin/java
bash: /jdk/bin/java: No such file or directory
[08/02/21 11:00:37] [SSH] Checking java version of java
[08/02/21 11:00:37] [SSH] java -version returned 1.8.0_292.
[08/02/21 11:00:37] [SSH] Starting sftp client.
ERROR: [08/02/21 11:00:37] [SSH] SFTP failed. Copying via SCP.
java.io.IOException: The subsystem request failed.
at com.trilead.ssh2.channel.ChannelManager.requestSubSystem(ChannelManager.java:741)
at com.trilead.ssh2.Session.startSubSystem(Session.java:362)
at com.trilead.ssh2.SFTPv3Client.<init>(SFTPv3Client.java:100)
at com.trilead.ssh2.SFTPv3Client.<init>(SFTPv3Client.java:119)
at com.trilead.ssh2.jenkins.SFTPClient.<init>(SFTPClient.java:43)
at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:688)
at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:111)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:456)
at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:421)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: The server denied the request.
at com.trilead.ssh2.channel.ChannelManager.requestSubSystem(ChannelManager.java:737)
... 12 more
[08/02/21 11:00:37] [SSH] Copying latest remoting.jar...
Expanded the channel window size to 4MB
[08/02/21 11:00:37] [SSH] **Starting agent process: cd "" && java -jar remoting.jar -workDir -jar-cache /remoting/jarCache
No argument is allowed: /remoting/jarCache**
java -jar agent.jar [options...]
-agentLog FILE : Local agent error log destination (overrides
workDir)
-auth user:pass : If your Jenkins is security-enabled, specify
a valid user name and password.
-cert VAL : Specify additional X.509 encoded PEM
certificates to trust when connecting to
Jenkins root URLs. If starting with # then
the remainder is assumed to be the name of
the certificate file to read.
-connectTo HOST:PORT : make a TCP connection to the given host and
port, then start communication.
-cp (-classpath) PATH : add the given classpath elements to the
system classloader.
-failIfWorkDirIsMissing : Fails the initialization if the requested
workDir or internalDir are missing ('false'
by default) (default: false)
-help : Show this help message (default: false)
-internalDir VAL : Specifies a name of the internal files
within a working directory ('remoting' by
default) (default: remoting)
-jar-cache DIR : Cache directory that stores jar files sent
from the master
-jnlpCredentials USER:PASSWORD : HTTP BASIC AUTH header to pass in for making
HTTP requests.
-jnlpUrl URL : instead of talking to the master via
stdin/stdout, emulate a JNLP client by
making a TCP connection to the master.
Connection parameters are obtained by
parsing the JNLP file.
-loggingConfig FILE : Path to the property file with
java.util.logging settings
-noKeepAlive : Disable TCP socket keep alive on connection
to the master. (default: false)
-noReconnect : Doesn't try to reconnect when a
communication fail, and exit instead
(default: false)
-proxyCredentials USER:PASSWORD : HTTP BASIC AUTH header to pass in for making
HTTP authenticated proxy requests.
-secret HEX_SECRET : Agent connection secret to use instead of
-jnlpCredentials.
-tcp FILE : instead of talking to the master via
stdin/stdout, listens to a random local
port, write that port number to the given
file, then wait for the master to connect to
that port.
-text : encode communication with the master with
base64. Useful for running agent over 8-bit
unsafe protocol like telnet
-version : Shows the version of the remoting jar and
then exits (default: false)
-workDir FILE : Declares the working directory of the
remoting instance (stores cache and logs by
default) (default: -jar-cache)
Agent JVM has terminated. Exit code=0
[08/02/21 11:00:39] Launch failed - cleaning up connection
[08/02/21 11:00:39] [SSH] Connection closed.
How Can I resolved this problem I am using SSH-connection for connecting the docker container.
I have solved above problem by changing the username in dockerfile for build-agent, previously it was set to root user,now I have set this to jenkins and now Jenkins server will use "/home/jenkins/" as a working directory.
You need to build image from this dockerfile and then specify this particular image to the cloud-configuration of docker
You need to change the credentials in jenkins as well
FROM ubuntu:18.04
RUN mkdir -p /var/run/sshd
RUN apt -y update
RUN apt install -y openjdk-8-jdk
RUN apt install -y openssh-server
RUN apt install -y git
#RUN apt install -y maven
#generate the host keys with the default key file path, an empty passphrase
RUN ssh-keygen -A
ADD ./sshd_config /etc/ssh/sshd_config
RUN echo ***jenkins:password123***| chpasswd
RUN chown -R **jenkins:jenkins** /home/jenkins/
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]

ApacheGUI Error ./run.sh: 1: [: -ne: unexpected operator

I have installed Apache GUI on Linux Debian in the following directory
/usr/local/apachegui/ApacheGUI/bin
by the following instruction as shown on this webpage:
https://www.howtoforge.com/tutorial/ubuntu-apache-gui/
At the end of the instruction, it's says run the following command:
sudo ./run.sh
when I run the above command I get the following output but with an error
./run.sh: 1: [: -ne: unexpected operator
Bottom of the terminal window its mention tomcat started and as in above mention tutorial webpage claims after running run.sh command
Your ApacheGUI is now starting and listening on port 9999.
Next, open your web browser and type the URL >http://your-server-ip:9999/ApacheGUI. You will >be redirected to the following page (ApachiGUI home page)
In my case when I am typing the above URL with my IP address or localhost my Chrome browser print: output site can not be reach
So I searched to check if port 9999 is enabled and listening in my case I was unable to see port 9999 in my list of ports so ran the following commands and the terminal window didn't produce any output from here I assumed port 9999 is close
pi#Home:~ $ ss -na | grep :9999
After using the above command terminal window return back to ip#home:$
now I open a separate terminal window and ping port 9999 and as result, This terminal window hang now it is clear the port 9999 is not open in my server so to open the close port I run the following command
Open port command:
sudo iptables -A INPUT -p tcp --dport 9999 -j ACCEPT
To update the firewall rules, I restart the iptables service
sudo iptables -L
output:
pi#Home:~ $ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:9999
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Now I check again a list of open ports on my server and I still can't see port 9999
After taking all these steps executed following command:
pi#Home:/usr/local/apachegui/ApacheGUI/bin $ ./run.sh
Output:
Using CATALINA_BASE: /usr/local/apachegui/ApacheGUI/tomcat Using
CATALINA_HOME: /usr/local/apachegui/ApacheGUI/tomcat Using
CATALINA_TMPDIR: /usr/local/apachegui/ApacheGUI/tomcat/temp Using
JRE_HOME: /usr Using CLASSPATH:
/usr/local/apachegui/ApacheGUI/tomcat/bin/bootstrap.jar:/usr/local/apachegui/ApacheGUI/tomcat/bin/tomcat-juli.jar
Tomcat started.
look like the initial error is resolved but I am still unable access ApacheGUI from my browser still unable to resolve the error mention above can anyone suggest what is the solution to this problem?
The run.sh file is a badly written shell script with content:
if [ $UID -ne 0 ]; then
sudo ../tomcat/bin/startup.sh
exit
fi
exec ../tomcat/bin/startup.sh
Just execute tomcat/bin/startup.sh. This script can fail in many ways:
there is no shebang (#!interpreter_name), so it is executed using /bin/sh or whatever the default shell is,
UID is not a POSIX variable (cf. this question), so the result is blank and test ([) only sees -ne 0. Usually in such cases the variable should be quoted or tested if it is not empty,
the path ../tomcat/bin/startup.sh is relative to the current directory, not the directory of the script.
By executing following tests you will learn port testing and port configuration and at the end of these test you will be able to find out either problem exist within your Server ports or you have to check the setting of your browser. In my case I have taken an unintentional long route, I set my testing plan into three sections as follow
Server Ports and Browser
If you ever experience the same issue my advise is to troubleshoot
Server Browser and then test Ports
By executing tomcat/bin/startup.sh it does start the server successfully just like run.sh (as mention in Question and given answer above) but the browser was still unable to load the localhost:9999/ApacheGUI index page because the server's initial error
./run.sh: 1: [: -ne: unexpected operator
was resolve (as shown in question) but the browser was still unable to load the GUI page so for this reason just to find out if there is a problem with port 9999 itself or there is something else causing localhost not to communicate with the browser via port 9999 I have carried out following tests:
I believe the following information is suitable for a tester who wants to troubleshoot ports but if you think there is nothing wrong with your ports and the problem may lies with the browser then visit the following link Where I had the same problem with port 8080 and I overcome this issue by modifying browser settings:
https://stackoverflow.com/questions/66524719/tomcat10-home-page-can-not-load-by-typing-localhost8080-error-err-connection-r
Reboot my server and execute the following command in terminal
tomcat/bin/startup.sh
output shows
Tomcat started
With this output, I know ApacheGUI is installed and the server is up and running.
Q: if the server is running so whey localhost:9999/ApacheGUI index
page is unable to load?
let's test port 9999 and take the following steps to check either it's port on your machine causing this error or it's something else
StepNO:1
pi#Home:~ $ nc -vz 192.168.0.16 9999
Connection to 192.168.0.16 9999 port [tcp/*] succeeded!
StepNO:2
type command on Linux terminal to test port 9999 (Enter)
pi#Home:~ $ sudo ls | nc -l -p 9999
(Cursor start flashing with no output)
StepNo:3
Then turn ON Window computer and open PuTTY client
Establish SSH connection from window machine by typing the following credentials in PuTTY Client interface:
Server: 192.168.0.16 port 9999
(Press Enter)
if port 9999 is open successfully you will get the following results
Linux Server Terminal (StepNO:2) Where cursor was flashing start responding to
Client request and print following line (where the cursor is still flashing):
SSH-2.0-PuTTY_Release_0.74
StepNO:4
Open a new terminal window and typed another command to make sure port 9999 is definitely open and responding (Linux Server terminal in StepNO:2 still open)
pi#Home:~ $ nmap -p 9999 192.168.0.16
Output:
Starting Nmap 7.70 ( https://nmap.org ) at 2021-03-05 23:44 GMT Nmap
scan report for 192.168.0.16 Host is up (0.00049s latency).
PORT STATE SERVICE 9999/tcp open abyss
Nmap done: 1 IP address (1 host up) scanned in 0.26 seconds
This stage confirmed I have successfully open port 9999 and the port is responding to
TCP protocols
StepNO:5
in the same Linux server terminal (stepNO:2) I type the following command again:
sudo ls | nc -l -p 9999 (Enter)
(Cursor start flashing)
Now I have open the browser and type ApacheGUI URL
192.168.0.16:9999/ApacheGUI (Enter)
Linux server terminal from StepNO:2 where the cursor is flashing start responding to
URL request from the browser and print the following lines in the terminal window:
Output:
GET /ApacheGUI/ HTTP/1.1 Host: 192.168.0.16:9999 Connection:
keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (X11;
Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/86.0.4240.197 Safari/537.36 Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9
But: my ApacheGUI index page still unable to load and showing the following error message
This site can’t be reached192.168.0.16 refused to connect. Try:
Checking the connection Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
At this stage, I am 100% sure that my installed server is up and running. Port 9999 in my server is open and functional so there is nothing else that can cause this error except the browser so I have followed the step to tune my browser setting as described in answer to the following link:
https://stackoverflow.com/questions/66524719/tomcat10-home-page-can-not-load-by-typing-localhost8080-error-err-connection-r
Result: Successful connection ApacheGUI index page finally loaded to the browser.

Docker port isn't accessible from host

I have a new Spring Boot application that I just finished and am trying to deploy it to Docker. Inside the container the application works fine. It uses ports 9000 for user facing requests and 9100 for administrative tasks like health checks. When I start a docker instance and try to access port 9000 I get the following error:
curl: (56) Recv failure: Connection reset by peer
After a lot of experimentation (via curl), I confirmed in with several different configurations that the application functions fine inside the container, but when I try to map ports to the host it doesn't connect. I've tried starting it with the following commands. None of them allow me to access the ports from the host.
docker run -P=true my-app
docker run -p 9000:9000 my-app
The workaround
The only approach that works is using the --net host option, but this doesn't allow me to run more than one container on that host.
docker run -d --net=host my-app
Experiments with ports and expose
I've used various versions of the Dockerfile exposing different ports such as 9000 and 9100 or just 9000. None of that helped. Here's my latest version:
FROM ubuntu
MAINTAINER redacted
RUN apt-get update
RUN apt-get install openjdk-7-jre-headless -y
RUN mkdir -p /opt/app
WORKDIR /opt/app
ADD ./target/oauth-authentication-1.0.0.jar /opt/app/service.jar
ADD config.properties /opt/app/config.properties
EXPOSE 9000
ENTRYPOINT java -Dext.properties.dir=/opt/app -jar /opt/app/service.jar
Hello World works
To make sure I can run a Spring Boot application, I tried Simplest-Spring-Boot-MVC-HelloWorld and it worked fine.
Netstat Results
I've used netstat to do port scans from the host and from the container:
From the host
root#my-docker-host:~# nmap 172.17.0.71 -p9000-9200
Starting Nmap 6.40 ( http://nmap.org ) at 2014-11-14 19:19 UTC Nmap
scan report for my-docker-host (172.17.0.71)
Host is up (0.0000090s latency).
Not shown: 200 closed ports
PORT STATE SERVICE
9100/tcp open jetdirect
MAC Address: F2:1A:ED:F4:07:7A (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 1.48 seconds
From the container
root#80cf20c0c1fa:/opt/app# nmap 127.0.0.1 -p9000-9200
Starting Nmap 6.40 ( http://nmap.org ) at 2014-11-14 19:20 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000070s latency).
Not shown: 199 closed ports
PORT STATE SERVICE
9000/tcp open cslistener
9100/tcp open jetdirect
Nmap done: 1 IP address (1 host up) scanned in 2.25 seconds
The container is using Ubuntu
The hosts I've replicated this are Centos and Ubuntu.
This SO question seems similar but had very few details and no answers, so I thought I'd try to document my scenario a bit more.
I had a similar problem, in which specifying a host IP address as '127.0.0.1' wouldn't properly forward the port to the host.
Setting the web server's IP to '0.0.0.0' fixes the problem
eg - for my Node app - the following doesn't work
app.listen(3000, '127.0.0.1')
Where as the following does work:
app.listen(3000, '0.0.0.0')
Which I guess means that docker, by default, is exposing 0.0.0.0:containerPort -> local port
You should run with docker run -P to get the ports to map automatically to the same values to set in the Dockerfile.. Please see http://docs.docker.com/reference/run/#expose-incoming-ports

IDEA failed to start a local glassfish server

I'm trying to start Glassfish 4.1 in Intellij IDEA 13.1.4. I've set basic settings in Run/debug configurations window - selected application server, jvm, put 2 artifacts to deploy, left startup/connection configurations default. When I try to start it the exception is thrown. Here is full stack trace:
/home/glassfish/glassfish/bin/asadmin start-domain domain1
Detected server admin port: 4848
Detected server http port: 8080
[2014-11-14 03:09:49,839] Artifact ss-ear:ear: Server is no connected.Deploy is not available.
[2014-11-14 03:09:49,839] Artifact ss-ear:ear exploded: Server is not connected. Deploy is not available.
java.nio.file.AccessDeniedException: /home/glassfish/glassfish/domains/domain1/logs/server.log.lck
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
at java.nio.channels.FileChannel.open(FileChannel.java:287)
at java.nio.channels.FileChannel.open(FileChannel.java:335)
at java.util.logging.FileHandler.openFiles(FileHandler.java:438)
at java.util.logging.FileHandler.<init>(FileHandler.java:318)
at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:99)
at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:192)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:228)
at com.sun.enterprise.admin.servermgmt.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:124)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:322)
at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:366)
at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:300)
at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:56)
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 1.
Command start-domain failed.
Before it died, it produced the following output:
Listening for transport dt_socket at address: 9009
Launching GlassFish on Felix platform
Exception in thread "main" java.lang.RuntimeException: the domain directory is not writable.
at com.sun.enterprise.glassfish.bootstrap.MainHelper.verifyDomainRoot(MainHelper.java:246)
at com.sun.enterprise.glassfish.bootstrap.MainHelper.findInstanceRoot(MainHelper.java:349)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:78)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
I'm using Ubuntu OS 14.04 LTS, java-1.7.0-openjdk-amd64.
Glassfish installed in /home/glassfish, asadmin script have 777 permissions.
Server starts when i run it from terminal, but not from IDE.
Please help, it makes me mad!
See this "java.nio.file.AccessDeniedException" it says all. Give permissions to the gassfish folder.
sudo chmod -R 777 /wherever-the-folder-is/glassfish-folder
Have you tried to start IntelliJ with sudo permission and start the server within the ide?
open CMD as Run as Administrator and then start the glassfish domain. so that the domain will start.

Running Single instance AppScale in a virtual machine

I was trying to run AppScale in a Single-instance node installed in a Vmware box and running the appscale-tools in the same server virtual machine and got this error:
root#appscale:~appscale-tools-bin# ./appscale-run-instances --ips ips.yaml
About to start AppScale over a non-cloud environment.
Head node successfully created at 127.0.0.1. It is now starting up cassandra via the command line arguments given.
Generating certificate and private key
Starting server at 127.0.0.1
Please wait for the controller to finish pre-processing tasks.
Warning: Permanently added '127.0.0.1' (RSA) t othe list of known host.
Error: Couldn't find me in the node map
The solution I was advised was to change a code in this source:
appscale/AppController/lib/helperfunctions.rb
And look for self.local_ip() and change to:
def self.local_ip()
return "127.0.0.1"
end
But when I run
./appscale-run-instances --ips ips.yaml
I am not sure, but it just keep on saying:
"Please wait for the controller to finish pre-processing tasks." for several minutes already.
So I decided to terminate it, and here is what I get:
"...common_functions.rb:399:in 'sleep_unti_port_is_open"
In this case, it seems I need to open a port, I am running AppScale from within Ubuntu, what port should I open in my server?
Here's the complete command line:
./appscale-run-instances --ips ips.yaml
About to start AppScale over a non-cloud environment.
Head node successfully created at 127.0.0.1.
It is now starting up cassandra via the command line arguments given.
Generating certificate and private key.
Starting server at 127.0.0.1
Please wait for the controller to finish pre-processing tasks.
^C./../lib/../lib/common_functions.rb:399:in sleep': Interrupt
from ./../lib/../lib/common_functions.rb:399:in 'sleep_until_port_is_open'
from ./../lib/../lib/common_functions.rb:397:in 'loop'
from ./../lib/../lib/common_functions.rb:397:in 'sleep_until_port_is_open'
from ./../lib/../lib/common_functions.rb:1359:in 'start_appcontroller'
from /usr/lib/ruby/1.8/timeout.rb:62:in ttimeout.
from ./../lib/../lib/common_functions.rb:1351:in 'start_appcontroller'
from ./../lib/../lib/common_functions.rb:548:in 'start_head_node'
from ./../lib/appscale_tools.rb:284:in trun_instances'
from ./appscale-run-instances:14
Using the pre-build Appscale images here or following the steps listed here https://github.com/AppScale/appscale/wiki/Virtualized-Cluster will solve this problem.
Also it has the build script:
$ sudo su
# cd /root
# wget -O - http://bootstrap.appscale.com | sh

Categories

Resources