wood burning stoves*
The moose likes JBoss/WildFly and the fly likes Unable to start Jboss-eap server from ANT script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Unable to start Jboss-eap server from ANT script" Watch "Unable to start Jboss-eap server from ANT script" New topic
Author

Unable to start Jboss-eap server from ANT script

Sachin Ramaprasad
Greenhorn

Joined: Sep 01, 2009
Posts: 6
Hi,

I'm trying to stop jboss server and after some time interval start jboss server again in ANT script. This i'm doing it remotely i.e., ANT is running on windows and stop/start jboss task on Linux. So in ANT, i'm using 'sshexec' task which connects to Linux box and doing the task of stop/start jboss server.

On my remote machine (Linux box) there are shell scripts for stopping & starting the Jboss-eap. I'm able to stop the jboss server without any issue in ANT remotely but not able to start the Jboss in the same way i did the stop.

here are my start script in my build.xml:

<sshexec host="${jboss.host}"
username="${username}"
password="${password}"
command="sh start_jboss.sh"
failonerror="true"
trust="true"/>

and this is the error in my build_log:
=================================================================================
[sshexec] Connecting to TSIVM03:22
[sshexec] cmd : sh start_jboss.sh
[sshexec] Failed to boot JBoss:
[sshexec] org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException)
[sshexec] at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
[sshexec] at org.jboss.system.ServiceController.install(ServiceController.java:226)
[sshexec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
[sshexec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
[sshexec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
[sshexec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Abstra
[sshexec] ctMBeanInvoker.java:264)
[sshexec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
[sshexec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
[sshexec] at $Proxy4.install(Unknown Source)
[sshexec] at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
[sshexec] at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
[sshexec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
[sshexec] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
[sshexec] at org.jboss
[sshexec] .deployment.MainDeployer.deploy(MainDeployer.java:766)
[sshexec] at java.lang.reflect.Method.invoke(libgcj.
[sshexec] so.7rh)
[sshexec] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
[sshexec] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
[sshexec] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
[sshexec] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
[sshexec] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
[sshexec] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
[sshexec] at $Proxy5.deploy(Unknown Source)
[sshexec] at or
[sshexec] g.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
[sshexec] at org.jboss.system.server.ServerIm
[sshexec] pl.start(ServerImpl.java:362)
[sshexec] at org.jboss.Main.boot(Main.java:200)
[sshexec] at org.jboss.Main$1.run(Main.java:513)
[sshexec] at java.lang.Thread.run(libgcj.so.7rh)
[sshexec] Caused by: java.lang.reflect.UndeclaredThrowableException
[sshexec] at org.jboss.system.ServiceCreator.install(ServiceCreator.java:236)
[sshexec] at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:455)
[sshexec] at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
[sshexec] ...27 more
[sshexec] Caused by: java.lang.NoClassDefF
[sshexec] oundError: org.jboss.dom4j.DocumentFactory
[sshexec] at java.lang.Class.initializeClass(libgcj.so.7rh)
[sshexec] a
[sshexec] t org.jboss.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
[sshexec] at org.jboss.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
[sshexec] at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:449)
[sshexec] at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:291)
[sshexec] at org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:255)
[sshexec] at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:253)
[sshexec] at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:282)
[sshexec] at java.lang.reflect.Constructor.newInsta
[sshexec] nce(libgcj.so.7rh)
[sshexec] at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233)
[sshexec] at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
[sshexec] at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
[sshexec] at org.jboss.system.ServiceCreator.install(ServiceCreator.java:212)
[sshexec] ...29 more
=================================================================================


P.S.: the start jboss shell script is perfectly working w/out any issues on the remote machine

Does anyone have idea why the Jboss Start is failing?


Thanks,
Sachin


Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Based on this line in the stack trace:

[sshexec] at java.lang.reflect.Method.invoke(libgcj.
[sshexec] so.7rh)

it appears that you are using the GNU Java that comes with most Linux distros. Do not use that! It is not qualified to work with any Java EE app server. Instead, install the a Sun JDK or the OpenJDK and use that.

Also, make sure that the JAVA_HOME is set properly for the account you are using, and that the account has full access rights to the JBoss AS directories.


JBoss In Action
Sachin Ramaprasad
Greenhorn

Joined: Sep 01, 2009
Posts: 6
I don't know what JDK installed on the box. I can find it. But if ANT sshexec task not able to start the jboss, then how I'm manually able to start the Jboss on the box. This is i'm not able to understand. Any help is greatly appreciated. Thanks.

Sachin
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

I already answered this:
Peter wrote:Instead, install the Sun JDK or the OpenJDK and use that.


If you have already installed one of them, make sure JAVA_HOME is set to reference it.

I don't know what JDK installed on the box.

Use your package manager to see what is installed. Personally, I recommend downloading the Sun JDK from Sun's web site and installing it manually - I am leery of the JDKs provided with the Linux distros.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

"Sachin Sr", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sachin Ramaprasad
Greenhorn

Joined: Sep 01, 2009
Posts: 6
You mean to say that since i'm connecting to Linux and running the shell script in Ant (on windows), do i need to install Sun JDK? please confirm. As i told you I'm able to execute the start or stop shell script without any problem by getting into the linux box so is my doubt as to why i've to install Sun JDK.
kapil gurjar
Greenhorn

Joined: Dec 12, 2009
Posts: 3
hi ,
i am also facing the similar type of problem.
i have written a script for jboss startup and when i am running it from same machine(Linux) it is working fine, but when i try to invoke the same script from some other machine(Linux) it gives error.
please help if any body having any idea about it.

thanks
kapil
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Kapil, welcome to Java Ranch.

Please provide the details regarding exactly what you are doing - an excerpt from the build.xml file that starts the app server, and the output from running ant, would be helpful.
kapil gurjar
Greenhorn

Joined: Dec 12, 2009
Posts: 3
hi Peter,
Thanks for response

i have a script for restarting jboss on a linux machine, now when i run that script from the same machine the jboss shutdowns does the cleanup and again starts correctly but when i try to invoke the same script from another machine in the same VLAN ,it stops does cleanup but gives error while starting :
the stack tarce is pasted below:
=========================================================================

JBoss Bootstrap Environment

JBOSS_HOME: /jboss-4.2.3.GA

JAVA: java

JAVA_OPTS: -Djboss.jvmroute.name=perf1 -Dprogram.name=run.sh -server -Xms3072m -Xmx3072m -XX:NewRatio=3 -Xss512k -XX:+UseConcMarkSweepGC -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintTenuringDistribution -Xloggc:gc_detail.log -XX:+UseParNewGC -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+DisableExplicitGC -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+UseTLAB -Djava.net.preferIPv4Stack=true -Djava.library.path=/jboss-4.2.3.GA/bin/native

CLASSPATH: /jboss-4.2.3.GA/bin/run.jar

JBOSS_NATIVE_DIR: /jboss-4.2.3.GA/bin/native

LD_LIBRARY_PATH: /jboss-4.2.3.GA/bin/native:/jboss-4.2.3.GA/bin/native/engines:/jboss-4.2.3.GA/bin/openssl
=========================================================================

12:32:48,993 INFO [Server] Starting JBoss (MX MicroKernel)...
12:32:48,993 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)
12:32:48,994 INFO [Server] Home Dir: /jboss-4.2.3.GA
12:32:48,994 INFO [Server] Home URL: file:/jboss-4.2.3.GA/
12:32:48,994 INFO [Server] Patch URL: null
12:32:48,994 INFO [Server] Server Name: default
12:32:48,994 INFO [Server] Server Home Dir: /jboss-4.2.3.GA/server/default
12:32:48,994 INFO [Server] Server Home URL: file:/jboss-4.2.3.GA/server/default/
12:32:48,995 INFO [Server] Server Log Dir: /jboss-4.2.3.GA/server/default/log
12:32:48,995 INFO [Server] Server Temp Dir: /jboss-4.2.3.GA/server/default/tmp
12:32:48,995 INFO [Server] Root Deployment Filename: jboss-service.xml
12:32:49,277 INFO [ServerInfo] Java version: 1.4.2,Free Software Foundation, Inc.
12:32:49,277 INFO [ServerInfo] Java VM: GNU libgcj 4.1.2 20071124 (Red Hat 4.1.2-42),Free Software Foundation, Inc.
12:32:49,277 INFO [ServerInfo] OS-System: Linux 2.6.18-92.el5,x86_64
12:32:49,405 INFO [Server] Core system initialized
12:32:51,536 ERROR [MainDeployer] Could not create deployment: file:/jboss-4.2.3.GA/server/default/conf/jboss-service.xml
org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
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 $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:251)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at java.lang.reflect.Method.invoke(libgcj.so.7rh)
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(libgcj.so.7rh)
Caused by: java.lang.reflect.UndeclaredThrowableException
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:236)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:451)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
...27 more
Caused by: java.lang.NoClassDefFoundError: org.jboss.dom4j.DocumentFactory
at java.lang.Class.initializeClass(libgcj.so.7rh)
at org.jboss.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
at org.jboss.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:449)
at org.jboss.dom4j.io.SAXReader.read(SAXReader.java:291)
at org.jboss.mx.metadata.XMLMetaData.build(XMLMetaData.java:255)
at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:253)
at org.jboss.mx.modelmbean.XMBean.<init>(XMBean.java:282)
at java.lang.reflect.Constructor.newInstance(libgcj.so.7rh)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:212)
...29 more

12:32:53,915 INFO [Server] Runtime shutdown hook called, forceHalt: true
12:32:53,915 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
12:32:53,925 INFO [Server] Shutdown complete
Shutdown complete
Halting VM


Thank you
kapil gurjar
Greenhorn

Joined: Dec 12, 2009
Posts: 3
Hi peter,
sorry i forgot to mention
it is not build.xml file it is a shell script.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

it is not build.xml file it is a shell script.

[chastisement]Then in that case you should have started a new topic (in the JBoss forum) because your problem most likely has nothing to do with the problem that the original poster had.[/chastisement]

12:32:49,277 INFO [ServerInfo] Java version: 1.4.2,Free Software Foundation, Inc.
12:32:49,277 INFO [ServerInfo] Java VM: GNU libgcj 4.1.2 20071124 (Red Hat 4.1.2-42),Free Software Foundation, Inc.

This is the GNU JVM and will not runn the app server - you need to use the Sun JDK or the OpenJDK.

Also, since this question has nothing to do with Ant or any building scripts, I am moving it to the correct forum.

 
 
subject: Unable to start Jboss-eap server from ANT script
 
Similar Threads
Failed to boot JBoss
Jboss not Starting
jbossuday
stuck with an error while deploying
Jboss start up problems