How do I Start JBoss automatically when boot my linux machine.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How do I Start JBoss automatically when boot my linux machine.
# 1  
Old 06-23-2010
How do I Start JBoss automatically when boot my linux machine.

I have created a script file named 'start-jboss'
-------------------------------------------------
Code:
#!/bin/sh

# For starting Jboss

JAVA_HOME=/home/argole/jdk/jdk1.6.0_10
export JAVA_HOME
cd /home/argole/server/jboss-4.2.0.GA/bin
echo "Starting JBOSS server"
nohup ./run.sh -c projectfolder > JBoss.log 2>&1 &

sleep 180
exit

----------------------------------------------------
and place it in /etc/rc.d/init.d

Create a link using cmd
Code:
ln -s /etc/rc.d/init.d/start-jboss /etc/rc3.d/S84startjboss

*Note: my system's run level is 3.

Using given steps my jboss is not working, plz anyone guide me that whats wrong with this and what i can do to run jboss.

Last edited by pludi; 06-23-2010 at 04:48 AM.. Reason: code tags, please...
# 2  
Old 06-23-2010
any error in server.log?
what happended while start your script?
8080 is listening?
# 3  
Old 06-23-2010
Nothing on server log.
I think the script file is not executing. But when i checked jboss process from grep, it showing that the file have been run 'S84startjboss' but nothing happens.

----------------------------------------------------------
Code:
[root@cat12 ~]# ps auxx|grep jboss
root   1948  0.0  0.0   4800  1156 ?    S  12:26  0:00 /bin/sh /etc/rc3.d/S84startjboss start
root   2043  0.0  0.0   4120  684 pts/0  S+   12:29   0:00 grep jboss

------------------------------------------------------------

---------- Post updated at 04:25 AM ---------- Previous update was at 03:45 AM ----------

Code:
=====================================================
  JBoss Bootstrap Environment

  JBOSS_HOME: /home/argole/server/jboss-4.2.0.GA

  JAVA: /home/argole/jdk/jdk1.6.0_10//bin/java

  JAVA_OPTS: -Dprogram.name=run.sh -server -Xms1024m -Xmx2048m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=384m -XX:MaxPermSize=512m -XX:-UseGCOverheadLimit -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true

  CLASSPATH: /home/argole/server/jboss-4.2.0.GA/bin/run.jar:/home/argole/jdk/jdk1.6.0_10//lib/tools.jar

=========================================================

13:10:05,389 INFO  [Server] Starting JBoss (MX MicroKernel)...
13:10:05,422 INFO  [Server] Release ID: JBoss [Trinity] 4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)
13:10:05,423 INFO  [Server] Home Dir: /home/argole/server/jboss-4.2.0.GA
13:10:05,423 INFO  [Server] Home URL: file:/home/argole/server/jboss-4.2.0.GA/
13:10:05,424 INFO  [Server] Patch URL: null
13:10:05,424 INFO  [Server] Server Name: projectfolder
13:10:05,425 INFO  [Server] Server Home Dir: /home/argole/server/jboss-4.2.0.GA/server/projectfolder
13:10:05,425 INFO  [Server] Server Home URL: file:/home/argole/server/jboss-4.2.0.GA/server/projectfolder/
13:10:05,425 INFO  [Server] Server Log Dir: /home/argole/server/jboss-4.2.0.GA/server/projectfolder/log
13:10:05,425 INFO  [Server] Server Temp Dir: /home/argole/server/jboss-4.2.0.GA/server/projectfolder/tmp
13:10:05,426 INFO  [Server] Root Deployment Filename: jboss-service.xml
13:10:06,766 INFO  [ServerInfo] Java version: 1.6.0_10-rc,Sun Microsystems Inc.
13:10:06,766 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 11.0-b15,Sun Microsystems Inc.
13:10:06,767 INFO  [ServerInfo] OS-System: Linux 2.6.25-14.fc9.i686,i386
13:10:07,393 INFO  [Server] Core system initialized
Failed to boot JBoss:
org.jboss.deployment.DeploymentException: url file:/home/argole/server/jboss-4.2.0.GA/server/projectfolder/conf/jboss-service.xml could not be opened, does it exist?
	at org.jboss.deployment.DeploymentInfo.<init>(DeploymentInfo.java:214)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:781)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
	at $Proxy5.deploy(Unknown Source)
	at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
	at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
	at org.jboss.Main.boot(Main.java:200)
	at org.jboss.Main$1.run(Main.java:508)
	at java.lang.Thread.run(Thread.java:619)
13:10:07,436 INFO  [Server] Runtime shutdown hook called, forceHalt: true
13:10:07,436 INFO  [Server] JBoss SHUTDOWN: Undeploying all packages
13:10:07,443 INFO  [Server] Shutdown complete
Shutdown complete
Halting VM

-----------------------
I didn't have conf/jboss-service.xml file as there is no conf directory. So can i find this file.
Moderator's Comments:
Mod Comment Please use code tags, ty

Last edited by pludi; 06-23-2010 at 06:32 AM..
# 4  
Old 06-23-2010
But jboss-service.xml file is must be for which type deployers used in jboss
so jboss-service.xml contains core services configurations

maybe its in different dir?
# 5  
Old 06-23-2010
My path of this file is as
/home/argole/server/jboss-4.2.0.GA/server/minimal/conf/jboss-service.xml
instead of this
/home/argole/server/jboss-4.2.0.GA/server/projectfolder/conf/jboss-service.xml

so what i need to do, plz
# 6  
Old 06-23-2010
do you see that when you are trying to run the jboss startup scrip, the necessary prerequisites are fulfilled like mount points are available and other dependencies are met
# 7  
Old 06-23-2010
let be try this instead of /run.sh portion

Code:
./run.sh -server -classpath /home/argole/server/jboss-4.2.0.GA/bin/run.jar:/usr/lib/jvm/java/lib/tools.jar org.jboss.Main -c projectfolder -b 0.0.0.0

Code:
# grep JBOSSCONF run.sh | head -n 1

What output this comma?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Start a service manager process automatically on startup

Hello, I am in the process of learning Linux OS. How do I run the below lines of code automatically as root on server startup. cd /opt/program_folder/ServiceManager/bin nohup ./servce_manager DEV & Currently, as soon as the server is up and running I log in as root (as this... (6 Replies)
Discussion started by: rparavastu
6 Replies

2. Linux

How to start pc automatically when power comes (Server)?

Can anyone tell me how to start pc automatically when power comes, here I just want to start server automatically, on boot, my server starts automatically because I have written some startup commands in rc.local file but if power fails, then how can I boot automatically (2 Replies)
Discussion started by: Akshay Hegde
2 Replies

3. Ubuntu

Customizing XUbuntu 12.04 Live CD - Start my Exe Automatically

Hi all http://ubuntuforums.org/images/smilies/smiley-faces-80.gif, I am customizing the LIVE CD of Xubuntu 12.04.. I removed the ubiquity package and changed the live username and hostname using uck-gui.. I am almost done with the customization. Now after the splash screen , the text in motd... (1 Reply)
Discussion started by: selvarajvss
1 Replies

4. UNIX for Advanced & Expert Users

start some services automatically

Hello All i have a question related to some services,i want to start some services with server linux centos. i make "chkconfig httpd on" and "chkconfig asterisk on",but when i verify with chkconfig --list i found httpd 0: off 1: off 2: on 3: on 4: on 5: on 6:... (6 Replies)
Discussion started by: bernard12
6 Replies

5. UNIX and Linux Applications

How do I Start postgre SQL automatically when boot my linux machine

Can any body give me the script to start postgre SQL 8.3.1 when boot linux? (2 Replies)
Discussion started by: shiraz
2 Replies

6. Ubuntu

How can I automatically start a daemon at boot time.

Hi masters, I am still learning trades in kernel. I am trying to learn the basic of daemon programming. Can any one tell me how can I start a daemon automatically during boot up. I will be greatfull if anyone post some example code to the above task. Also what are... (3 Replies)
Discussion started by: iamjayanth
3 Replies

7. Red Hat

boot the 32 bit kernel on a 64 bit PPC Linux machine?

Hi all, I'm looking to cover a corner case for an upcoming test cycle. Is there a way to boot a RedHat Advanced Server 4 (update 3) installed on a Power PC machine to use a 32 bit kernel? This would be similar to what is done here -> https://www.unix.com/aix/26204-aix-platform.html I've done... (0 Replies)
Discussion started by: philrau
0 Replies

8. Solaris

Database can't start automatically on solaris

Hi, I have installed oracle 9i on solaris 10 sucessfully. I have configured listener & tnsname.ora file sucessfuly. Even i can start database manully by starting listener first and from sqlplus promt data base sucessfully. Now i want to start the database automatically after system reboots. I... (2 Replies)
Discussion started by: Sachin Vaidya
2 Replies

9. Solaris

How to start Oracle database automatically

How to start Oracle database automatically when after SunSolaris is being re-booted? TIA, Greg (3 Replies)
Discussion started by: greg0320
3 Replies

10. UNIX for Dummies Questions & Answers

getting postfix tyo start automatically

Postfix has an initscript just like sendmail did so while logged in as root, simply type: ntsysv and select postfix. The message above is from the Redhat postifx FAQ. I tried running ntsysv and postfix is not listed as a selection. I can start postfix manually without any problems, but I need... (2 Replies)
Discussion started by: kmgrady01
2 Replies
Login or Register to Ask a Question

Featured Tech Videos