Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5840633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:46:34+00:00 2026-05-22T11:46:34+00:00

I need to launch a web service automatically on a RedHat server. The web

  • 0

I need to launch a web service automatically on a RedHat server. The web service works and can be loaded manually through NetBeans.

Trying to make it so that the user only needs to perform a single command line or similar to get it running.

Started with getting GlassFish server up and running (used http://blogs.oracle.com/foo/entry/run_glassfish_v3_as_a mainly, with some input from other sources)

This led to me doing the following;

-Added new user

groupadd glassfish

useradd -s /bin/bash -d /home/glassfish -m -g glassfish glassfish 

-Logged in as said user

sudo -i -u glassfish 

-Installed glassfish

cd ~

unzip glassfish-v3.zip

rm glassfish-v3.zip

-Left the shell

-Copied in script to /etc/init.d and configured it as an executable

cp <script file as shown below> /etc/init.d/glassfish 

chmod +x /etc/rc.d/init.d/glassfish

* THE SCRIPT *


#!/bin/sh
# Platform Services for GlassFish
#
GF_USER=glassfish
GF_HOME=/home/$GF_USER/glassfishv3/glassfish
ASADMIN=$GF_HOME/bin/asadmin
SU="su --login  $GF_USER --command  "

case "$1" in start)
    $SU "$ASADMIN start-domain > /dev/null 2>&1 &";;stop)
    $SU "$ASADMIN stop-domain > /dev/null 2>&1 &";;restart)
    $SU "$ASADMIN restart-domain > /dev/null 2>&1 &";;\*)
    echo "usage: $0 (start|stop|restart|help)"esac

Can start/stop/restart with;
sudo /etc/init.d/glassfish start|stop|restart

The problem is, I believe, that Glassfish is running but my little Java web service isn’t. I’m not surprised that the java web service isn’t running as I never included it in the above, but how do I set it up so that my web service is run?


I came in this morning and realised that I needed to deploy the java client. I did this by following the instructions from

http://download.oracle.com/docs/cd/E19798-01/821-1757/geyvr/index.html

For deploying applications automatically.

But now using this method my windows web-client can’t talk to my RedHat host, but they are perfectly happy when started manually.

The only difference I can think of is that the user on the Redhat machine when starting the services manually is “root” (which is a bit dangerous for a web application). But when starting the client automatically, it runs as a user… Of course this could be a complete red herring….

Any ideas guys?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:46:35+00:00Added an answer on May 22, 2026 at 11:46 am

    Deploy your web service as an application in Glassfish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to launch a server on the remote machine and retrieve the port
I need to launch a media file from a URL from within my c#
for e.g from command prompt I need to launch the exe with some switch
We need to reliably get the Quick Launch folder for both All and Current
I need to be able to launch a process and read the output into
need ask you about some help. I have web app running in Net 2.0.
I know how to launch a youtube video within an iOS web view, but
I need to save a NSMutableDictionary in NSUserDefaults. I have searched the web for
I've a web application, which works without any problem in my browser. But if
Need a function that takes a character as a parameter and returns true if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.