users@glassfish.java.net

Couldn't deploy a Java EE 5 EAR with asadmin & run AppClient using Ant

From: <glassfish_at_javadesktop.org>
Date: Thu, 21 Oct 2010 06:47:03 PDT

Hi Forum members,

I need the following advice on deploying & running a FundsBean.ear (Java EE 5) to GF2.1 server (Netbeans 6.7 bundled) on Windows XP platform:

( i ) How / why the following deployment command line failed to deploy FundsBean.ear when it was possible to do it with "ant run-deploy":

C:\Documents and Settings\Jack\FundsBean>[b]asadmin deploy --retrieve c:\Temp "C:\Documents and Settings\Jack\FundsBean\dist\FundsBean.ear"[/b]

Command deploy executed successfully with following warning messages: Error occurred during application loading phase. The application will not run properly. Please fix your application and redeploy.
WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: Error while loading application [FundsBean]. Please refer to the server log for more details.

Below is the exception listing from GF server log:

[#|2010-10-21T23:30:59.206+1100|SEVERE|sun-appserver2.1|javax.enterprise.system.container.ejb.mdb|_ThreadID=17;_ThreadName=httpWorkerThread-4848-0;_RequestID=e0a1e2f3-1bd5-4187-b423-fc4263f5ca1d;|com.sun.enterprise.connectors.ConnectorRuntimeException
com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource not created : jms/fundsQueue
                at com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.getPhysicalDestinationFromConfiguration(ActiveJmsResourceAdapter.java:1591)
        at com.sun.enterprise.connectors.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1421)
        at com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:170)
        at com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java:209)
        at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:524)
        at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:527)
        at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:191)
        at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
        at com.sun.enterprise.server.ExtendedApplicationLoader.doLoad(ExtendedApplicationLoader.java:134)
        at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:238)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
        at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)


On the other hand, I had no problem deploying it using Ant as follows:

C:\Documents and Settings\Jack\FundsBean>asadmin list-application-refs
__ejb_container_timer_app
admingui
adminapp
WSTXServices
__JWSappclients
MEjbApp
WSTCPConnectorLCModule
FundsBean
JBIFramework
Command list-application-refs executed successfully.

C:\Documents and Settings\Jack\FundsBean>[b]ant run-deploy[/b].......
-do-ear-dist-with-manifest:
      [jar] Building jar: C:\Documents and Settings\Jack\FundsBean\FundsBean-app-client\dist\FundsBean-app-client.jar
-do-compile-deps:
.....
     [copy] Copying 1 file to C:\Documents and Settings\Jack\FundsBean\build-deploy-ant:
     [echo] Deploying dist/FundsBean.ear
[sun-appserv-deploy] Executing: deploy --user admin --passwordfile "C:\DOCUME~1\Jack\LOCALS~1\Temp\sjsas76927835" --host localhost --port 4848 --force=true -
-enabled=true --name FundsBean --verify=false --precompilejsp=false --upload=true "C:\Documents and Settings\Jack\FundsBean\dist\FundsBean.ear"
[sun-appserv-deploy] Command deploy executed successfully.
   [delete] Deleting: C:\DOCUME~1\Jack\LOCALS~1\Temp\sjsas76927835
.......
BUILD SUCCESSFUL
Total time: 34 seconds

C:\Documents and Settings\Jack\FundsBean>asadmin list-application-refs
WSTCPConnectorLCModule
JBIFramework
FundsBean
MEjbApp
adminapp
WSTXServices
__JWSappclients
__ejb_container_timer_app
admingui
Command list-application-refs executed successfully.

( ii ) How / why to run FundsBean Application Client using Ant which is failing with the following errors:

[b]ant run-ac[/b]:

-as-retrieve-option-workaround:
     [copy] Copying 1 file to C:\Documents and Settings\jack\FundsBean\dist

-tool-FundsBean-app-client:
     [java] 21/10/2010 6:25:19 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
     [java] WARNING: ACC003: Application threw an exception.
     [java] java.lang.IllegalArgumentException: Could not locate an embedded app client matching the display name null
     [java] at com.sun.enterprise.appclient.NestedAppClientInfo.getAppClient(NestedAppClientInfo.java:153)
     [java] at com.sun.enterprise.appclient.AppClientInfo.getAppClient(AppClientInfo.java:205)
     [java] at com.sun.enterprise.appclient.AppClientInfo.validateMainClass(AppClientInfo.java:274)
     [java] at com.sun.enterprise.appclient.AppClientInfo.completeInit(AppClientInfo.java:174)
     [java] at com.sun.enterprise.appclient.AppClientInfoFactory.buildAppClientInfo(AppClientInfoFactory.java:154)
     [java] at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:366)
     [java] at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
     [java] at com.sun.enterprise.appclient.Main.main(Main.java:200)
     [java] Exception in thread "main" java.lang.RuntimeException: java.lang.IllegalArgumentException: Could not locate an embedded app client matching the disp
lay name null
     [java] at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:487)
     [java] at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
     [java] at com.sun.enterprise.appclient.Main.main(Main.java:200)
     [java] Caused by: java.lang.IllegalArgumentException: Could not locate an embedded app client matching the display name null
     [java] at com.sun.enterprise.appclient.NestedAppClientInfo.getAppClient(NestedAppClientInfo.java:153)
     [java] at com.sun.enterprise.appclient.AppClientInfo.getAppClient(AppClientInfo.java:205)
     [java] at com.sun.enterprise.appclient.AppClientInfo.validateMainClass(AppClientInfo.java:274)
     [java] at com.sun.enterprise.appclient.AppClientInfo.completeInit(AppClientInfo.java:174)
     [java] at com.sun.enterprise.appclient.AppClientInfoFactory.buildAppClientInfo(AppClientInfoFactory.java:154)
     [java] at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:366)
     [java] ... 2 more
     [java] Java Result: 1

-java-FundsBean-app-client:

run-FundsBean-app-client:

run:

BUILD SUCCESSFUL
Total time: 1 minute 27 seconds

On the other hand, appclient was able to run FundsBean Application Client properly with the following syntax:

C:\Documents and Settings\jack\FundsBean>[b]appclient -client "c:\Temp\FundsBeanClient.jar" -mainclass client.localFundsproducer app-args[/b]

It is essential to include app-args parameter to prompt appclient to lookup “application.args=OFFLINE
“ in C:\Users\jack\FundsBean\nbproject. I suspect that there is a missing parameter equivalent to “app-args” in “ant run-ac”.

The main() method in FundsBean Application Client (also known as Main Class) references the value of parameter passed through “application.args=OFFLINE“ in C:\Users\jack\FundsBean\nbproject”

This application is working fine (compile, deploy & run application client) in Netbeans.

Any ideas on why these 2 issues are occurring?

Thanks in advance,

Jack
[Message sent by forum member 'htran_888']

http://forums.java.net/jive/thread.jspa?messageID=485851