How to start Tomcat from within KNIME (and continue on with the workflow...)

So, I can start Tomcat with the following using the Python Source node...

from subprocess import call
from pandas import DataFrame
call(["/home/brian/Desktop/Bioinformatics/GenePattern/Tomcat/bin/", "run"])
output_table = DataFrame()

And I know it is working because I can then access GenePatternServer from a webbrowser.  But, in KNIME the process never comes to completion...just like the terminal never closes if I run it from bash.  Any ideas?


Hi Brian,

Not sure what is your use case. If you just want to start (and not necessaryly wait till it gets started), you might try Popen. (As tomcat is also based on Java, probably I would create an extension for that use case though.)

Cheers, gabor

Thanks for the Popen suggestion - it could well be useful in the future.

I ended up just doing the following:

2 Bash nodes in a row:

1st:  fuser -k 8888/tcp

2nd:  bash /home/brian/Desktop/Bioinformatics/GenePattern/Tomcat/bin/ start

The first command is because Tomcat will start and immediately stop if the Tomcat port is in use for whatever reason.

The second command is after I gave full permissions to the Tomcat folder.  It was not working from the Bash node in KNIME if I had to use sudo.

My problem before was that I was using "run" instead of "start".  Run keeps the console open so you can view the log while start writes it to file.