Tags: amhaving, ant, app, approaches, ear, file, ibm, install, installation, remote, script, software, was5, websphere, wsadmin-jacl

app installation using Ant\wsadmin-jacl

On Software » IBM/Websphere

11,816 words with 3 Comments; publish: Sun, 25 May 2008 09:05:00 GMT; (400156.25, « »)

Hi,

I am trying to install an ear file on a *REMOTE* WAS5.1, and I am

having problems...

I am using an Ant script, and trying two approaches - using the

wsInstallApp task, or using the wsAdmin task to run a jacl script that

performs installation and application configuration. I manage to

connect to the server and things start running fine, but in both

approaches when the actual installation occurs I get a NoClassDefError

on one of the classes that I use in my code. This class is indeed not

in the ear file nor is it in the server classpath(it is in a shared

lib that is "connected" to the app after installation), but WHY does

it matter?!?

I am performing *NO* deployment operations, hence no code

generation/compilation is required for my installation. When I install

the ear through the admin console, everything works just fine. Note

that I run the Ant script from a remote computer with ws_ant to set

all IBM required settings.

3 Questions:

1) Why am I getting this behavior?

2) How can I add necessary classes to the classpath for "installation

time"?

3) Does anyone know where I can find info on the options that can be

passed to the "options" attribute in the wsInstallApp task?

Any help will be highly appreciated...

Uri.

All Comments

Leave a comment...

  • 3 Comments
    • Sorry, won't be able to help you with first two questions (we're also

      deploying an ear to the remote WAS instance but copy the file there

      and then run wsadmin.sh locally. Fortunately, it works so far .

      As about the third one:

      * There's a table in "Professonal IBM WebSphere 5.0 Application

      Server",

      Appendix A. See the relevant section below.

      * $AdminApp options

      $AdminApp help <option name>

      * http://publib.boulder.ibm.com/infoc...

      nServer

      WebSphere Application Server -> All topics by feature -> System

      administration -> Scripting

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      Options

      The valid options for any of the $AdminApp operations listed above

      include:

      Option

      Description

      appname <appname>

      The name of the application.

      BindJndiForEJBMessageBinding { <ejbmodulename> <ejbname> <uri>

      <lpjndiname> }+

      The listener port JNDI name you want given to your Message Bean.

      BindJndiForEJBNonMessageBinding { <ejbmodulename> <ejbname> <uri>

      <ejbjndiname> }+

      The JNDI name you want given to your (non-MDB) EJB.

      cell <cellname>

      The name of the cell.

      cluster <clustername>

      The name of the cluster.

      contextroot <contextrootname>

      The context root for the web application.

      CorrectOracleIsolationLevel { <modulename> <referencebinding>

      <jndiname> <isolationlevel> }+

      The isolation level for Oracle data sources.

      CorrectUseSystemIdentity { <ejbname> <ejbmodulename> <uri>

      <methodsignature> <role> <username> <password> }+

      The run-as-role policy to use.

      DataSourceFor10CMPBeans { <ejbmodulename> <ejbname> <uri> <dsjndiname>

      <username> <password> }+

      The data source to use for a specific 1.x CMP EJB.

      DataSourceFor20CMPBeans { <ejbmodulename> <ejbname> <uri> <dsjndiname>

      <resauthpolicy> }+

      The data source to use for a specific 2.0 CMP EJB. The resauthpolicy

      can one of:

      "per connection factory" or "container".

      DataSourceFor10EJBModules { <ejbmodulename> <uri> <dsjndiname>

      <username> <password> }+

      The default data source to use for the 1.x EJBs in the specified

      module.

      DataSourceFor20EJBModules { <ejbmodulename> <uri> <dsjndiname>

      <resauthpolicy> }+

      The default data source to use for the 2.0 EJBs in the specified

      module. The resauthpolicy can one of:

      "per connection factory", "container".

      defaultbinding.cf.jndi <cfjndiname>

      The JNDI name of the default

      connection factory.

      defaultbinding.cf.resauth <resauthpolicy>

      The resauth policy to assume for the default connection factory.

      defaultbinding.datasource.jndi <dsjndiname>

      The JNDI name of the default data source.

      defaultbinding.datasource.password <password>

      The password to assume for the default data source.

      defaultbinding.datasource.username <username>

      The username to assume for the default data source.

      defaultbinding.ejbjndi.prefix <jndiprefix>

      The default JNDI prefix to assume for EJBs.

      defaultbinding.force

      Use to force the default bindings to be used in place of the existing

      bindings.

      defaultbinding.strategy.file <filename>

      The name of the default bindings file.

      defaultbinding.virtual.host <virtualhost>

      The default virtual host.

      depl.extension.reg <filename>

      The deployment extensions property file.

      deployejb

      Deploy the EJBs in the application

      during installation.

      deployejb.classpath <classpath>

      Additional classpaths to use for EJB deploy.

      deployejb.dbschema <dbschemaname>

      The schema to use for EJB deploy

      deployejb.dbtype <dbtype>

      The DB type for the EJB deploy. Can be one of:

      CLOUDSCAPE_V50, DB2UDB_V72, DB2UDBOS390_V6, DB2UDBAS400_V4R5,

      INFORMIX_V73, INFORMIX_V92, MSSQLSERVER_V7, MSSQLSERVER_2000,

      ORACLE_V8, ORACLE_V9I, SYBASE_1200

      deployejb.rmic <rmicoptions>

      The RMIC options to use for EJB deploy.

      distributeApp

      Whether to distribute the application binaries.

      EnsureMethodProtectionFor10EJB { <ejbmodulename> <uri> <protectpolicy>

      }+

      Ensure 1.x EJBs in the application are protected. The protection

      policy can be one of:

      "methodProtection.uncheck", "methodProtection.exclude", or blank ("").

      EnsureMethodProtectionFor20EJB { <ejbmodulename> <uri> <protectpolicy>

      }+

      Ensure 2.0 EJBs in the application are protected. The protection

      policy can be one of:

      "methodProtection.uncheck" or "methodProtection.exclude".

      installdir <install-directory>

      The directory to install the application.

      MapEJBRefToEJB { <modulename> <ejbname> <uri> <ejbreference>

      <targetclassname> <targetejbjndiname> }+

      Maps the EJB reference to an EJB JNDI name.

      MapModulesToServers { <modulename> <uri> <servername> }+

      Maps individual modules of the application to specific application

      servers (overriding the server option).

      MapResEnvRefToRes { <modulename> <ejbname> <uri> <resenvreference>

      <resenvtype> <resenvjndiname> }+

      Maps resource environment references in your application to

      environment resources in the configuration.

      MapResRefToEJB { <modulename> <ejbname> <uri> <resreference> <restype>

      <resjndiname> }+

      Maps the resource references in your application to resources in the

      configuration.

      MapRolesToUsers { <role> <isEveryone> <isAllauthnusers> <username>

      <groupname> }+

      Maps the roles in your application to users or groups. You should

      specify either "Yes" or "No" for isEveryone and isAllauthnusers.

      Setting isEveryone to Yes indicates the role is granted to everyone;

      isAllauthnusers should be set to No and the username and groupname

      should be blank.

      Setting isAllauthnusers to Yes indicates the role is granted to all

      authenticated users; isEveryone should be set to No and the username

      and groupname should be blank.

      You can specify multiple users and groups by separating them by | and

      surrounding the list in double-quotes.

      MapRunAsRolesToUsers { <role> <username> <password> }+

      Maps the run-as-role policy in your application to a specified user

      principal.

      MapWebModToVH { <webmodulename> <uri> <virtualhostname> }+

      Maps web modules in your application to defined virtual hosts.

      nocreateMBeansForResources

      Do not create MBeans for resources (including JSPs, servlets, EJBs,

      etc.) in

      your application.

      node <nodename>

      The name of the node.

      nodeployejb

      Do not deploy the EJBs in your application.

      nodistributeApp

      Do not distribute your application binaries to the servers on which

      they're configured.

      nopreCompileJSPs

      Do not pre-compile the JSPs in your application.

      noreloadEnabled

      Do not enable servlet re-loading.

      nousedefaultbindings

      Do not use default bindings.

      nouseMetaDataFromBinary

      Do not use the configuration information from the application

      binaries (use only the configuration information stored for the

      application in the configuration repository).

      preCompileJSPs

      Pre-compile the JSPs in your application.

      reloadEnabled

      Enable servlet re-loading.

      reloadInterval <interval>

      The re-load interval.

      server <servername>

      The server name.

      update

      Updates the installed application with a new version of the EAR.

      update.ignore.new

      Ignore bindings from the new EAR.

      update.ignore.old

      Replace the existing bindings with those in the new EAR.

      usedefaultbindings

      Use default bindings.

      useMetaDataFromBinary

      Use the configuration information stored in the application binaries

      (overriding the configuration information stored in the configuration

      repository for the application).

      verbose

      Provide additional information during

      the operation.

      #1; Sun, 25 May 2008 09:06:00 GMT
    • Hi,

      Thanks alot for your reply, it's very helpfull...

      But I still can't manage to get the remote installation working...

      I took a deeper look and it seems that the NoClassDefFoundError isn't

      the main problem. It also happens when I run the script on WAS

      locally, and causes no trouble except for the fact that I get that

      message, but the installation itself completes just fine. I still

      don't understand the reason for it, but I can live with that...

      anyway, seems the problem is elsewhere...

      The scripting environment has a temp directory where it stores

      temporary files. for some reason, when run from a remote computer, I

      get failure with some message like "installation failed because

      C:\my\temp\dir\app13563.ear does not exist". I enabled the trace on

      wsadmin and watched that temp dir closely. the temp ear file does get

      created, but then at some point it is deleted and then I immediately

      get that anoying exception....

      Any ideas?

      #2; Sun, 25 May 2008 09:07:00 GMT
    • I also had the same problem with remote deployment and couldn't make it

      work either. So far, I'm installing applications locally.

      As per your second question, have you found a way to specify a classpath

      when installing an app? We keep common code outside EAR files and place it

      on the shared classpath. However, during the installation I'm getting

      ClassNotFound exceptions because these classes are not found inside EAR.

      It seems like it is harmless since the application gets installed properly

      anyways. The only problem is when I want to precompile JSPs when

      installing an app and that of course fails.

      Lukasz

      #3; Sun, 25 May 2008 09:08:00 GMT