How to check if Tomcat runnning using Embedded Tomcat - tomcat6

In reference with one of the articles: Howto embed Tomcat 6?
I understood how to embed tomcat in a java application. Thanks for that.
However I need to know if there is any elegant method provided by org.apache.catalina.startup.Embedded to check if the container is already started or not?
For example, if I create a batch file for the example given in the link above and click it twice; second time it would fail with JVM_BIND error; tomcat is running.
Please help.

You could use the example code given on the Tomcat wiki
http://wiki.apache.org/tomcat/HowTo#How_do_I_check_whether_Tomcat_is_UP_or_DOWN.3F_There_is_no_status_command
Note: This doesnt use Embedded
It is trying to connect to the Tomcat ip:port and seeing if it responds.

Related

Trigger selenium project without human intervention

I have completed automation script of my project. Now client wants to run selenium test case using URL or API. Client is not interested in Jenkins as well since they should need access for my project.
Overall client wants to trigger selenium without human intervention.
Any other idea than above is also welcome.
Thanks in Advance!!
You can provide command line or batch file depends on TestFramework(TestNg, Nunit, MsTest).
For e.g. You can use Mstest/TestContainer:Dll_Name ......some more parameters.
For TestNg, You can use Java "Jar file path" org.testing.TestNG testconfig.xml
Here i am just giving hints to you. Correct way to do it will depend on test framework used.

Unable to start Zookeeper on windows

Hello I am trying to use SolrCloud on different machine. for that I have refereed these documents: here & here
But I am facing an issue: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain in windows
Here is a screenshot:
Can you please help how to Start Zookeeper server on windows.
Please note I have tried to run with command zkServer as well without start word.
Make sure you have zookeeper-3...jar in your classpath.
Its generally placed in zookeeper/dist-maven/
You can add up that location too in ur zkServer.cmd

Flash drive webserver

Hopefully someone here can help me out.
Currently I have a small AngularJS app. I want to put this on an USB drive and make it very easy to run. The idea is someone can just plug in the drive click a file and run the app. I've been thinking about using node for this and then make a little script that would start the server and app. So people can click the script and the app runs. The problem is however (afaik) you need to have node installed on the computer which can't be done.
The client hasn't got his webserver running and still want to run the app. So please don't tell me why would you make an angular app and wanna run it without webserver.
Hopefully anyone has any solution or idea to make this work.
So in short:
AngularJS Application on USB
Plug in the USB, click a file and run the app in the browser.
Thanks for reading and thinking with me.
Have you considered running a standard web server on the USB Stick?
I see that you have suggested Node, but another alternative could be to use XAMPP?
XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl. The XAMPP open source package has been set up to be incredibly easy to install and to use.

db derby StartNetworkServer

I have problem with starting derby server.
My derby version: db-derby-10.11.1.1
I followed this tutorial:
http://db.apache.org/derby/papers/DerbyTut/ns_intro.html
but after typing: startNetworkServer.bat there is no response:
https://www.dropbox.com/s/bo1tgfj8gf2533i/derby_issue.PNG?dl=0
Could you help me?
Maybe there is some problem with my localhost?
I think that i install Derby correctly because after typing: java org.apache.derby.tools.sysinfo
I got some result
regards
The bug is in the localization (for me in cs localization) and the derby server does not print exceptions by default.
Workaround: Under windows in the console run the following commands:
set "DERBY_OPTS=-Duser.language=en -Dderby.drda.debug=true"
startNetworkServer.bat
The first line adds two options for java/derby. First option to change the local language to en and the second one enables printing debug messages to the console.
The second line runs the server (add path if needed).
Another workaround is adding the missing localization key DRDA_MissingNetworkJar.S to file org\apache\derby\loc\drda\messages_cs.properties inside derbynet.jar.
I had this problem with using derby in 1.8.0_45 but changing the DERBY_HOME back to 1.8.0_31 solved it.
This may occurs due to different Java version in your local.
Try using jdk 11. It works fine and networkserver gets started.
Please check out different versions so that you may get solution.

Where can I find HotRod file : startServer.bat (Windows users)

I downloaded infinispan-6.0.0.Final-all.zip.
I need to implement Infinispan Server, using HotRod protocol, but, I don't find at all the file startServet.bat that they mention in their documentation.
Can anybody give me the right link to get it? or the best thing would if somebody give me a small sample of code.
Thank you a lot!
Please refer to Infinispan Server Guide.
In the download link, you imagine that *-all.zip would include servers as well. But it doesn't.
The server has now been separated and it's a different download. Once you've downloaded it, run it with /bin/standalone.sh

Resources