aspose file tools*
The moose likes Tomcat and the fly likes Tomcat4.1.24 not working as a NT service?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat4.1.24 not working as a NT service??" Watch "Tomcat4.1.24 not working as a NT service??" New topic
Author

Tomcat4.1.24 not working as a NT service??

Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi all friends,
I am running Tomcat4.1.24 as a NT service.And I have created it through below batch file:-
tomcat -install "Apache Tomcat"
"C:\jdk1.3.0_02\jre\bin\classic\jvm.dll" -Xmx256m
-Xms128m -Djava.class.path="d:\Tomcat\jakarta-tomcat-4.1.24\bin\bootstrap.jar"
-Dcatalina.home="d:\Tomcat\jakarta-tomcat-4.1.24"
-start org.apache.catalina.startup.BootstrapService
-params start -stop
org.apache.catalina.startup.BootstrapService -params stop -out "d:\Tomcat\jakarta-tomcat-4.1.24\logs\stdout.log" -err "d:\Tomcat\jakarta-tomcat-4.1.24\logs\stderr.log"
And it also created service on my WinNT4.0 server
successfully.And I have also tested it by opening the home page of Tomcat server on IE by typing in address bar (http://127.0.0.1:8080) and also shows me the home page successfully.But my problem is when I start my application for uploading files then Tomcat server not working(means not writing file on destination).My application is a Uploading software for
transfering files from one destination to another and I have used swing for front end(for reading files) and for back end I have used servlet(for writing files).But when I use Tomcat as a stand alone not as NT service then it is working fine.Can any one plz guide me how I can slove my problem.Eagerly waiting for reply.
Regards
Bikash
[ May 08, 2003: Message edited by: Bikash Paul ]
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 230

This probably occurs because the service treats the current directory different than what you want it to be.
One way is to append the following to the code (as given in your post) for installing the service

HTH,


Debashish
SCJP2, SCWCD 1.4, PMP, ITIL Foundation
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi,
First of all thanks for ur reply but in this way what u have suggested me not slove my problem.If I hard code target directory then user can't change the target directory.In my swing application I have given facility to user so that they can change target computer,directory and folder whereever they want to upload file.From my application when user wants to upload file they first type destination(for example: //192.168.4.70//c//Upload) in my destination text box and my application takes that path in one variable and upload file on destination supplied by user.Can u plz guide me how i can slove this problem.
Thanks & Regards
Bikash
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi,
Now when i try to upload file then it is giving me below error:-
Error: java.io.FileNotFoundException: http://127.0.0.1:8080/examples/servlet/RecvServlet_data?name=MRJ2.zip&path=%2F%2F192.168.3.2%2F%2Fc&size=4235.0KB&dateandtime=09+May+2003+11%3A32%3A05&flag=true
iam using below url for servlet in my swing interface:-
url = new URL(base+"?name="+URLEncoder.encode(file.getName())+"&path="+URLEncoder.encode(path) +"&size="+URLEncoder.encode(st+"KB")+"&dateandtime="+URLEncoder.encode(df1.format(today1))+"&flag="+URLEncoder.encode("true"));
Now I have also add in my previous batch file below options also:
-current "d:\DTMS\upload"
i have fixed a folder which name is "upload" in "d:\DTMS" from which my software takes the file for uploading to remote destination.Can u plz guide me why it is not finding my file.But in case of stand alone tomcat it is working fine.plz guide me.
Regards
Bikash
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi,
Iam trying to write file from my WinNT4.0 computer on which Tomcat is running as a service
on my network computer's "D:\" directory(\\192.168.3.2\d\weft3.zip)through my swing interface.Then it is giving me below error in my servlet log file.Plz help me Iam facing this problem for last one month but till now I couldn't find any proper solution of it.Eagerly waiting for someone reply.
2003-05-27 11:16:03 StandardWrapperValve[RecvServlet_data]: Servlet.service() for servlet RecvServlet_data threw exception
java.io.FileNotFoundException: \\192.168.3.2\d\weft3.zip (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:102
at java.io.FileOutputStream.<init>(FileOutputStream.java:62)
at java.io.FileOutputStream.<init>(FileOutputStream.java:132)

Regards
Bikash
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat4.1.24 not working as a NT service??