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.
# 22  
Old 06-23-2010
insert this lines in your /etc/profile (Red Hat Based or Kernel 2.6.30.X)

export PATH=/home/argole/jdk/jdk1.6.0_10
export JAVA_HOME=/home/argole/server/jboss-4.2.0.GA/bin

or /etc/environment (Debian Based - Kernel 2.6.10.X)

export PATH=/home/argole/jdk/jdk1.6.0_10
export JAVA_HOME=/home/argole/server/jboss-4.2.0.GA/bin

close and open again the CLI (terminal) and execute:

./run.sh -b 0.0.0.0 -c projectfolder &
# 23  
Old 06-23-2010
Im using this script
---------------------------------
Code:
#!/bin/sh
# For starting Jboss

JAVA_HOME=/home/argole/jdk/jdk1.6.0_10
JBOSS_HOME=/home/argole/server/jboss-4.2.0.GA

export JAVA_HOME
export JBOSS_HOME

cd /home/argole/server/jboss-4.2.0.GA/bin
echo "Starting JBOSS server"

nohup ./run.sh -b 0.0.0.0 -c default

#nohup ./run.sh -c projectfolder > JBoss.log 2>&1 &
sleep 180
exit

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

and the out put of ur suggestion is

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

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

17:56:07,100 INFO  [Server] Starting JBoss (MX MicroKernel)...
17:56:07,133 INFO  [Server] Release ID: JBoss [Trinity] 4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)
17:56:07,135 INFO  [Server] Home Dir: /home/argole/server/jboss-4.2.0.GA
17:56:07,135 INFO  [Server] Home URL: file:/home/argole/server/jboss-4.2.0.GA/
17:56:07,136 INFO  [Server] Patch URL: null
17:56:07,136 INFO  [Server] Server Name: projectfolder
17:56:07,136 INFO  [Server] Server Home Dir: /home/argole/server/jboss-4.2.0.GA/server/projectfolder
17:56:07,137 INFO  [Server] Server Home URL: file:/home/argole/server/jboss-4.2.0.GA/server/projectfolder/
17:56:07,137 INFO  [Server] Server Log Dir: /home/argole/server/jboss-4.2.0.GA/server/projectfolder/log
17:56:07,137 INFO  [Server] Server Temp Dir: /home/argole/server/jboss-4.2.0.GA/server/projectfolder/tmp
17:56:07,138 INFO  [Server] Root Deployment Filename: jboss-service.xml
17:56:08,323 INFO  [ServerInfo] Java version: 1.6.0_10-rc,Sun Microsystems Inc.
17:56:08,323 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Server VM 11.0-b15,Sun Microsystems Inc.
17:56:08,323 INFO  [ServerInfo] OS-System: Linux 2.6.25-14.fc9.i686,i386
17:56:09,359 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)
17:56:09,436 INFO  [Server] Runtime shutdown hook called, forceHalt: true
17:56:09,436 INFO  [Server] JBoss SHUTDOWN: Undeploying all packages
17:56:09,443 INFO  [Server] Shutdown complete
Shutdown complete
Halting VM

because
conf/jboss-service.xml file is not in this path this file is, can i copy past that directory on this location ?

Moderator's Comments:
Mod Comment Please use code tags, ty

Last edited by pludi; 06-23-2010 at 10:15 AM..
# 24  
Old 06-23-2010
Your production directory must be like this and best way you must preapere to this form without change default env definitions Smilie

Code:
 
# ls -l /home/argole/server/jboss-4.2.0.GA/server/
 
lrwxrwxrwx 1 jboss jboss 20 Jun 16 17:46 conf -> /etc/jbossas/projectfolder
drwxr-xr-x 2 jboss jboss 4096 Apr 21 02:59 data
drwxr-xr-x 2 jboss jboss 4096 Apr 21 02:57 deploy
drwxr-xr-x 2 jboss jboss 4096 Jun 16 17:46 lib
lrwxrwxrwx 1 jboss jboss 24 Jun 16 17:46 log -> /var/log/jbossas/projectfolder
drwxr-xr-x 2 jboss jboss 4096 Apr 21 02:59 tmp
drwxr-xr-x 2 jboss jboss 4096 Apr 21 02:59 work

and

Code:
 
# ls -l  /etc/jbossas/projectfolder
 
-rw-r--r-- 1 jboss jboss  16191 Apr 21 02:57 jacorb.properties
-rw-r--r-- 1 jboss jboss   9000 Apr 21 02:57 jbossjta-properties.xml
-rw-r--r-- 1 jboss jboss  11678 Apr 21 02:57 jboss-log4j.xml
-rw-r--r-- 1 jboss jboss   7595 Apr 21 02:57 jboss-minimal.xml
-rw-r--r-- 1 jboss jboss  37304 Apr 21 02:57 jboss-service.xml
-rw-r--r-- 1 jboss jboss    194 Apr 21 02:57 jndi.properties
-rw-r--r-- 1 jboss jboss   6472 Apr 21 02:57 login-config.xml
drwxr-xr-x 2 jboss jboss   4096 Jun 16 17:46 props
-rw-r--r-- 1 jboss jboss 116976 Apr 21 02:57 standardjbosscmp-jdbc.xml
-rw-r--r-- 1 jboss jboss  71099 Apr 21 02:57 standardjboss.xml
drwxr-xr-x 2 jboss jboss   4096 Jun 16 17:46 xmdesc

# 25  
Old 06-23-2010
I have these mentioned directories when ls
[root@cat12 server]# ls
all default minimal projectfolder

[root@cat12 server]# cd projectfolder/
[root@cat12 projectfolder]# ls
log tmp
# 26  
Old 06-24-2010
Quote:
Originally Posted by shiraz
I have these mentioned directories when ls
[root@cat12 server]# ls
all default minimal projectfolder

[root@cat12 server]# cd projectfolder/
[root@cat12 projectfolder]# ls
log tmp
Hi shiraz

Code:
# cd /home/argole/server/jboss-4.2.0.GA/server/
# cp -r minimal/* projectfolder/

then run your script ok Smilie

regards
ygemici
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