Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat as service -> cannot start WINWORD.exe

 
Fusari William
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i'm using tomcat 6.0.29 with jdk 1.6.0_21 and i'm in Windows (7 at 64 bit, but i've try in Windows 7 32 bit, Windows Vista, Windows Xp).

I've got a servlet that create file "example.doc".
When it finish i want to start Word and open my document.

I try 3 way:
(FinalFile="example.doc")

1)
where execfile.exe is my application write in C that open calling system function.

2)

3)
where "open_document.bat" call "start C:\MELCOS\run\web\tomcat6029\webapps\MELCOS\fronte_quadro\example.doc"

If i start manually Tomcat, i see in Task Manager process Tomcat started with my administrator user and all of 1-2-3 solutions start WINWORD.exe and Microsoft Word open without problem.
If Tomcat is Windows' service, i see in Task Manager process Tomcat started with SYSTEM user and all of 1-2-3 solutions start WINWORD.exe, but Microsoft Word don't open.

I try to use CGI....web.xml and context.xml were modify without problem:

1) web.xml


2) context.xml


I create folder WEB-INF\cgi and i paste my files here (execfile.exe and open_document.bat).
I call via URL: http://localhost:8082/MELCOS/cgi-bin/execfile.exe or http://localhost:8082/MELCOS/cgi-bin/open_document.bat.

Nothing.....process WINWORD.exe start with SYSTEM user, and interface of Microsoft Word don't appear.

I've try to modify catalina.policy; i add these:



But nothing....same problem...

What i've to do?

Help me please!

Thanks very much and sorry for my bad english.

BeLakor88
 
Karthik Shiraly
Bartender
Pie
Posts: 1192
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
- Type services.msc from Start menu > Run
- Find the Tomcat6 service in the Services window
- Right click > Properties > LogOn tab > Check "allow service to interact with desktop"

PS: Running something like Word with system account is a bad idea, security wise. If this is a production level solution, you should prefer launching Word with regular account privileges using "runas" command or some such.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karthik Shiraly wrote:

PS: Running something like Word with system account is a bad horrible idea, security wise. If this is a production level solution, you should prefer launching Word with regular account privileges using "runas" command or some such.


Don't forget that some of the most infamous infections of the Internet were done courtesy of security holes in MS Office!
 
Fusari William
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karthik Shiraly wrote:Try this:
- Type services.msc from Start menu > Run
- Find the Tomcat6 service in the Services window
- Right click > Properties > LogOn tab > Check "allow service to interact with desktop"

PS: Running something like Word with system account is a bad idea, security wise. If this is a production level solution, you should prefer launching Word with regular account privileges using "runas" command or some such.


Nothing with check...i've just try it.
Nothing with runas because all of my account haven't password.

Other ideas?
 
Fusari William
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm try with PsTools (PsExec.exe), but nothing....it start without problem if i call it directy, if i call it in a servlet it start with SYSTEM user and don't run anything.

I've got another idea: i create a demon who start when tomcat service start, listening port 33350 (for example), and when i try to connect to this port from my servlet, it open my document.

It's a good idea?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic