which tomcat service gets started while running a jar from terminal - java

As i had created a jar from my project, i had started running it from linux terminal using the command
java -jar snapShot.jar
By running this my project works fine and gives console output as
INFO 2018-06-26 13:34:25 [main] -Registering beans for JMX exposure
on startup
INFO 2018-06-26 13:34:25 [main] -Tomcat started on port(s): 8080
(http)
INFO 2018-06-26 13:34:25 [main] -Started DomainApplication in 12.143
seconds (JVM running for 12.662)
I have another Tomcat in my local system. Apache Tomcat Version 8.5.29 .
But while running the jar file in terminal i found another tomcat service is running. Actually which gets started?

Related

Debug micronaut application in eclipse IDE

I have created a java micronaut application in Eclipse IDE. The microservice is able to build and run successfully via commandline but I'd like to know if there is a way to add breakpoints in the application for debugging just the way we debug any normal java application?
I did try the solution mentioned here Debug java micronaut microservice in visual studio code.
I added run.jvmArgs('-Dmicronaut.environments=dev','-noverify', '-XX:TieredStopAtLevel=1', '-Xdebug',"-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n", '-Dcom.sun.management.jmxremote') configuration
to build.gradle.
When I build and run the project again, I see
> Task :run
Listening for transport dt_socket at address: 8000
12:53:51.084 [main] INFO i.m.context.env.DefaultEnvironment - Established active environments: [dev]
12:53:53.809 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 3102ms. Server Running: http://localhost:6030
So how do I add breakpoints and debug the microservice now?
In this setup, the JVM is listening on a socket for a debugger to attach. In Eclipse, you can create a remote debug configuration for this:
Run -> Debug Configurations
Make new Launch configuration under Remote Java Application
Ensure the right project is selected. Under Connection Properties, let it connect to localhost on port 8000 (which happens to be the default)
Click Debug

Jetty Runner IDEA Community Logging

I am working on a project using Intellij IDEA Community, so I am using Jetty Runner to deploy my web application in localhost, everything is working ok, but I want to configure logs regarding Jetty, at server startup I see this kind of log :
14:50:20.516 [main] DEBUG o.eclipse.jetty.webapp.WebAppContext - isSystemResource==false org.springframework.expression.spel.ast.OpDec jar:file:/C:/Mario/development/spring/spring5/workspace/springsecurity/chapter02/chapter02.00-calendar/build/exploded/WEB-INF/lib/spring-expression-4.3.11.RELEASE.jar!/org/springframework/expression/spel/ast/OpDec.class
14:50:20.516 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - WAP webapp loaded class org.springframework.expression.spel.ast.OpDec
14:50:20.516 [main] DEBUG o.eclipse.jetty.webapp.WebAppContext - isSystemResource==false org.springframework.expression.spel.ast.OperatorNot jar:file:/C:/Mario/development/spring/spring5/workspace/springsecurity/chapter02/chapter02.00-calendar/build/exploded/WEB-INF/lib/spring-expression-4.3.11.RELEASE.jar!/org/springframework/expression/spel/ast/OperatorNot.class
14:50:20.517 [main] DEBUG o.e.jetty.webapp.WebAppClassLoader - WAP webapp loaded class org.springframework.expression.spel.ast.OperatorNot
1
I want to change the granularity from DEBUG to info regarding jetty server.
Put a jetty-logging.properties file in your resources folder and configure the logging there:
# Configure for System.err output
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
# Configure StdErrLog to log all jetty namespace at default of WARN or above
org.eclipse.jetty.LEVEL=INFO
More info here: https://www.eclipse.org/jetty/documentation/9.4.x/configuring-logging.html

Why can't I access APIs deployed in a newly created Jetty base directory?

I am using Jetty server for my apps. I have a web app, and when I deploy it in ${JETTY_HOME}/webapps, it works fine: I can access the APIs I have created locally and remotely.
But when I create a new Jetty base directory, and deploy my web app there, I cannot access these APIs and I get a 404 error.
Any idea about things I might have done incorrectly? I am new in web development, so any help will be very much appreciated.
Update: So these are the steps I did when I created the new Jetty base directory:
mkdir /opt/web
cd /opt/web
java -jar $JETTY_HOME/start.jar --add-to-start=http,deploy
then I placed my WAR file in /opt/web/webapps. From the new jetty base directory, I started the server with
java -jar $JETTY_HOME/start.jar jetty.port=8000
This is the log when the server started.
WARNING: Property jetty.port in <command-line> already set in /opt/web/start.ini
2015-05-14 12:11:49.973:INFO::main: Logging initialized #659ms
2015-05-14 12:11:50.278:INFO:oejs.Server:main: jetty-9.2.10.v20150310
2015-05-14 12:11:50.310:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/opt/web/webapps/] at interval 1
2015-05-14 12:11:51.271:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /myapi, did not find org.eclipse.jetty.jsp.JettyJspServlet
2015-05-14 12:11:51.305:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext#47cdc2ce{/myapi,file:/tmp/jetty-0.0.0.0-8000-myapi.war-myapi-any-1456158384990153592.dir/webapp/,AVAILABLE}{/myapi.war}
2015-05-14 12:11:51.328:INFO:oejs.ServerConnector:main: Started ServerConnector#5171c41f{HTTP/1.1}{0.0.0.0:8000}
2015-05-14 12:11:51.329:INFO:oejs.Server:main: Started #2015ms

Stuck Installing Selenium Server for Python

I am trying to use the Selenium standalone server with Python. However, when I type
"C:\Program Files (x86)\Java\jre7\bin\Java.exe" -jar selenium-server-standalone-2.32.0.jar
into the command prompt, the setup gets stuck displaying
May 22, 2013 3:38:18 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
15:38:18.388 INFO - Java: Oracle Corporation 23.21-b01
15:38:18.389 INFO - OS: Windows 7 6.1 x86
15:38:18.394 INFO - v2.32.0, with Core v2.32.0. Built from revision 6c40c18
15:38:18.473 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
15:38:18.474 INFO - Version Jetty/5.1.x
15:38:18.475 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
15:38:18.475 INFO - Started HttpContext[/selenium-server,/selenium-server]
15:38:18.476 INFO - Started HttpContext[/,/]
15:38:18.498 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#166faa
c
15:38:18.499 INFO - Started HttpContext[/wd,/wd]
15:38:18.501 INFO - Started SocketListener on 0.0.0.0:4444
15:38:18.502 INFO - Started org.openqa.jetty.jetty.Server#144752d
I'm not sure how to get around this problem, any help would be much appreciated.
I don't think you have a problem - that looks to me like the selenium server has started successfully, and is now running. Do you have a problem connecting to it and running a script?

Selenium standalone server jar file hangs

I'm having an issue running the Selenium standalone server -- it just hangs partway through loading. I've tried several different versions of the standalone server but the same issue arises. From the command line I run...
java -jar selenium-server-standalone-2.25.0.jar
And get back...
Oct 16, 2012 8:29:34 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
20:29:40.190 INFO - Java: Apple Inc. 20.10-b01-428
20:29:40.193 INFO - OS: Mac OS X 10.7.4 x86_64
20:29:40.202 INFO - v2.25.0, with Core v2.25.0. Built from revision 17137
20:29:40.322 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
20:29:40.324 INFO - Version Jetty/5.1.x
20:29:40.324 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
20:29:40.326 INFO - Started HttpContext[/selenium-server,/selenium-server]
20:29:40.326 INFO - Started HttpContext[/,/]
20:29:40.376 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#1f8b81e3
20:29:40.377 INFO - Started HttpContext[/wd,/wd]
20:29:40.382 INFO - Started SocketListener on 0.0.0.0:4444
20:29:40.383 INFO - Started org.openqa.jetty.jetty.Server#4ee1d5ea
If the comment does not help, try changing start command to
java -jar lib/selenium-server-standalone-2.25.0.jar -role hub
(It is command for starting Selenium Grid, so it might be wrong for you, but I dont know what are you trying to achieve)
And as mentioned above, after the command is run
DO NOT CLOSE COMMAND LINE
Open browser and load http://127.0.0.1:4444/
You should see something like this:
You are using grid 2.25.0
Find help on the official selenium wiki : more help here
default monitoring page : console

Categories