What can be issue with Tomcat that it starts in RUN mode but in debug mode it hangs forever? - eclipse

I am using STS(eclipse) and facing a weird issue with Tomcat. It was running fine and all of a sudden it started giving issues. Firstly it responded very slowly and after it did not respond at all in debug mode. While it runs fine when is started in RUN mode but when debugging it waits for something after -
May 15, 2013 9:03:51 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 15, 2013 9:03:51 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
May 15, 2013 9:03:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
The server is stuck forever, seems like it is asking for something from somewhere or so. I did many things like - deleting the server and setting the whole thing again, took a different Tomcat. I did not change any set up for sure.

Make sure you don't have any breakpoints set, this could cause the server to pause during startup.

Check if you have any breakpoints in the declaration of a method
public void myMethod( ParamType myParameter ){ //breakpoint in this line
...
}
You would see the break point marked as [entry] in the breakpoints view in Debug perspective instead of [line: XX] as breakspoints inside implementation are shown.
Disable that breakpoint and try to start server in Debug. This worked for me, hope this helps someone.

Related

Finding out Adobe Experience Manager last restart time

Could anyone please temme how to know when my AEM Author/Publish instance was last restarted? I know it can be done from logs. But which log and is there any keyword with which I can grep the log?
Yes, you can rely on logs to find this out. error.log and stdout.log look promising. You can grep for any of the sling start events from stdout.log. Logs from stdout.log
during restart:
Loading quickstart properties: default
Loading quickstart properties: instance
Quickstart startup at Thu Sep 13 11:54:21 AEST 2018
UpgradeUtil.handleInstallAndUpgrade has mode RESTART
13.09.2018 11:54:21.762 *INFO * [main] Setting sling.home=D:\Tools\aem\author\crx-quickstart (command line)
13.09.2018 11:54:21.772 *INFO * [main] Starting Apache Sling in D:\Tools\aem\author\crx-quickstart
Quicker way:
There is an admin page which will give you last started time OOTB -> http://<<host>>:<<port>>/system/console/vmstat

Wildfly not starting properly

So I have a rather strange issue with wildfly not starting...
If I clean the standalone/deployments of everything but one .war file, wildfly starts perfectly. I can then add in all other .war files(6 in total) and wildfly deploys them without issues.
However if I have all the war files in there and start wildfly it completely fails. It stays in a state where everything is set to .isdeploying for maybe 5 minutes until everything gets set to failed.
The logs that I am getting from service wildfly status
Feb 09 08:49:12 wildfly[2079]: /etc/init.d/wildfly: 3: /etc/default/wildfly: default: not found
Feb 09 08:49:12 wildfly[2079]: * Starting WildFly Application Server wildfly
Feb 09 08:49:43 wildfly[2079]: ...done.
Feb 09 08:49:43 wildfly[2079]: * WildFly Application Server hasn't started within the timeout allowed
Feb 09 08:49:43 wildfly[2079]: * please review file "/var/log/wildfly/console.log" to see the status of the service
Has anyone seen anything like this before?
After looking aroung I found this just before it undeployed everything:
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated t
he service container was 'add' at address '[
("core-service" => "management"),
("management-interface" => "http-interface")
]'
But I am still not sure what i means...
This happened to me too starting on WildFly 11 and above IIRC.
Are you trying to access to the public or management IP while the server is booting? Basically you have to wait until the server has started to access those IPs.
My workaround was use the marker files that deployment scanner checks.
https://docs.jboss.org/author/display/WFLY/Application+deployment#Applicationdeployment-MarkerFiles
Before you start wildfly you have to put a .skipdeploy file for each .war you want to skip. Then, when the server has started you only have to delete that file to let wildfly start the deployment. You can achieve this making a shell script and calling it from your standalone.sh
This error shows that your IP/Port is being used by another process.
Use below command to check it.
For windows: use netstat -aon | find "port number"
You can configure jboss.as.management.blocking.timeout system property to tune timeout (seconds) waiting for service container stabilityas below :
...
</extensions>
<system-properties>
<property name="jboss.as.management.blocking.timeout" value="900"/>
</system-properties>
<management>
...
Or, if still doesn't work this way, collect a series of thread dumps during your startup period so we can see what it might be getting stuck on.

driver.close() is not closing the window

I am trying to close the window using driver.close() code but it's not working
BUt if I am closing with driver.quit() then it's closing but i am getting Test in Red Color . May be it is an Exception or Error but i am not sure.
Below is the message which i am getting
Sep 08, 2015 2:30:26 PM org.openqa.selenium.os.UnixProcess$SeleniumWatchDog destroyHarder
INFO: Command failed to close cleanly. Destroying forcefully (v2). org.openqa.selenium.os.UnixProcess$SeleniumWatchDog#48cff89c
My firefox version is : 40.0.3
selenium Jar is : "selenium-server-standalone-2.46.0"
Use updated jars 2.47.1 is available now(Update server + binding both jars):-
http://docs.seleniumhq.org/download/
One thing one if you are switching between any pages then you need to switch back on same page to close that page with driver.close();

Sessions not working in Sinatra app when packaged with warbler

I've created a simple sinatra app, but can't get sessions to work when running it as an executable war.
I've verified that it works when run via "jruby -S rackup", but when run with "java -jar myapp.war", I find that the session is reset on each request:
INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
session: {"session_id"=>"75936d3d21367f5c1896e749ba401d7715e41a5fd01317484faa44d80c8afaea", "csrf"=>"60367cb6c5ead39b2669668ed28db3a1", "tracking"=>{"
HTTP_USER_AGENT"=>"9f3d63482f1fb48a317c5c9e2de6196f9cd239cc", "HTTP_ACCEPT_LANGUAGE"=>"66eae971492938c2dcc2fb1ddc8d7ec3196037da"}}
Jul 20, 2014 8:00:20 PM winstone.Logger logInternal
INFO: 0:0:0:0:0:0:0:1 - [20/Jul/2014 20:00:20] "GET / " 200 765 0.1670
session: {"session_id"=>"19d266ffb8ccb29108464961e68fa9e29f1c3b45e0097806b4cbc8db156d71d7", "csrf"=>"5ac12991c2ec8d4acf22180d79c494c2", "tracking"=>{"
HTTP_USER_AGENT"=>"9f3d63482f1fb48a317c5c9e2de6196f9cd239cc", "HTTP_ACCEPT_LANGUAGE"=>"66eae971492938c2dcc2fb1ddc8d7ec3196037da"}, "name"=>"john"}
Jul 20, 2014 8:00:31 PM winstone.Logger logInternal
INFO: 0:0:0:0:0:0:0:1 - [20/Jul/2014 20:00:31] "GET /login/john " 200 9 0.0240
session: {"session_id"=>"60f161941822b4f0fae9085db58fe9ea30e86d56dc16fff2ea5859bb4008c58f", "csrf"=>"7dd3977bef9fca9c7ed9b77fdc774657", "tracking"=>{"
HTTP_USER_AGENT"=>"9f3d63482f1fb48a317c5c9e2de6196f9cd239cc", "HTTP_ACCEPT_LANGUAGE"=>"66eae971492938c2dcc2fb1ddc8d7ec3196037da"}}
Jul 20, 2014 8:00:40 PM winstone.Logger logInternal
Other than setting sessions to be enabled, is there any special setup that is needed to have sessions work when the app is packaged with warbler and run as an executable war?
nothing special should be needed - I tried your sample and it worked fine.
it's probably a bug with the jruby-rack version you're using ... please try >= 1.1.15
also I would recommend to try out the jetty webserver (you'll find an option at config/warbler.rb) ... I'll try to make sure jetty is the default for a future Warbler version.

Eclipse, Tomcat, Jersey /JAXB: Hot redeployment problems

I'm using a setup specified in the title. Nothing unusual.
Many times (almost always), after saving a file (HTML or JS! Not even Java!), and re-loading the webpage hosted on this Tomcat (which uses Jersey & Jaxb etc), I get a bunch of:
Apr 10, 2014 12:52:23 PM com.sun.jersey.spi.container.ContainerResponse logException
SEVERE: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException: javax.xml.bind.JAXBException - with linked exception:
[java.io.FileNotFoundException: ... loader/META-INF/services/javax.xml.bind.JAXBContext (No such file or directory)]
at com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.writeTo(AbstractRootElementProvider.java:159)
What have I done to deserve this? :-)
The implication is that I have to stop, and re-start Tomcat every time, and that wastes a lot of time.
PS
'Automatic publish after build event' = true
module--> auto reload = false
I spent hours trying to solve this, googling the hell out of these terms, and getting back a lot of irrelevant stuff.
Thank you!