Glassfish Server, deploy, Connection refused: connect, false - java

I have problém with my glassfish with this message:
GlassFish Server, deploy, Connection refused: connect, false
C:\Users\Zdeněk\Desktop\OOPRUkol3\nbproject\build-impl.xml:1045: The
module has not been deployed. See the server log for details. BUILD
FAILED (total time: 4 seconds)
Glasfish started via command-line. Using Netbeans 8.0.x and glassfish 4.1. Netbeans 7.0.x and Glassfish 3.1. tryed and do not work also.

Related

Jenkins build and deployment of spring boot client microservice fails because of config-server at https://localhost:8888 not present on maven build

My goal is to deploy 1 spring-config-server application AND 1 spring-boot-client application to the same Linux server machine.
spring-boot-client application port is 8081
spring-config-server application port is 8888
In Jenkins I created 2 jobs. First job is to build and deploy the spring-config-server application and start the jar. Second job is is to build and deploy the spring-boot-client application and start the jar.
I was able to build and deploy the spring-config-server application to the Linux machine. I can see it running at localhost:8888
Problem : Build task/job for spring-boot-client application in Jenkins is failing because when maven clean install is run, I believe that it tries to locate presence of a config server running at localhost:8888. I don't know if it's because of actuator dependency I added.
In Jenkins build console, this is what I get
Caused by: org.springframework.web.client.ResourceAccessException: I/O
error on GET request for "http://localhost:8888/application/dev":
Connection refused (Connection refused); nested exception is
java.net.ConnectException: Connection refused (Connection refused) at
org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:785)
at
org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711)
at
org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:602)
at
org.springframework.cloud.config.client.ConfigServerConfigDataLoader.getRemoteEnvironment(ConfigServerConfigDataLoader.java:303)
at
org.springframework.cloud.config.client.ConfigServerConfigDataLoader.doLoad(ConfigServerConfigDataLoader.java:118)
... 94 common frames omitted Caused by: java.net.ConnectException:
Connection refused (Connection refused)
In the spring-boot-client app's application.properties, the only setting I have are these :
# ANT_PATH_MATCHER is added to avoid NULL error in SwaggerConfig
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
server.port=8081
# Spring Config Server URL of Config Server Microservice :
spring.config.import=configserver:http://localhost:8888
# Environment configuration which you want to load :
spring.profiles.active=dev
In spring-boot-client's jenkins build job, this is what I have :
Now, theoretically, I believe that deploying 1 config-server and 1 client-app in the same linux machine should be possible. I just don't know how to properly configure it in Jenkins.
I have this spring cloud config client in pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
<version>3.1.3</version>
</dependency>
I have a copy of the spring-config-server app and spring-boot-client app in my local machine. I just start/run both and it works.
I am a beginner in Jenkins and I do everything in UI. This is just a build task with scp and ssh commands executed in shell to deploy.
I'd appreciate any help or comment.
Thank you.

How can I do remote debugging with my tomcat server running on an VM in IntelliJ community Edition?

I want to remote debug an application. My tomcat server is running in a Vm. I am trying to connect to it to debug. How can I connect to it?
NOTE: I am trying to do this in windows machines.
Already tried the solution mentioned in.
How to debug a Tomcat 7.x/8.x webapp locally with IntelliJ Community (free) version in Linux?. But after following the steps, I am getting:
Error running 'Local Apache Tomcat': Unable to open debugger port (localhost:12000): java.net.ConnectException "Connection refused: connect"
Error running 'Local Apache Tomcat': Unable to open debugger port (10.194.43.79:12000): java.net.ConnectException "Connection refused: connect"
Made sure the jdk that I am mentioning in settings. And the one which is installed in vm machine, It's same.
I am able to ping the machine.
I've tried to connect to it with tomcat which is running on my machine. It's not working.
Acc. to How to debug a Tomcat 7.x/8.x webapp locally with IntelliJ Community (free) version in Linux?
I should've received:
Connected to the target VM, address: '10.194.43.79:12000', transport: 'socket'
Instead it's:
Error running 'Local Apache Tomcat': Unable to open debugger port (10.194.43.37:12000): java.net.ConnectException "Connection timed out: connect"

java web application with glassfish server not getting deployed

When I run my web project with glassfish server 4.1 , it says module has not been deployed.
GlassFish Server 4.1 is running.
Starting GlassFish Server 4.1
In-place deployment at /Users/shobhnit/NetBeansProjects/WebApplication3/build/web
GlassFish Server 4.1, deploy, null, false
/Users/shobhnit/NetBeansProjects/WebApplication3/nbproject/build-impl.xml:1045: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 minute 6 seconds)
My glassfish server is not getting started also :
server log screenshot
glassfish server properties

Deploy webapp project on tomcat instead of glassfish in Netbeans

I have been trying to deploy my project on a Tomcat server but I keep getting this message on Netbeans
Could not start GlassFish Server: HTTP or HTTPS listener port is
occupied while server is not running
I have already tried to shutdown and remove Glassfish but it keeps printing the same message.
Just ran into the answer
Choose your NetBeans project > properties > run > server > (select) Apache Tomcat or TomEE

Failed to connect to remote VM using Glassfish and Eclipse

i'm using Glassfish 3.1.2.2 and Eclipse Kepler.
Glassfish configuration:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009.
Debug: Enabled
Into Eclipse, in the Remote Java Application i've selected the project, and in the connection properties i've set:
Host: localhost
port: 9009
When i try to connect the debug, the message error is:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
I've checked the port 9009 with a telnet, and is not used...
can someone help me?
tx
[SOLVED] it's a problem with the glassfish plugin in Eclipse! you must to start glassfish form the command line, not from the Eclipse window. After, you can connect like remote debug to your local glassfish ;)
In Host, you need to give IP address of the remote machine you want to connect.
localhost is your own machine.

Categories