You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brendan Miller <ca...@catphive.net> on 2014/03/29 00:41:45 UTC
NoClassDefFoundError using catalina ant deploy task
I was going through the tomcat docs and trying to use the default build.xml
file provided by the appdev tutorial to deploy my war to tomcat.
Example build.xml:
http://tomcat.apache.org/tomcat-8.0-doc/appdev/build.xml.txt
However, when I use the deploy task I always get
a java.lang.NoClassDefFoundError:
org/apache/tomcat/util/codec/binary/Base64 error.
I've copied the relevant code here: https://gist.github.com/catphive/9845270
I've verified that tomcat-util.jar, which contains Base64.cass, is on the
path, compile.classpath, passed to taskdef.
I'm just trying to do a basic tomcat tutorial, and getting this deploy task
to run is hanging me up. Any ideas what could be doing wrong? Are these
deploy tasks broken somehow?
Brendan
Re: NoClassDefFoundError using catalina ant deploy task
Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-03-29 15:39 GMT+04:00 Christopher Schultz <ch...@christopherschultz.net>:
>
> Brendan,
>
> On 3/28/14, 8:51 PM, Brendan Miller wrote:
>> I investigated more and found the solution... It seems like a doc
>> bug in that the tutorial doesn't tell you everything you need to do
>> to get deploy to work.
>>
>> tomcat-util.jar needs to be placed in ~/.ant/lib. The tutorial says
>> to place catalina-ant.jar there, but doesn't mention
>> tomcat-util.jar.
>
> You shouldn't have to copy either of these into ~/.ant/lib. Everything
> should be able to be accomplished by setting various class paths
> within the build script. I haven't tried to do this myself, but I'd be
> surprised if Ant required anything in a particular directory.
>
+1.
Please remove any Tomcat/Catalina jars from there.
2014-03-29 3:41 GMT+04:00 Brendan Miller <ca...@catphive.net>:
> I was going through the tomcat docs and trying to use the default build.xml
> file provided by the appdev tutorial to deploy my war to tomcat.
>
> Example build.xml:
> http://tomcat.apache.org/tomcat-8.0-doc/appdev/build.xml.txt
>
You missed this:
<property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! -->
You have not configured catalina.home property. As such,
<path id="compile.classpath">
was not created properly and taskdef using it failed,
<taskdef resource="org/apache/catalina/ant/catalina.tasks"
classpathref="compile.classpath"/>
Maybe one should add some sanity check (a <fail> task) for that property.
By the way, the "deployer" download package of Tomcat includes quite
a number of libraries in its lib/ directory. It is not just those two.
>> The user needs the manager-script role for deploy to succeed. The
>> tutorial doesn't mention this.
Where did you look? My first glance, and I see that that is mentioned, here:
http://tomcat.apache.org/tomcat-8.0-doc/appdev/processes.html#One-Time_Setup_of_Ant_and_Tomcat_for_Development
>> Overall the appdev tutorial is pretty problematic because it
>> doesn't really include a complete example and seems to have kind of
>> random organization.
>
> Patches are always welcome.
+1.
The tutorial needs good review and rewrite, but nobody has stepped up
for the task.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: NoClassDefFoundError using catalina ant deploy task
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Brendan,
On 3/28/14, 8:51 PM, Brendan Miller wrote:
> I investigated more and found the solution... It seems like a doc
> bug in that the tutorial doesn't tell you everything you need to do
> to get deploy to work.
>
> tomcat-util.jar needs to be placed in ~/.ant/lib. The tutorial says
> to place catalina-ant.jar there, but doesn't mention
> tomcat-util.jar.
You shouldn't have to copy either of these into ~/.ant/lib. Everything
should be able to be accomplished by setting various class paths
within the build script. I haven't tried to do this myself, but I'd be
surprised if Ant required anything in a particular directory.
> The user needs the manager-script role for deploy to succeed. The
> tutorial doesn't mention this.
>
> Overall the appdev tutorial is pretty problematic because it
> doesn't really include a complete example and seems to have kind of
> random organization.
Patches are always welcome.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJTNrDjAAoJEBzwKT+lPKRYMUcP/iw1YkXc/zMDhIo9fu+UwJWZ
qsTPyiBfsLa4XY4HnxxvYjZUZYZEMqGGscV39WYud64ey2zh6xOkhkYbNYHkhNnh
k4hNQi84suAlGUQ5OAT4VoiV98x4G5tD3uN0wmQYrgLZ/iKrInoqtO7C57FqkugC
bz1zWMcfsPMLtTEv+RVQT0+HJVGcPJa8+pEhuZ4O2nHKUKny+XgW9Notgo47Z3QH
UgjRNmkh3TutlKJBRCg77oJclNIWafUKZEr9+YAaDpbmaJjVCgTvcmS5zCM7YCuC
zi3moraf6L1PfVuEwr0C14gskchZ7e7KLDj/fuZNMTa1rHMZONq+/BaMaCSaX6mo
f9cvVaIjNekmqCZo8Tg2PhR9p8kIieYo0pEBJJqFBZqQT+RShQKXx1F1ZbxiexDX
KD37GX483T4Drft1rlgk31WOX1O9wqF6DyvjD2wceEK/yMAzzkOqbaZhbZyGEGVl
fbIk1XiSbxz2wSvMjDy0LVBIRSA9/ddbz5d9lJM04zcW0MVbhN3qvgluCYS8yHmP
B/fl5PJI5qF9IKq42YDz0fajXMj1jicKu11tV94ahPZlsxAtZlkkceofsl0ac8UM
/0xjpi8sdnNXmUBe4NgkoEsnOwnBwS0ofhG59SKKdcSmg83UxsU5/Klz3hvDFLBG
pjGhIA94A91KelXTxHku
=yb8E
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: NoClassDefFoundError using catalina ant deploy task
Posted by Martin Gainty <mg...@hotmail.com>.
no bugs..just ...'undocumented features'
glad you found the solution!
Martin
__________
> Date: Fri, 28 Mar 2014 17:51:08 -0700
> Subject: Re: NoClassDefFoundError using catalina ant deploy task
> From: catphive@catphive.net
> To: users@tomcat.apache.org
>
> I investigated more and found the solution... It seems like a doc bug in
> that the tutorial doesn't tell you everything you need to do to get deploy
> to work.
>
> tomcat-util.jar needs to be placed in ~/.ant/lib. The tutorial says to
> place catalina-ant.jar there, but doesn't mention tomcat-util.jar.
>
> The user needs the manager-script role for deploy to succeed. The tutorial
> doesn't mention this.
>
> Overall the appdev tutorial is pretty problematic because it doesn't really
> include a complete example and seems to have kind of random organization.
>
>
> On Fri, Mar 28, 2014 at 4:41 PM, Brendan Miller <ca...@catphive.net>wrote:
>
> > I was going through the tomcat docs and trying to use the default
> > build.xml file provided by the appdev tutorial to deploy my war to tomcat.
> >
> > Example build.xml:
> > http://tomcat.apache.org/tomcat-8.0-doc/appdev/build.xml.txt
> >
> > However, when I use the deploy task I always get
> > a java.lang.NoClassDefFoundError:
> > org/apache/tomcat/util/codec/binary/Base64 error.
> >
> > I've copied the relevant code here:
> > https://gist.github.com/catphive/9845270
> >
> > I've verified that tomcat-util.jar, which contains Base64.cass, is on the
> > path, compile.classpath, passed to taskdef.
> >
> > I'm just trying to do a basic tomcat tutorial, and getting this deploy
> > task to run is hanging me up. Any ideas what could be doing wrong? Are
> > these deploy tasks broken somehow?
> >
> > Brendan
> >
Re: NoClassDefFoundError using catalina ant deploy task
Posted by Brendan Miller <ca...@catphive.net>.
I investigated more and found the solution... It seems like a doc bug in
that the tutorial doesn't tell you everything you need to do to get deploy
to work.
tomcat-util.jar needs to be placed in ~/.ant/lib. The tutorial says to
place catalina-ant.jar there, but doesn't mention tomcat-util.jar.
The user needs the manager-script role for deploy to succeed. The tutorial
doesn't mention this.
Overall the appdev tutorial is pretty problematic because it doesn't really
include a complete example and seems to have kind of random organization.
On Fri, Mar 28, 2014 at 4:41 PM, Brendan Miller <ca...@catphive.net>wrote:
> I was going through the tomcat docs and trying to use the default
> build.xml file provided by the appdev tutorial to deploy my war to tomcat.
>
> Example build.xml:
> http://tomcat.apache.org/tomcat-8.0-doc/appdev/build.xml.txt
>
> However, when I use the deploy task I always get
> a java.lang.NoClassDefFoundError:
> org/apache/tomcat/util/codec/binary/Base64 error.
>
> I've copied the relevant code here:
> https://gist.github.com/catphive/9845270
>
> I've verified that tomcat-util.jar, which contains Base64.cass, is on the
> path, compile.classpath, passed to taskdef.
>
> I'm just trying to do a basic tomcat tutorial, and getting this deploy
> task to run is hanging me up. Any ideas what could be doing wrong? Are
> these deploy tasks broken somehow?
>
> Brendan
>