How to run Standalone Server as a Service in Linux

Hi,
I need run an Standalone server in Java as a Service in Linux RedHat?
How to do this? some example or link to helpful sample code?
How I can execute as a service in Linux RedHat 9 the following server Application?
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.net.*;
import java.util.*;
// Listen on a port for connections and write back the current time.
public class NBTimeServer_1 {
private static final int DEFAULT_TIME_PORT = 8900;
// Constructor with no arguments creates a time server on default port.
public NBTimeServer_1() throws Exception {
acceptConnections(this.DEFAULT_TIME_PORT);
// Constructor with port argument creates a time server on specified port.
public NBTimeServer_1(int port) throws Exception {
acceptConnections(port);
// Accept connections for current time. Lazy Exception thrown.
private static void acceptConnections(int port) throws Exception {
// Selector for incoming time requests
Selector acceptSelector = SelectorProvider.provider().openSelector();
// Create a new server socket and set to non blocking mode
ServerSocketChannel ssc = ServerSocketChannel.open();
ssc.configureBlocking(false);
// Bind the server socket to the local host and port
//InetAddress lh = InetAddress.getLocalHost();
InetSocketAddress isa = new InetSocketAddress(port);
ssc.socket().bind(isa);
SelectionKey acceptKey = ssc.register(acceptSelector,
SelectionKey.OP_ACCEPT);
int keysAdded = 0;
while ((keysAdded = acceptSelector.select()) > 0) {
// Someone is ready for I/O, get the ready keys
Set readyKeys = acceptSelector.selectedKeys();
Iterator i = readyKeys.iterator();
// Walk through the ready keys collection and process date requests.
while (i.hasNext()) {
SelectionKey sk = (SelectionKey)i.next();
i.remove();
ServerSocketChannel nextReady =
(ServerSocketChannel)sk.channel();
// Accept the date request and send back the date string
Socket s = nextReady.accept().socket();
// Write the current time to the socket
ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream());
oos.writeObject(new Zaehler("usr","msg"));
I thanks in Advance your valuable help.

Crossposted.

Similar Messages

  • How to register Essbase server with Shared Services?

    Hello All,
    How to register Essbase server with Shared Services?

    Hello All,
    How to register Essbase server with Shared Services?

  • How to run the Server Side Existing rule in Exchange 2010

    Hi All,
    There were requirement to create a auto forward rule for almost more than 5000 users, which we did, but the we want to apply this rules to the messages which are already in the inbox for all those users where we have created the rule.
    Right now the problem what we are facing is for each individual we have to take full access to their mailbox and execute the rule first time and then it works.
    this is becoming challenging for us to making this for all 5000 users. the other problem is those user are not regularly login to this mailbox, they are using some other Org mailbox, so even we can not communicate to all of them.
    Q1) How to run the Server Side Command which should forcefully apply whatever rules is created for that user should execute for the messages which are already in the inbox.
    Q2) or the powershell for for specific rule name, which can apply on the for all the messages which are there in the inbox.
    Any help would be appriciated!
    Thanks in adv champions!
    Ashku

    Hi Ashku,
    If these 5000 users are all users in your Exchange organization, a inbox rule can be created by the following commands:
    Get-Mailbox | foreach {New-InboxRule -Mailbox $_.Name -Name AutoForward -From [email protected] -ForwardTo UserB}
    Based on my test, the Inbox rule created in server side also cannot work on the message that have already been in the Inbox unless users click “Run Rules Now…” in their Outlook client. And the transport rule in Exchange server only works
    during the message sending process.
    Therefore, there may be no feature in Exchange server side to meet your requirement.
    Thanks for your understanding.
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How to run report server in oracle 9i DS

    hi..
    can any 1 tell me how to run report server in oracle 9i DS
    i've installed oracle 9i DS, but don't know how to run
    report server.
    actually i want to run a report from my form
    on button press trigger.. some of the experts r tellin
    that 1st u check whether report server is running or not..
    so pls tell me how to install report server.
    while installing oracle 9i DS, i've given Mail server
    as mysmtp.com
    Thanks
    amit

    hi ..
    i've to go in this directory n run
    rwserver -install repservername
    where repserver name is my mailserver..
    this will install reports server
    Amit

  • Telnet on port 7 says connection refused, how to run echo server

    where do I need to look at echo server configuration.
    how to run echo server on solaris 10 X86.

    I got the answer -- svcadm

  • How to run weblogic server in backgroud?

    I just installed weblogic60sp1 on Aix.
    how can i start weblogic server in backgroud?
    Ron

    Hi Kartheek,
    If you're new to running WebLogic as a Windows service, you'll probably find it a bit tricky at first. I found troubleshooting problems, especially start-up and process-crashes, awkward at first. If you have time, you may want to check these out:
    [ http://connectionserver.blogspot.com/2009/06/weblogic-as-windows-service.html|http://connectionserver.blogspot.com/2009/06/weblogic-as-windows-service.html]
    [http://e-docs.bea.com/wls/docs81/adminguide/winservice.html|http://e-docs.bea.com/wls/docs81/adminguide/winservice.html]
    -Jones

  • How to run a server program in the background on Linux or Windows?

    I just finished writing a Java network application with multiple clients and one server.
    However, I am not sure how I can run the server (SomeServer.class) in the background on Windows. Also when I am running it on Linux, I don't want it to terminate when I logout of the Linux shell.
    To run the server on Linux, should I use a command like this?
    nohup java -cp . SomeServer.class > output.txt &
    Or is there another command, or perhaps some code that I can add to the program so that it would run in the background automatically and/or continues even when I logout of the Linux shell??
    Sometimes, I also like to run the program on a Windows XP machine for testing purpose. How can I do it so that it runs in the background without openning a Console/Command Prompt window??
    (redirecting the standard output to a file)
    And is there an easy way to create a EXE file that runs the program with the default JRE in windows?

    On many UNIX systems there's a utility called detach which will launch the following command in such a manner that killing the shell will not kill the process. On systems that lack this command, I'd find an open source implementation and install it.

  • HOW TO RUN ABAP SERVER PROXY IN BACKGROUND?

    Hi All,
    I have a ABAP Server Proxy running in WAS 6.20. This Server Proxy runs as a foreground Process when the scenario is executed. if we run a scenario with huge load or run scenarios with continuous load, due to the fact that the server proxy runs as a foreground process, the system slows down and has some performance issues. How to handle this issue.Is there a way to run the Server Proxy as a background Job. Please do help me out.
    Regards,
    Sundararamaprasad.

    hi,
    here's an idea: encapsulate your proxy call inside an object which can be ran in background.... like an IDoc !
    Steps:
    create a zidoc in ECC and use it from PI to ECC to send data (instead of your direct abap proxy call).
    Afer that, in z_function_module which is used to intregate your zidoc, call your abap proxy.
    in WE20 (partner profile), the process mode of your idoc should be of course "Triggered by background program", and then use a job on program RBDAPP01 (with a variant limited to your zidoc) to process your idocs.
    Note:
    1. the only interest to do that compare to create a real IDoc interface is just (in my mind) to call a common proxy or to want to reuse an existing proxy without too more effort.
    2. of course your current proxy call should be asynchronous.
    I never tested it, so it's without warranty !
    Regards.
    Mickael

  • How can install SQL Server 2008 Integration Services without CD?

    How can install SQL Server 2008 R2 Integration Services without CD?
    The PC with Windows 7 32-bits is far away and poor bandwidth . So, I want to install SQL Server 2008 Integration Services without CD.
    Does any installer for SSIS only?

    Copy the install media from a memory stick, portable drive or network.
    Arthur My Blog

  • How to run App server applications in Client systems

    Hi all,
    I m new to Oracle Devsuite 10g and App server. I configured the app server and i m able to run in my local machine (server) but i m not able to run in some others machines. even though i have given same path.
    its displaying page cannot be dispalyed
    My path is http://vagee/forms/frmservlet?config=TEST_APPS
    please tell me how to run in client systems?
    Regards,
    Kalyan

    hi
    thanks for your reply. i found the problem. In server machine Firewall was in On Mode. So that it was not allow to access. then i have switched off the firewall. now its running well in client systems also.
    thank you.

  • How to run Indesign CS3 as a Service with Port number

    Hello all,
    I would like to run the InDesign CS3 Server as a service on Windows. It seems that after installing the Server it automatically installs as a service. But where can I assign the port number. If under Services properties of InDesign Server under Parameters I mention -port 1050 on Ok button it removes the parameter information.
    I am doing right or is there some other way to start the Server as Service with Port number.
    Thank you all in advance.
    Regards
    Farzana.

    Hi Sascha,
    have you tried to remove the service and install it manually?
    \"Path to IDS"\InDesignServerService /install /u
    \"Path to IDS"\InDesignServerService /install
    I guess you've tried to start the instance in the console already (successfully?).
    Regards
    Ingo
    Am 05.07.2011 um 12:18 schrieb 1000grad_Sascha:
    Hi Ingo,
    I've installed the Snap-In and configured one instance. Maybe it's worth mentioning that there are some instances running at the same time, which have been started using the console. Hope that's not interfering. However, the MMC-configured instance uses a different port.
    I tried to start the service with a huge range of users having all imaginable privileges. The common way of using either "LocalService" or the Local System Account (which has admin rights for me) doesn't do the job.
    cheers,
    Sascha
    >

  • How to run weblogic server in background process on Windows XP 2002 ?

    Hi,
    I have installed weblogic server 9.2 in Windows XP 2002, I want to start my weblogic server and instances in background and keep running .
    Can anybody please provide information on the same ?
    Thanks in Advance,
    Kartheek.

    Hi Kartheek,
    If you're new to running WebLogic as a Windows service, you'll probably find it a bit tricky at first. I found troubleshooting problems, especially start-up and process-crashes, awkward at first. If you have time, you may want to check these out:
    [ http://connectionserver.blogspot.com/2009/06/weblogic-as-windows-service.html|http://connectionserver.blogspot.com/2009/06/weblogic-as-windows-service.html]
    [http://e-docs.bea.com/wls/docs81/adminguide/winservice.html|http://e-docs.bea.com/wls/docs81/adminguide/winservice.html]
    -Jones

  • How corba client and server find Naming service

    hello
    i want to ask how corba client and server find the Naming service ?
    10x

    By using a well-known port (I think the default for JavaIDL's NS is 1049) on a well-known address (localhost).
    As these values are not really standard, you can specify them when starting the server and client (+-ORBInitialPort 1050 -ORBInitialHost localhost+). See the documentation .

  • How to run Indesign CS6 as a service

    Is there any posiblity to run indesign CS6 as a service, in a separate server or PC?

    You could use InDesign Server, that can be run as a service. Have a look at its documentation for more details.
    -Manan

  • How to run O9iAS as a Win2K Service?

    We installed 09iAS using "0C4J_extended.zip". We would like to run 09iAS as a proper service within W2K instead of starting it manually within a MS-DOS box.

    I haven't tried this with oc4j, but I've had good luck in the past with SRVANY.EXE out of the Windows NT Resource Kit for perl scripts, etc...
    Just a thought.
    Jeff

Maybe you are looking for

  • How to Deploy a web Application

    Can Any one tell me the right procedure to Deploy A web Application on the server. I have made the application using Html,Servlets,JSP,Java beans,web.xml now I have lots of html,java class file At this moment I have put all the classes file in \WEB-I

  • The 'Edit folder' link doesn't appear in content area portlet (URGENT)

    Hi! I made three content areas, and published them as portlets in a page. However, when I enter the page as an authorized user, I don't see the 'Edit folder' link on any content area portlet. But if I enter to any of the content area pages with the s

  • Upcoming UPDATES

    Is apple going to come out with any type of video camera for the Iphone. and are they ever going to be able to send pictures to other phones in the future? They say theres an App for everything....Why cant it do easy things that my moms old cheap cel

  • Need Information on af:query component

    Hi, I need some information on the <af:query> component in JDev 11g. When using ADF 11g's new component, ADF Query (af:query) whether the default "All Queryable Attributes" or on other newly defined View Criterias: 1     What are the disadvantages of

  • Selection screen in one line

    this is ma code SELECTION-SCREEN : BEGIN OF BLOCK A WITH FRAME TITLE TEXT_001. *SELECTION-SCREEN : BEGIN OF LINE . *SELECTION-SCREEN : COMMENT 3(20) TEXT_002 for field s_fkart. *SELECT-OPTIONS   : S_FKART FOR VBRK-FKART NO INTERVALS NO-DISPLAY. *SELE