aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes command deploy failed: Deploying application in domain failed when running batch script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "command deploy failed: Deploying application in domain failed when running batch script " Watch "command deploy failed: Deploying application in domain failed when running batch script " New topic
Author

command deploy failed: Deploying application in domain failed when running batch script

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hi I have been using the GlassFish Console as well as the batch script using ant to build the EJB.jars on the server.

The war files that I don't need will run on this with no problem. I have registered about a dozen so far.

But the others will not deploy. I have this error occurring approximately 9 times on 9 ejbs.

It refers to a PortType in every single one.

For example:

Command deploy failed: Deploying application in domain failed;
gov/hhs/fha/nhic/adapterretrieve/AdapterDocRetrievePortType

I cannot attach the xml file that is being parsed by ant, but I can list it below my signature.

Any ideas are sincerely appreciated.

Thank you,
Michele
==================================================================
XML File Contents:

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="nhinc.deployment" default="deploy">

<taskdef resource="net/sf/antcontrib/antlib.xml"/>

<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>

<if>
<isset property="project.name" />
<then>
<property name="script.root.directory" value="${env.NHINC_SOURCE_DIR}/Product/Install"/>
</then>
<else>
<property name="script.root.directory" value="${basedir}"/>
</else>
</if>

<import file="settings.xml" />

<import file="exclusions.${deployment.environment.configuration.dir.name}.xml" />

<taskdef resource="com/sun/tools/appserver/antlib.xml">
<classpath>
<pathelement location="${glassfish.home}/lib/sun-appserv-ant.jar"/>
<pathelement location="${glassfish.home}/jbi/lib/jbi-ant-tasks.jar"/>
<pathelement location="${glassfish.home}/javadb/lib/derby.jar"/>

<pathelement location="${glassfish.home}/jbi/lib/jbi-admin-cli.jar"/>
<pathelement location="${glassfish.home}/jbi/lib/jbi-admin-common.jar"/>
<pathelement location="${glassfish.home}/lib/appserv-rt.jar"/>
<pathelement location="${glassfish.home}/lib/appserv-ext.jar"/>
<pathelement location="${glassfish.home}/lib/javaee.jar"/>
<pathelement location="${glassfish.home}/lib/appserv-se.jar"/>
<pathelement location="${glassfish.home}/lib/admin-cli.jar"/>
<pathelement location="${glassfish.home}/lib/appserv-admin.jar"/>
<pathelement location="${glassfish.home}/lib/install/applications/jmsra/imqjmsra.jar"/>
</classpath>
</taskdef>

<!--
These properties should be defined in project build.xml files:

<property name="deploy.type" value="ejb" description="options:['war', 'ejb', 'shared']" />
-->

<property name="deploy.application.list.file.path" value="${script.root.directory}/deploy.application.list.xml"/>

<target name="deploy.create.glassfish.password.file" unless="deploy.glassfish.password.file.path">
<tempfile prefix="glassfish" property="deploy.glassfish.password.file.path" destdir="${java.io.tmpdir}" deleteonexit="true"/>
<echo message="AS_ADMIN_PASSWORD=${deployment.glassfish.server.admin.password}" file="${deploy.glassfish.password.file.path}"/>
<echo message="deploy.glassfish.password.file.path: ${deploy.glassfish.password.file.path}"/>
</target>

<target name="deploy">
<antcall target="deploy.to.production" />
</target>

<target name="undeploy">
<antcall target="undeploy.from.production" />
</target>

<target name="deploy.to.production">
<runtarget target="deploy.glassfish.stop.server"/>
<runtarget target="deploy.nhinc.configuration.to.glassfish"/>
<runtarget target="deploy.nhinc.interfaces.to.glassfish"/>
<runtarget target="deploy.shared.libs.to.glassfish"/>

<runtarget target="deploy.glassfish.start.server"/>
<runtarget target="deploy.wars.to.glassfish"/>
<runtarget target="deploy.ejbs.to.glassfish"/>
</target>

<target name="undeploy.from.production">
<runtarget target="deploy.glassfish.start.server"/>
<runtarget target="undeploy.wars.from.glassfish"/>
<runtarget target="undeploy.ejbs.from.glassfish"/>

<runtarget target="deploy.glassfish.stop.server"/>
<runtarget target="undeploy.shared.libs.from.glassfish"/>
</target>

<target name="deploy.glassfish.start.server">
<sun-appserv-admin
explicitcommand="start-domain ${deployment.glassfish.domain.name}"
asinstalldir="${glassfish.home}"
/>
</target>

<target name="deploy.glassfish.stop.server">
<sun-appserv-admin
explicitcommand="stop-domain ${deployment.glassfish.domain.name}"
asinstalldir="${glassfish.home}"
/>
</target>

<target name="deploy.ejbs.to.glassfish">
<var name="target" value="deploy.ejb.to.glassfish"/>
<runtarget target="target.to.call.on.ejbs"/>
</target>

<target name="undeploy.ejbs.from.glassfish">
<var name="target" value="undeploy.ejb.from.glassfish"/>
<runtarget target="target.to.call.on.ejbs"/>
</target>

<target name="target.to.call.on.ejbs">
<xmltask source="${deploy.application.list.file.path}">
<call path="/applications/ejbs/ejb">
<param name="ejb.name" path="name/text()" />
<actions>
<if>
<not>
<isset property="deploy.exclude.ejb.@{ejb.name}"/>
</not>
<then>
<var name="deployment.glassfish.ejb.file.path" value="${deployment.binaries.dir}/@{ejb.name}.jar"/>
<var name="deployment.glassfish.ejb.name" value="@{ejb.name}"/>
<runtarget target="${target}"/>
</then>
</if>
</actions>
</call>
</xmltask>
</target>

<target name="deploy.wars.to.glassfish">
<var name="target" value="deploy.war.to.glassfish"/>
<runtarget target="target.to.call.on.wars"/>
</target>

<target name="undeploy.wars.from.glassfish">
<var name="target" value="undeploy.war.from.glassfish"/>
<runtarget target="target.to.call.on.wars"/>
</target>

<target name="target.to.call.on.wars">
<xmltask source="${deploy.application.list.file.path}">
<call path="/applications/wars/war">
<param name="war.name" path="name/text()" />
<actions>
<if>
<not>
<isset property="deploy.exclude.war.@{war.name}"/>
</not>
<then>
<var name="deployment.glassfish.war.file.path" value="${deployment.binaries.dir}/@{war.name}.war"/>
<var name="deployment.glassfish.war.name" value="@{war.name}"/>
<runtarget target="${target}"/>
</then>
</if>
</actions>
</call>
</xmltask>
</target>

<target name="deploy.shared.libs.to.glassfish">
<var name="target" value="deploy.shared.lib.to.glassfish"/>
<runtarget target="target.to.call.on.shared.libs"/>
</target>

<target name="undeploy.shared.libs.from.glassfish">
<var name="target" value="undeploy.shared.lib.from.glassfish"/>
<runtarget target="target.to.call.on.shared.libs"/>
</target>

<target name="target.to.call.on.shared.libs">
<xmltask source="${deploy.application.list.file.path}">
<call path="/applications/shared/lib">
<param name="shared.name" path="name/text()" />
<actions>
<if>
<not>
<isset property="deploy.exclude.lib.@{shared.name}"/>
</not>
<then>
<var name="deployment.glassfish.shared.lib.file.path" value="${deployment.binaries.dir}/@{shared.name}.jar"/>
<runtarget target="${target}"/>
</then>
</if>
</actions>
</call>
</xmltask>
</target>

<target name="copy.artifacts.to.development">
<mkdir dir="${deployment.binaries.dir}" />
<copy todir="${deployment.binaries.dir}" file="${dist.file}" overwrite="true"/>
</target>

<target name="deploy.ejb.to.glassfish" depends="deploy.create.glassfish.password.file">
<sun-appserv-deploy
user="${deployment.glassfish.server.username}"
passwordfile="${deploy.glassfish.password.file.path}"
host="${deployment.glassfish.server}"
port="${deployment.glassfish.admin.port}"
file="${deployment.glassfish.ejb.file.path}"
asinstalldir="${glassfish.home}"
/>
</target>

<target name="undeploy.ejb.from.glassfish" depends="deploy.create.glassfish.password.file">
<sun-appserv-undeploy
user="${deployment.glassfish.server.username}"
passwordfile="${deploy.glassfish.password.file.path}"
host="${deployment.glassfish.server}"
port="${deployment.glassfish.admin.port}"
name="${deployment.glassfish.ejb.name}"
asinstalldir="${glassfish.home}"
/>
</target>

<target name="deploy.war.to.glassfish" depends="deploy.create.glassfish.password.file">
<sun-appserv-deploy
user="${deployment.glassfish.server.username}"
passwordfile="${deploy.glassfish.password.file.path}"
host="${deployment.glassfish.server}"
port="${deployment.glassfish.admin.port}"
file="{d:/NHINC/NhincCommonWeb.war}"
asinstalldir="${glassfish.home}"
/>
</target>

<target name="undeploy.war.from.glassfish" depends="deploy.create.glassfish.password.file">
<sun-appserv-undeploy
user="${deployment.glassfish.server.username}"
passwordfile="${deploy.glassfish.password.file.path}"
host="${deployment.glassfish.server}"
port="${deployment.glassfish.admin.port}"
name="${deployment.glassfish.war.name}"
asinstalldir="${glassfish.home}"
/>
</target>

<!-- this script was replaced on 11/24/2010 by Michele Smith at Indiana State Department of Health
because it pointed to the c:\ drive and everything needs to run on the d:\ drive

<target name="deploy.shared.lib.to.glassfish">
<copy file="${deployment.glassfish.shared.lib.file.path}" todir="${glassfish.home}/lib" overwrite="true" />
</target>-->

<target name="deploy.shared.lib.to.glassfish">
<copy todir="d:/Sun/AppServer/domains/domain1/lib" overwrite="true">
<fileset dir="d:/NHINC">
<include name="**/*"/>
</fileset>
</copy>
</target>




<target name="undeploy.shared.lib.from.glassfish">
<basename property="deployment.glassfish.shared.lib.file.name" file="${deployment.glassfish.shared.lib.file.path}"/>
<delete file="${glassfish.home}/lib/${deployment.glassfish.shared.lib.file.name}" />
</target>

<target name="delete.glassfish.domain">
<if>
<available file="${deployment.glassfish.domain.home}" type="dir"/>
<then>
<trycatch property="error">
<try>
<runtarget target="deploy.glassfish.stop.server"/>
<sun-appserv-admin
explicitcommand="delete-domain ${deployment.glassfish.domain.name}"
asinstalldir="${glassfish.home}"
/>
</try>
<catch>
<echo message="${error}"/>
<!-- if delete-domain or stop-domain command failed, try to delete domain directory -->
<!-- workaround for locked domain1/conf/.domain-registry.system file on Windows -->
<sleep minutes="1"/>
<delete includeemptydirs="true" verbose="true">
<fileset dir="${deployment.glassfish.domain.home}" defaultexcludes="false"/>
</delete>
</catch>
</trycatch>
</then>
</if>
</target>

<target name="create.glassfish.domain" depends="deploy.create.glassfish.password.file">
<propertyregex property="deploy.glassfish.domain.template"
input="${deployment.domain.template.file.path}"
regexp="\\"
replace="/"
casesensitive="false"
global="true"
defaultValue="${deployment.domain.template.file.path}"/>
<sun-appserv-admin
explicitcommand='create-domain --template ${deploy.glassfish.domain.template} --user ${deployment.glassfish.server.username} --adminport ${deployment.glassfish.admin.port} --passwordfile "${deploy.glassfish.password.file.path}" --savemasterpassword=true ${deployment.glassfish.domain.name}'
asinstalldir="${glassfish.home}"
/>
</target>

<target name="backup.glassfish.domain">
<copy todir="${deployment.dir}/backup" verbose="true" overwrite="true" failonerror="false">
<filelist dir="${deployment.glassfish.domain.config.home}">
<file name="log4j.properties"/>
<file name="mpi.xml"/>
</filelist>
</copy>
<copy todir="${deployment.certificate.home}" verbose="true" overwrite="true">
<fileset dir="${deployment.glassfish.domain.config.home}" erroronmissingdir="false">
<include name="*.jks"/>
</fileset>
</copy>
</target>

<target name="restore.glassfish.domain">
<copy todir="${deployment.glassfish.domain.config.home}" verbose="true" overwrite="true">
<filelist dir="${deployment.dir}/backup">
<file name="log4j.properties"/>
<file name="mpi.xml"/>
</filelist>
</copy>
</target>

<target name="deploy.nhinc.configuration.to.glassfish">
<copy todir="d:\NHINC\Dev" verbose="true" overwrite="true">
<fileset dir="d:\NHINC/${deployment.environment.configuration.dir.name}"/>
</copy>
</target>

<target name="deploy.nhinc.interfaces.to.glassfish">
<copy todir="d:\NHINC\interfaces\schemas\nhin" verbose="true" overwrite="true">
<fileset dir="d:\NHINC\interfaces\schemas\nhin"/>
</copy>
</target>

<target name="glassfish.install.domain.certificates">
<copy todir="${deployment.glassfish.domain.config.home}" overwrite="true" verbose="true">
<fileset dir="${deployment.certificate.home}">
<include name="*.jks"/>
</fileset>
</copy>
</target>

<target name="recreate.glassfish.domain">
<runtarget target="backup.glassfish.domain"/>
<runtarget target="delete.glassfish.domain"/>
<runtarget target="create.glassfish.domain"/>
<runtarget target="restore.glassfish.domain"/>
<runtarget target="glassfish.install.domain.certificates"/>
</target>

</project>
Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
As it turns out the installation instructions I was given did not say to install every single war in the application. Once I did that and once I also did the following, I was able to install all but one .jar file:

Hello I figured out that my main problem with this was that my As_HOME\lib files were missing some common libraries.

I have just one error now and it is this one:

Deploying application in domain failed; Error loading deployment descriptors for module [GatewaySubscriptionRepositoryEJB] -- Referencing error: This bundle has no bean of name [GatewaySubscriptionReferenceRepository] Error loading deployment descriptors for module [GatewaySubscriptionRepositoryEJB] -- Referencing error: This bundle has no bean of name [GatewaySubscriptionReferenceRepository]

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: command deploy failed: Deploying application in domain failed when running batch script