Install Jetty After Tomcat installed - maven

I have been using Tomcat integrated with Eclipse for a long time, and now I want to try Jetty with maven without Eclipse (I am not using m2Eclipse for now). I know Jetty is using tomcat as container, and port will still be default 8080. Before doing anything reckless and screw up my setting, I would like to know that if any conflict could arise, and things to watch out for. If I just put jetty-plugin to the pom.xml in a separate project, will that affect my other projects build on tomcat with Eclipse?
Thank you.

If you want to run jetty and you already have tomcat running on port 8080 then that will not work, only one or the other can use a single port. The solution is simple though, either set a different port in the jetty-maven-plugin configuration (8090?) or set no port and in the output of the plugin running it will have a line about the SelectChannelConnector or ServerConnector starting on port ###. Simply use that in your browser for the port.
[edit] I'll also note that should you have tomcat running on 8080 and you startup jetty and it tries to use 8080, the jetty process will fail and the tomcat process will be completely unaffected. The same as if the roles we reversed.

Related

Running Spring Boot application but Jenkins hijacks the port

I am following the IntelliJ "Hello World" Spring Boot tutorial (https://www.youtube.com/watch?v=5kOGdZmpSDI) and when I run the application it sets up the Tomcat server on port 8080, as expected, but when I go to localhost:8080 the Jenkins login page will appear instead as it was previously ran in a Docker container.
Is there a way to check what is running on Tomcat or a way to remove Jenkins entirely?
I have already deleted all running containers and images on Docker desktop and uninstalled Docker, but this issue still persists.
Any help would be appreciated as I am new to using Spring Boot as well as Docker - thank you.
By default springboot uses port 8080,you can change the port from 8080 to someother port,you can configure this in your application.properties file
Server.port= anyportnumber
I think this is the one you are looking for!,,Hope this helps

Changing Default Ports in Moqui

Moqui Framework Version : 2.1.3
The Framework runs on the default port 8080 just fine, i would like to change the default ports and i did read https://www.moqui.org/m/docs/framework/Run+and+Deploy#a2.RuntimeDirectoryandMoquiConfigurationXMLFile
which states > "Each of these can be system environment variables (with underscores) or Java properties (with underscores or dots) using the -D command-line argument.
i did find the webapp_ variables are referenced in MoquiDefaultConf.xml as mentioned in the above material and tried using the below start command >
$sudo nohup java -Dwebapp_http_host=localhost -Dwebapp_http_port=9080 -Dwebapp_https_port=9443 -jar moqui.war conf=conf/MoquiDevConf.xml &
However the above command does not seem to change the port, Moqui is still running on default port 8080, What could i be missing?
I also tried the solution to update the webapp tag in MoquiDevConf.xml as mentioned in Running Moqui on Tomcat over SSL (setting http-port and htts-port) - return code 302 with no joy,
Appreciate any pointers, i'm really stuck
The environment variables or Java properties you mention are for setting the ports to use when building URLs. These are the external ports used for accessing your server and if a load balancer or reverse proxy is used may be different from the ports the servlet container is running on. For more information see:
https://moqui.org/m/docs/framework/Run+and+Deploy#EnvironmentVariables
If you are running Moqui with the embedded Jetty server you can specify the port it listens on using the port argument as described in the Executable WAR File section of the Run and Deploy document:
https://moqui.org/m/docs/framework/Run+and+Deploy#a3.ExecutableWARFile
Note that the embedded Jetty server can be used in production but it does not support https and is meant to be used behind a reverse proxy like nginx or Apache httpd that forwards requests to the embedded Jetty server.
If you deploy the WAR file by dropping it in a Servlet Container (ie as an actual WAR file, not treating it as an executable JAR file) then the port configuration would be done with the Servlet Container (Tomcat, Jetty, etc).

intellij idea 14 cannot connect to debug tomcat7 service

Ok, I think I tried everything before I am posting this question. Please tell me, what I am (Still) missing. I keep getting "unable to connect" exception (unable to connect hostname:6012), I changed from default port 1099 and it still didn't help.
version of IntelliJ 14.0.2
Tomcat 7.0.52
Tomcat is running as a service so, I configured on the UI interface of tomcat.exe (java tab) the following JAVA_OPTs
-Xdebug
-Xrunjdwp:transport=dt_socket,address=57497,server=y,suspend=n
-javaagent:C:\Users\username\.IntelliJIdea14\system\groovyHotSwap\gragent.jar
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6012
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcatalina.home=C:\Tomcat 7.0
-Dcatalina.base=C:\Tomcat 7.0
-XX:MaxPermSize=512m
I made sure the port 57497 is open (open the firewall and telnet).
And on IntelliJ, I made a remote server connection. Please find attached
pictures. Both intellij and tomcat are running on the same system. I have a static dns setup. sometimes i get connection timedout exception.
server tab
connection tab
Here's my config.
Tomcat JAVA_OPTs to enable remote debugging:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5007
In IntelliJ, I don't use the Configuration-Type 'Tomcat'. In my case 'Remote' works pretty well (I would post an image but I ain't got 10 reputation...). You only need to configure your host and port on the config sheet.
I use IntelliJ 14.0.3 and I had the same issue, though with Jetty. Switching to using the remote instead of jetty -> remote worked. I'm guessing they're both supposed to work differently. I just haven't figured out why there are two different options to remote debug.

Confliting PORTNO of Tomcat

I have installed Apache Tomcat 7.0.32 and I am using Eclipse JUNO. But whenever I am using Eclipse I am not getting result from Server rather than I am getting Server can not start within 45sec.
Try changing connection port in server.xml

Unable to debug tomcat server using eclipse

I'm using:
Spring Tool Suite Version: 3.2.0.RELEASE
Tomcat v7.0.42
When I just run my tomcat server everything is fine but I'm unable to debug it even locally. It produces following error:
Startich Apache Tomcat v7.0.42 at localhost has encoutered a problem.
Server Apache Tomcat v7.0.42 bat localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor.
I've tried the following:
increase the timeout.
remove all the apps before starting the debugging.
install new instance of tomcat (the only configuration that I've did on fresh install is turning on Use Tomcat installation and Never publish automatically).
But it didn't help, I still can only run the tomcat, without the debug option. Does anyone know how to make this debugging work?
When I've used new, clear workspace for Spring Tool Suite, debugging started to work.
Cheers,

Resources