Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

tomcat as service -> cannot start WINWORD.exe

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 25850
184
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic