Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

Unable to run a java aplication as service or scheduled task

Thread view: 
Lucho - 18 Jan 2008 18:00 GMT
Hi all.
I'm new on this group, so I don't know if I had to post this question
here.
Maybe someone could help me with this issue.
I have this .jar application that connects and sincronices two Sybase
databases. It runs fine, but I have to be logged on the server
(Windows 2K3 SP1) to be able to run the aplication. I had tried to rus
it as a Scheduled task, but it doen't work, because I can't run the
JVM.
I believe that I don't have to tell you that I've no F***ing idea
about programing on JAVA language.
please help,

best regards.
derek - 18 Jan 2008 18:27 GMT
> I have this .jar application that connects and sincronices two Sybase
> databases. It runs fine, but I have to be logged on the server
> (Windows 2K3 SP1) to be able to run the aplication. I had tried to rus
> it as a Scheduled task, but it doen't work, because I can't run the
> JVM.

The easiest i have found to do this is just create a .bat file that calls the java program you want to run.
Then go into scheduled tasks and create a task that calls the .bat program.

.
=====================================================
THIS IS MY SIGNATURE. There are many like it, but this one is mine.
Andreas Leitgeb - 18 Jan 2008 18:35 GMT
>> I have this .jar application that connects and sincronices two Sybase
>> databases. It runs fine, but I have to be logged on the server
>> (Windows 2K3 SP1) to be able to run the aplication. I had tried to rus
>> it as a Scheduled task, but it doen't work, because I can't run the
>> JVM.

Just speculating, if the application doesn't need a GUI (which I assume,
since you obviously want to start it without being logged in), then you
can try adding option "-server" to the java-command-line.

> The easiest i have found to do this is just create a .bat file that calls
> the java program you want to run. Then go into scheduled tasks and create
> a task that calls the .bat program.

Perhaps you need a combination of both, specifying the "-server"-option
inside the .bat file...
Arne Vajhøj - 19 Jan 2008 01:24 GMT
> Just speculating, if the application doesn't need a GUI (which I assume,
> since you obviously want to start it without being logged in), then you
> can try adding option "-server" to the java-command-line.

????

A GUI works fine with -server.

The name -server may be slightly misleading.

It just means "just spend all the time you want JIT
compiling this byte code, because this app is a server
app that will run for days, so investing some startup time
for better optimization will pay off well".

Arne
Andreas Leitgeb - 19 Jan 2008 09:57 GMT
>> Just speculating, if the application doesn't need a GUI (which I assume,
>> since you obviously want to start it without being logged in), then you
[quoted text clipped - 4 lines]
> [ explanation that -server only effects the choice of
>   optimization strategies in the jvm, nothing else]

oops. Seems like I learnt that wrong some years ago...

Thanks for clarifying.
Arne Vajhøj - 19 Jan 2008 01:21 GMT
> I'm new on this group, so I don't know if I had to post this question
> here.
[quoted text clipped - 4 lines]
> it as a Scheduled task, but it doen't work, because I can't run the
> JVM.

It should be possible to get that to work.

And I would say that it is the easiest solution. You can get
software that can wrap a Java app in a Windows service EXE, but
it will be more complex than just using the scheduler.

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.