7 Replies - 2486 Views - Last Post: 12 June 2014 - 06:05 AM Rate Topic: -----

#1 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Use CF to detect servlets in Tomcat

Posted 09 June 2014 - 01:21 PM

Hello,

Is it possible to use CF code to detect what servlets are and are not running in Tomcat? I'm not finding anything via Google, on this subject.

V/r,

^_^
Is This A Good Question/Topic? 0
  • +

Replies To: Use CF to detect servlets in Tomcat

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Use CF to detect servlets in Tomcat

Posted 10 June 2014 - 04:59 AM

I've never heard of such. That said, I don't know much about servlets or Tomcat in general. If the servlets are stored in a folder on the same server as CF, you should be able to do a CFDIRECTORY of the appropriate folder and see what's in there.

I know that doesn't mean they're running though. How does one tell what servlets are running on Tomcat now?
Was This Post Helpful? 0
  • +
  • -

#3 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Use CF to detect servlets in Tomcat

Posted 10 June 2014 - 05:41 AM

I've been searching all day, yesterday, to no avail. There is getPageContext(), which does have some classes for servlet, but I've not been able to actually discover anything in that. Doing a CFDUMP, gradually going deeper past the getPageContext(), shows some things, but not what I'm looking for.

V/r,

^_^
Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Use CF to detect servlets in Tomcat

Posted 10 June 2014 - 03:11 PM

Well, don't give up yet. There is another possibility.

If there is an executable you can run on the server that can reveal what servlets are running...you might could call it with CFEXECUTE and get something from that. It's why I asked how you would get that information now.

If the application you can call can produce some kind of a result file, you can use CFEXECUTE to call that executable, pass in the params your application needs and retrieve whatever file the application produces...which you presumably could then parse for the info you need.
Was This Post Helpful? 0
  • +
  • -

#5 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Use CF to detect servlets in Tomcat

Posted 11 June 2014 - 12:23 PM

So, theoretically, if Tomcat has a command that can show what servlets are running AND it is within CF's reach to cfexecute AND if cfexecute is allowed, then there might be a way.

Dev environment, that might work. But production has cfexecute disabled. :(

V/r,

^_^
Was This Post Helpful? 0
  • +
  • -

#6 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Use CF to detect servlets in Tomcat

Posted 11 June 2014 - 01:05 PM

Ah. Well. If CFEXECUTE is disabled then, yes, that won't work.

Another alternative is to setup a scheduled event on the server that does the same thing and perhaps drops the servlet status into a .txt file or something that you could read with CF.
Was This Post Helpful? 0
  • +
  • -

#7 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Use CF to detect servlets in Tomcat

Posted 12 June 2014 - 05:51 AM

Certainly feasible. Now to find if there is anything in CF folders that can run that on Tomcat processes. :)

Thank you,

^_^
Was This Post Helpful? 0
  • +
  • -

#8 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Use CF to detect servlets in Tomcat

Posted 12 June 2014 - 06:05 AM

What I meant was, whatever program you can find that can tell you about the state of Tomcat servlets, see if that program can gen some kind of file output. Then what you do is use CFFILE to read that output file and see if you can't parse the info you need from that.

Maybe schedule whatever this external, servlet reporting program to run however often you need it to run (to make sure the servlet info it gens is fresh). The CF part would only be for reading and parsing the output file from that process.

This post has been edited by Craig328: 12 June 2014 - 06:06 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1