Java App running as a service in background needs to display a GUI message

Its a client server application. Where in the application runs as a service. When the database connections is lost, it logs the information in the log files that application will retry after sometime. What i need is instead of logging the information, i want to pop-up a message box stating the same log message.
Now i have tried few things:
1) while running it as a service, i go the service's properties -> logon tab-> select "allow service to interact desktop"
This solves my problem and displays the message. But i don't want my user to see the ugly black console all the time.
Let me know if anyone can give me a better solution to the same.

Hi,
Please provide more details....
Now i have tried few things:
1) while running it as a service, i go the service's properties -> logon tab-> >>select "allow service to interact desktop"Do you use any third party tools or what?
This solves my problem and displays the message. But i don't want my user to see the ugly black console all the time. If you have developed it yourself then what is the problem?
You can change it right??? And what is black console you are talking about?? Command line??
Thank You.
Regards,
Jay

Similar Messages

  • What path to use to access network files from Java app running on Mac

    I have a Java app running on a Mac with OS X that I'm using to check for files that exists on Windows servers within our network.
    Using a path like /Volumes/<Share>/ works because I've already connected to the drive using Finder. If I try to use a fully qualify the path with "smb://<Server>/<Share>" then my app doesn't see anything. Is there any way that I can get Java to connect to a directory without first having mapped or made the connection via some external tool like Finder?
    Here's the code I'm testing with:
    package FileImports;
    import java.io.File;
    import java.util.Arrays;
    public class Dir {
    static int indentLevel = -1;
    static void listPath(File path) {
    File files[];
    indentLevel++;
    files = path.listFiles();
    if (!(files == null)){
    Arrays.sort(files);
    for (int i = 0, n = files.length; i < n; i++) {
    for (int indent = 0; indent < indentLevel; indent++) {
    System.out.print(" ");
    System.out.println(files.toString());
    if (files[i].isDirectory()) {
    listPath(files[i]);
    indentLevel--;
    } else System.out.println("Directory not accessible!");
    public static void main(String args[]) {
    // this path works where <share> = the directory where my files exist.
    listPath(new File("/Volumes/<share>"));
    // this path returns a null result in files
    // listPath(new File("smb://<Server>/<Share>/"));
    Thanks,
    Alex
    Edited by: agates on Sep 25, 2008 11:14 AM

    agates wrote:
    Thanks for the response. I'll have to dig a little deeper into JCIFS. It looks like it would work great windows to windows. I haven't been able to find in the documentation where it would work on OS X without having to mount the targeted file system first. Has anyone had success creating a connection to a windows file system from OS X with JCIFS?Since jCIFS is written in pure Java and implements the entire SMB/CIFS protocoll on it's own it doesn't require any support from the OS (apart from a normal JVM runnig). Thus it should work exactly the same in OS X and Windows (and Linux and Solaris and ...).

  • Run Java App as a Windows Service

    Hi,
    Is there an easy way (without 3rd party software) to run a Java app as a service in windows?
    Sorry if this isn't the right forum to post to...
    Any help would be greatly appreciated!
    Thanks in advance!

    Nope there isn't. And there also isn't a reason not to use 3rd party software as there is an excellent open source API to do this job: Java Service Wrapper.

  • Can a Java app run in the background?

    I want to put an app on a server that runs at a certain time of day (probably something like midnight, not sure yet) that just performs a task without any notifications. Is Java suitable for this task?

    You are looking more to run as a service in windows or a damon in Unix. Do a google on "java windows service" and see what comes up. Last I checked there was a JNI structure given to use and step by steps on how to get what you want to happen.

  • Multiple Java apps running in one VM

    I have one VM that runs one application with GUI, database. It also spawns another VM to run more apps through Sockets.
    Is there a way to run several Java apps within a single VM? If so, I can get rid of those interprocess communication stuff and make things easier.
    Thanks in advance.
    Lee

    Yes you can do what to want to do. It is actually very benificail. Take a look at this article:
    http://java.sun.com/docs/books/performance/1st_edition/html/JPClassLoading.fm.html#24732
    here is code to do it as well:
    package com.ist.system;
    import com.ist.util.LogMsg;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.lang.reflect.Method;
    import java.net.InetAddress;
    import java.net.Socket;
    * This class was pulled from:
    * http://java.sun.com/docs/books/performance/1st_edition/html/JPClassLoading.fm.html#24732
    * It was written to provide the ability to launch many applications in the
    * same JVM.  By doing this, it will save on system resources like RAM.  When
    * the <code>launch</code> method is called, it will check to see if there is a
    * VM already running.  If there is, it will launch the new application in the
    * currently running VM.  If there isn't, it will create a process that will
    * keep a VM alive until there are no more applications running.  Once there are
    * no more applications running, this service will System.exit. 
    public class Launcher {
        static final int socketPort = 9876;
         * This method will launch a new instance of the passed in className
         * in an already running JVM if one is already running.  If one is not
         * running, this application will create one.
         * @param className the class which you wish to launch
        public void launch(String className) {
            LogMsg.shortDebug("Trying to launch: " + className);
            Socket s = findService();
            if (s != null) {
                LogMsg.shortDebug("Launcher found service");
                try {
                    OutputStream oStream = s.getOutputStream();
                    byte[] bytes = className.getBytes();
                    oStream.write(bytes.length);
                    oStream.write(bytes);
                    oStream.close();
                    LogMsg.shortDebug(className);
                } catch (IOException e) {
                    LogMsg.warn("Launcher couldn't talk to service");
            } else {
                LogMsg.event("Starting new service");
                Launcher.go(className);
                Thread listener = new ListenerThread();
                listener.start();
                LogMsg.shortDebug("Started service listener");
        protected Socket findService() {
            try {
                Socket s = new Socket(InetAddress.getLocalHost(),
                socketPort);
                return s;
            } catch (IOException e) {
                // couldn't find a service provider
                return null;
        public static synchronized void go(final String className) {
            LogMsg.shortDebug("Launcher running a " + className);
            Thread thread = new Thread() {
                public void run() {
                    try {
                        Class clazz = Class.forName(className);
                        Class[] argsTypes = {String[].class};
                        Object[] args = {new String[0]};
                        Method method = clazz.getMethod("main", argsTypes);
                        method.invoke(clazz, args);
                    } catch (Exception e) {
                        LogMsg.shortDebug("Launcher coudn't run the " + className);
            }; // end thread sub-class
            thread.start();
            runningPrograms++;
        static int runningPrograms = 0;
         * All programs wishing to exit should call this method and NOT
         * use System.exit.  Calling System.exit will kill all the applications
         * running in this VM.
        public static synchronized void programQuit() {
            runningPrograms--;
            if (runningPrograms <= 0) {
                System.exit(0);
        public static void main(String[] args) {
            LogMsg.setupTraceLevel();
            Launcher l = new Launcher();
            l.launch(args[0]);
    }

  • How I can get current path during a java app running?

    I want to know the running path of the java app is running.
    do me a favor

    Syestm.getProperty(String Key)
    The requires key somethig like "path", or "user.path", not sure. See Javadoc to find the key you need.
    Abraham

  • Proper way to exit with a j2ee java app running in the NW70 j2ee engine

    Hello,
    I am working on migrating an app and it's ear from j2ee 6.20 to 7.0. It deploys okay, but when invoked, the j2ee server restarts. Looking at the part that fails, its trying to create a jco connection, which fails and then it catches the failure and does a stack dump and a System.exit(1). It shuts down and restarts at that point. Is System.exit(1) the proper way to exit a java app that is running within the j2ee engine? If it is, is it possible I am picking up the wrong System.exit and need to use an SAP specific one? I inherited the code, but not the IDE it was written with.
    Thanks,
    Paul D. Chamberlain

    Hi,
    Answered my own question. System.exit(1) should not be used. Return works.
    Paul D. Chamberlain

  • Java program running as win32-service

    Hi,
    I am running Java programs as Win32-Services on a Windows-Cluster with Windows 2000 Service Pack 4. I have written a Wrapper program in C which runs as a Service and creates a JVM. Normally this works fine but now I have on one cluster the problem that I don't have any output in the Console of the Service. All the output which is written with System.out.println to the console just does not appear.
    And if I read input from the console I get the following exception:
    -E-2005-02-15 16:04:44.734: java.io.IOException: The handle is invalid
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java:194)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:220)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
    at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
    at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    at at.co.systema.gf.util.ConsolePrompt$ConsoleTask.run(ConsolePrompt.java:98
    Does anybody have experience with running java programs as Win32 services ?
    Ingo

    Your application needs to be able to run without System.in or System.out
    There is no console for a service.
    Replace System.out with a logger. If you need input you need to write a client which sends the commands to the service.

  • Java app running on Mac OS X

    Hi to all.
    I'm trying to change the name that the dock shows when my java app is running. I have read all this , but the problem that I have is that I want to do it into my code and not from the terminal line.
    I want to do this, from my code.
    -Xdock:name="JUnit on Mac OS X"Anyone knows how to do it?
    Thanks for read.

    Hi to all again.
    I have searched the solution of this problem into other forums and sites and I think that is a very difficult question. Perhaps this forum it's not the better forum to ask this, exists any forum specialized in Java for Mac OS users?
    Edited by: Daniel.GB on 15-ago-2008 15:01

  • Configuration for a java app running on Harpertown.

    HI,
    I have a multi-threaded java app with 5-8 user threads. I'm running my application on intel Harpertown m/c with 8 cores.
    Is there a way I could configure my JVM such that I can I can allocate each core to each thread or atleast maximize such a possibility?
    Thanks,

    Please let me know in case my query is misdirected. I'm new to the forums and thought this would be the right place to post this.
    Thanks,

  • Will my java app run on winXP win 2000 ?

    or do they need to first install the jvm ?

    Java platform runs on any operating system. Install JVM and you are done
    http://www.skillipedia.com

  • Multithreaded Java app calling C via JNI...need help!

    I have a multithreaded Java app making a JNI call into some C code. It is a high speed imaging algorithm that I simply can't/don't want to do in Java. I am very new to JNI and I am hoping to get some expert advice on how to solve this issue. Basically, I need a seperate JNI session (if that is such a thing) per thread. In other words, I need to essentially keep state of each JNI call as it pertains to the current thread.
    The 2 ideas I have thought about are:
    1. Have the native code pass the data back into java, and have the java object hold it. Then, when subsequent native calls are made, you pass the data as a paramter of the native method.
    (This can be painful as it a lot of complicated and/or a lot of data.)
    2. Define some sort of a structure to hold each instance of the data on the C side, returning to java a lookup key. Subsequent native calls include the key as a paramter, and the data is looked up. ( a quick example of this would be nice).
    I would appreciate any information/expereince/pains with this one.
    Thanks!

    2. Define some sort of a structure to hold each instance of the data on the C side, returning to java a lookup key. Subsequent native calls include the key as a paramter, and the data is looked up. ( a quick example of this would be nice).The lookup key, or a simple "pointer", can be returned to Java as a plain old "int" or "long" (I don't know what is the size of the pointers in your platform, if 32 or 64-bit). So you can return a "long", that can be treated by Java programs as an "opaque handle" (a pompous name for things that can't be handled adequately at the "client" side).
    I assume that C/C++ allocates the memory and it remains "fixed" (untouched by garbage collection) between calls. So a real C pointer can be used in such case. If you have some smarter scheme of allocating things in your program, return another kind of lookup key (for instance, if you allocate things in fixed-size C arrays, you can return the index of the C object in the array instead of returning a plain pointer.

  • Java3d speed collapse caused by other java apps running at the same time

    Hi
    I am programming a flightsimulator for some months.
    The current state is online available (all free, no copyrights)
    at http://www.snowraver.org/efcn/efcnsim/index.htm
    especially the sample (source) which shows the
    behaviour which is the reason for my post is here
    http://www.snowraver.org/efcn/efcnsim/page2.htm
    My Problem:
    When I start the sim while two other java programs
    ( one is a server running localhost, one is a client )
    are running, the speed of the flightsim is very slow,
    one frame update takes 3 to 5 seconds.
    ( 3 java.exe's in task list plus 1 which is the IDE )
    When I start the flightsim ALONE, I have 30 to 40 frames per second.
    ( 2 java.exe's in the task list = the flightsim and the IDE -> no prob here )
    That means, the flightsim is about 100 times slower, when
    started while the other two apps are running.
    BUT the other two applications do almost ***NOTHING***, the
    CPU load is 1 or 2 percent.
    Of course they have threads running, but all are waiting
    for a signal - no thread really consumes CPU power.
    Interestingly, when I FIRST start the flightsim and AFTER THIS
    start the two other applications, the flightsim
    holds 30 frames per seconds without problems, even
    though the other applications consume some CPU power
    until they have completely started up.
    Configurations:
    JSDK 1.4.2_1 , 0_2..
    Java3D 1.3.1 OPENGL (The DirectX version crashes with D3D device lost)
    Win2000,XP CPU 800MHz upto 3 GHz
    In my point of view, the java3d thread scheduler makes
    some funny decisions when it starts up, which lead
    to the order dependent behaviour described above.
    My question is, if anyone has some ideas, how I could
    get away from this speed collapse.
    The problem is caused in native code I guess.
    I also could imagine, that it has to do something with
    the order in which one creates, attaches and starts
    the Canvas3D. (? could produce race conditions)
    The flightsim runs in full retained mode. Of course
    the CPU work in the behaviours is rather big, because
    the ROAM triangulation update (..) is done there
    and the triangles are recalculated and passed
    ( all BY_REFERENCE ).
    Or could it have to do something with the memory
    consumption ( when all runs, almost all of
    the 512MB RAM is taken by the three java.exe's ) ?
    Any hints or ideas ?

    :) No, Sun does handle it [lol]
    I just have tested it on my computer at work
    ( 3GHz HP compaq, 1GB Ram and a Intel 82865G Graphics
    Card with 64MB memory, Windows XP )
    and it has worked without problems any way I tried.
    ( Except for xclusive fullscreen mode, but I guess, the administrators
    have deactivated it somehow, so we don't play games at work :)
    I couldn't test it under Linux so far, but I think, this will be less
    problematic than Windows [usually].
    However my current assumption is:
    I totally have forgot the [limited] videocard memory.
    I suppose, Java3D tries to put all triangle data and all
    textures to the videocards memory, so most data processing
    then can be passed to it's graphiccard CPU using
    OpenGL commands.
    Now the flightsim produces a varying amount of (by_reference) triangle data ( a few thousands )
    and has some texture maps for the terrain, the sea and other things,
    plus indexed triangle data for the planes and ships.
    The notebook system, which slows down has an ATI Mobile Radeon card
    with only 32MB RAM onboard, whereas the others have 64MB Ram.
    An additional pointer to that theory is that I can trigger the slowdown by resizing
    the flightsim window, while it is running.
    On the notebook, it holds 30fps, until the window exceeds a size of 962*862 pixels.
    At this size the speed collapses and goes down to 1 frame update every 4 seconds.
    If I make the window a few pixels smaller, the speed of 30fps immediately
    is there again.
    Therefore I guess, some data passed to the graphic cards memory depends
    linearly from the canvas3d's window dimension, and at some limit,
    the graphiccard's memory is too small and Java3D changes it's strategy
    and performs most calculations on the computer's mainmemory,
    which of course is a lot slower.
    I'm not very sure about that, I'm just speculating.
    Next thing I will try is to disable directdraw for the other two applications,
    possibly swing also uses graphicscard memory, when directdraw is enabled.
    The solution seems to be clear anyway: The flightsim must examine the system
    and set some parameters depending on the machine's capabilities.
    Onboard videagraphic ram is one of them. If it's too slow, I start to decrease
    the window size and expect to see a sudden increase of speed, as soon as
    the rendering can be done by the graphicscard CPU. If this never happens,
    I assume no OpenGL accelerator is present on that system. This can be seen as a method
    for finding out the amount of videocard memory on a system by trial and error ..?:)
    Thanks for your tips, Alain.
    I especially have to check out the data sharing class in 1.5.

  • Running OC4J services in Background on Windows

    I would like to run the OC4J services in background, can someone please provide me a solutions. Presently working on OBIEE Build Repositories.
    Thanks in advance,
    Samson.
    Edited by: user630453 on Apr 26, 2009 9:06 PM

    Start
    Settings
    Control Panel
    System
    Advanced
    Performance Options
    Choose "Background services", press OK.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Chris Boz Jennings" <[email protected]> wrote in message
    news:3cb6e2fc$[email protected]..
    >
    My web application is acting up. I am using WebLogic 5.1 and just migratedfrom
    Win NT4 to Win2K Pro. The new system has 1 gig RAM and a P4 running at 1.8GHz.
    This problem is not an issue on my old system (P3, 256 meg RAM, Win NT4).The
    app uses Struts too.
    OK, so here's what's happening as best I can describe it. When I submit aform
    from a web browser, WL reacts very very very slowly utill the Weblogicwindow
    is brought to the foreground. It doesn't stall completely, but a requestthat
    should take a fraction of a second can stretch out for minutes.
    If anyone can give me a clue, I'd sure appreciate it.
    Thanks,
    boz

  • Critical: Java app Processes dying in Linux

    Hi,
    I have come across a critical error on our production system. We have some java apps running as linux background processes. We used to run these off a jdk1.3 box with no problems using
    nohup java App &
    We have upgraded to jdk1.4 but very randomly our apps are just disappearing from the background processes!
    I have using the -verbose and -Xprof options to java and found this logging information..
    Flat profile of 0.11 secs (1 total ticks): SIGHUP handler
    Thread-local ticks:
    100.0% 1 Blocked (of total)
    I don't know if this holds any clues but a SIGHUP is a hangup signal and even though we use nohup, it does seem to kill the processes.
    Would be very grateful for advice.

    Following links can explain about -Xrs and other options.
    http://java.sun.com/j2se/1.4.1/docs/tooldocs/windows/java.html
    http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/java.html

Maybe you are looking for

  • 500 Internal Server Error in FiletoFile Scenario

    Hi All, Here we are doing FiletoFile Scenario but not on our Central Instance we are using LocalPlainJ2SE Adapters for both sender and receiever so we configured PlainJ2SEFile Adapters in both ends.In the ID of XI i configured th *XI recievr adapter*

  • PC connecting to Xserve 10.5.8

    When I try to connect to my xserve from a pc the login shows up as Machine/User. I only have user names setup on the server. Is there something I need to change on the PC or on the Xserve. I am running 10.5.8. I can turn on allow guest to get around

  • Updated to 7.0 and lost video file purchased from iTunes

    I updated my iTunes today and a video file I purchased from iTunes in February is gone. The file is still on my iPod because I have not sync'ed it yet. I know that once I do the file is lost for good. Is there a way of preserving it and putting it ba

  • I tunes wont open... is there a phone number!!!

    Is there a number that i can call to talk to some one about my itunes not opeaning !!!

  • RenderKitId and ViewHandler in JSF1.2

    I've been reading the JSF 1.2 spec, and I am a bit confused about how the ViewHandler interacts with the view's renderKitId. From the JSF 1.2 Final Draft (May 2006), Section 9.4.20 (f:view) indicates that the renderKitId attribute is set in this orde