You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sa...@euroclear.com on 2006/01/06 10:20:25 UTC

Deployment to Websphere 6

Hi,

I am automating the deployment of an Ear file to Websphere 6 using Ant
1.6.5.
I've been doing this with no problems using Websphere 5 but encountering
problems when now using Websphere 6 and the same deployment code.

I use the ant tasks defined in wsanttask.jar which comes bundled with
Websphere. Firstly, I simply try to stop an application.
I define a new ant task mapped to the required class in the wsanttask.jar
then use it in the build file:

  <target name="Stop App" >
    <stopApp wasHome="XXX" server="XXX" application="XXX" />
  </target>

This is the same as for Websphere 5 but on Websphere 6 I receive the
following error:

java.lang.NoClassDefFoundError: com/ibm/ws/bootstrap/WSLauncher

I have tried adding the jar file to the classpath of Ant, WS and copying
the required jar (bootstrap.jar, I believe) into the Ant lib directory.

This should be a very simple step to perform but I cannot solve this. Does
anyone have any ideas?

Thanks,
Sam.


This e-mail message, including any attachments transmitted with it, is
CONFIDENTIAL and may contain legally privileged information. This message
is intended solely for the use of the individual or entity to whom it is
addressed. If you are not the intended recipient you should not read, copy,
distribute, disclose or otherwise use this information. If you have
received this message in error, please notify us immediately and delete it
from your system. The integrity and security of this message cannot be
guaranteed and it may be subject to data corruption and unauthorised
amendment, for which we accept no liability.
Euroclear reserves the right to retain email messages on its systems and
to the extent and under circumstances permitted by applicable law, to
monitor and intercept email messages to and from its systems. Euroclear is
the marketing name for the Euroclear System, Euroclear plc, Euroclear SA/NV
and their affiliates. http://www.euroclear.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Deployment to Websphere 6

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Sam.Tandy@euroclear.com wrote:

>
>The solution of adding the Jar to the classpath works but, as you said, it
>is certainly not a nice way of doing this.
>
>Regarding the class loader:
>If I have specified the jar in the runtime classpath for ant, then call the
>IBM class to stop the server from a build file supplied to ant, do they not
>share a loader?
>  
>
what really matters is :

- which class is instantiating  the WSLauncher class ?

I have stumbled against the same problem when I created an ant task
which was doing some work with MQ Series across a JNDI driver.


I had to put the JNDI driver in the classpath before starting ant,
because the JNDI driver gets loaded by the Java Runtime, which is living
in a classloader which does not know ant and
certainly not the <taskdef/> of the custom task which requires it.

So my experience is that you have to put in the classpath all drivers
which are loaded by the Java runtime (JNDI or JDBC drivers are the
examples which come to mind). Maybe this WSLauncher class is written
in such a way that it is an implementation of an interface known
generally to the java runtime, and it gets instantiated with a
class.forName();

This type of questions gets discussed often on the user list and on the
dev list.

for instance :

posting by Rainer Noack with a patch
http://marc.theaimsgroup.com/?l=ant-dev&m=107930923613690&w=2

bug report in bugzilla :

http://issues.apache.org/bugzilla/show_bug.cgi?id=6606

Actually there is a lot of litterature concerning this issue, so I hope
that the other posters who have written something about this issue do
not feel offended that I do not citate them.

Antoine

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Deployment to Websphere 6

Posted by Sa...@euroclear.com.
Hi Antoine,

Thanks for the response.

>>a) use one of the options below

>>    * -lib jars in the order specified by the -lib elements on the
>>      command line

I should have also mentioned that I'm using Ant integrated into Eclipse 3.1
with the bootstrap.jar added to the Ant classpath so I think this is being
done already.

>>    * jars from ${user.home}/.ant/lib (unless -nouserlib is set)
>>    * jars from ANT_HOME/lib

Adding the jar to these does not solve the problem.

The solution of adding the Jar to the classpath works but, as you said, it
is certainly not a nice way of doing this.

Regarding the class loader:
If I have specified the jar in the runtime classpath for ant, then call the
IBM class to stop the server from a build file supplied to ant, do they not
share a loader?
If not, wouldn't a child loader load this IBM class which would then have
access to its parent loader which would contains the required jar?

Thanks,
Sam.




                                                                           
             Antoine                                                       
             Levy-Lambert                                                  
             <an...@gmx.de>                                           To 
                                       Ant Users List                      
             06/01/2006 10:24          <us...@ant.apache.org>               
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             "Ant Users List"          Re: Deployment to Websphere 6       
             <user@ant.apache.                                             
                   org>                                                    
                                                                           
                                                                           
                                                                           
                                                                           




Hello Sam,

there are cases where the only options which really work are :


a) use one of the options below

    * -lib jars in the order specified by the -lib elements on the
      command line
    * jars from ${user.home}/.ant/lib (unless -nouserlib is set)
    * jars from ANT_HOME/lib

or

b) put the required jar file in the CLASSPATH environment variable
before you start ant
(would work, not recommended)


behind these suggestions : if the bootstrap.jar is really containing the
missing class com/ibm/ws/bootstrap/WSLauncher,
a possible explanation why the class is not found could be that the
class gets instantiated by another class which is in a "higher"
classloader,
which does not delegate back to "children" classloaders.

Also, try to decompile this WSLauncher class, and make sure that it is
not referring to another class which would not be in your classpath.
For instance if WSLauncher extends say GenericLauncher and
GenericLauncher is not in your classpath, this might also result in the
NoClassDefFoundError (not sure).


Antoine



Sam.Tandy@euroclear.com wrote:

>Hi,
>
>I am automating the deployment of an Ear file to Websphere 6 using Ant
>1.6.5.
>I've been doing this with no problems using Websphere 5 but encountering
>problems when now using Websphere 6 and the same deployment code.
>
>I use the ant tasks defined in wsanttask.jar which comes bundled with
>Websphere. Firstly, I simply try to stop an application.
>I define a new ant task mapped to the required class in the wsanttask.jar
>then use it in the build file:
>
>  <target name="Stop App" >
>    <stopApp wasHome="XXX" server="XXX" application="XXX" />
>  </target>
>
>This is the same as for Websphere 5 but on Websphere 6 I receive the
>following error:
>
>java.lang.NoClassDefFoundError: com/ibm/ws/bootstrap/WSLauncher
>
>I have tried adding the jar file to the classpath of Ant, WS and copying
>the required jar (bootstrap.jar, I believe) into the Ant lib directory.
>
>This should be a very simple step to perform but I cannot solve this. Does
>anyone have any ideas?
>
>Thanks,
>Sam.
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Deployment to Websphere 6

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Sam,

there are cases where the only options which really work are :


a) use one of the options below

    * -lib jars in the order specified by the -lib elements on the
      command line
    * jars from ${user.home}/.ant/lib (unless -nouserlib is set)
    * jars from ANT_HOME/lib

or

b) put the required jar file in the CLASSPATH environment variable
before you start ant
(would work, not recommended)


behind these suggestions : if the bootstrap.jar is really containing the
missing class com/ibm/ws/bootstrap/WSLauncher,
a possible explanation why the class is not found could be that the
class gets instantiated by another class which is in a "higher" classloader,
which does not delegate back to "children" classloaders.

Also, try to decompile this WSLauncher class, and make sure that it is
not referring to another class which would not be in your classpath.
For instance if WSLauncher extends say GenericLauncher and
GenericLauncher is not in your classpath, this might also result in the
NoClassDefFoundError (not sure).


Antoine



Sam.Tandy@euroclear.com wrote:

>Hi,
>
>I am automating the deployment of an Ear file to Websphere 6 using Ant
>1.6.5.
>I've been doing this with no problems using Websphere 5 but encountering
>problems when now using Websphere 6 and the same deployment code.
>
>I use the ant tasks defined in wsanttask.jar which comes bundled with
>Websphere. Firstly, I simply try to stop an application.
>I define a new ant task mapped to the required class in the wsanttask.jar
>then use it in the build file:
>
>  <target name="Stop App" >
>    <stopApp wasHome="XXX" server="XXX" application="XXX" />
>  </target>
>
>This is the same as for Websphere 5 but on Websphere 6 I receive the
>following error:
>
>java.lang.NoClassDefFoundError: com/ibm/ws/bootstrap/WSLauncher
>
>I have tried adding the jar file to the classpath of Ant, WS and copying
>the required jar (bootstrap.jar, I believe) into the Ant lib directory.
>
>This should be a very simple step to perform but I cannot solve this. Does
>anyone have any ideas?
>
>Thanks,
>Sam.
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org