You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Marc Salvetti <ma...@notremanou.net> on 2005/04/05 16:05:16 UTC

build error, cocoon 2.1.7, ant 1.6.2, linux

Hello,

my isp have the error
./build.sh
Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/tools/ant/launch/Launcher

when trying to build cocoon 2.1.7 on linux Redhat enterprise 3.0
he has ant 1.6.2 installed,

does anyone know about this error ?

Thanks,

Marc


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Antonio Gallardo <ag...@agssa.net>.
On Mar, 5 de Abril de 2005, 8:05, Marc Salvetti dijo:
> Hello,
>
> my isp have the error
> ./build.sh
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/launch/Launcher
>
> when trying to build cocoon 2.1.7 on linux Redhat enterprise 3.0
> he has ant 1.6.2 installed,
>
> does anyone know about this error ?

See:

http://wiki.apache.org/cocoon/Installing

Best Regards,

Antonio Gallardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Dan Durkin <dd...@scilearn.com>.
this maybe a problem with the ant file

can you try and specify --noconfig

looks like without this ant looks at config for installed versions which 
  may cause problems.

I don't have a system handy to verify.  If true, the cocoon/build.sh may 
need to specify --noconfig


below are some snippets from tools/bin/ant

if $show_help ; then
   echo $0 '[script options] [options] [target [target2 [target3] ..]]'
   echo 'Script Options:'
   echo '  --help, --h            print this message and ant help'
   echo '  --noconfig             suppress sourcing of /etc/ant.conf,'
   echo '                         $HOME/.ant/ant.conf, and $HOME/.antrc'
   echo '                         configuration files'
   echo '  --usejikes             enable use of jikes by default, unless'
   echo '                         set explicitly in configuration files'
   echo '  --execdebug            print ant exec line generated by this'
   echo '                         launch script'
   echo '  '
fi

# Source/default ant configuration
if $no_config ; then
   rpm_mode=false
   usejikes=$use_jikes_default
else
   # load system-wide ant configuration
   if [ -f "/etc/ant.conf" ] ; then
     . /etc/ant.conf
   fi

   # load user ant configuration
   if [ -f "$HOME/.ant/ant.conf" ] ; then
     . $HOME/.ant/ant.conf
   fi
   if [ -f "$HOME/.antrc" ] ; then
     . "$HOME/.antrc"
   fi

   # provide default configuration values
   if [ -z "$rpm_mode" ] ; then
     rpm_mode=false
   fi
   if [ -z "$usejikes" ] ; then
     usejikes=$use_jikes_default
   fi
fi


Mark Eggers wrote:
> On Tue, 2005-04-05 at 17:13 +0200, Jorg Heymans wrote:
> 
> 
>> From build.sh :
>># ----- Ignore system CLASSPATH variable
>>OLD_CLASSPATH="$CLASSPATH"
>>unset CLASSPATH
>>CLASSPATH="`echo lib/endorsed/*.jar | tr ' ' $S`"
>>export CLASSPATH
>>
>># ----- Use Ant shipped with Cocoon. Ignore installed in the system Ant
>>OLD_ANT_HOME="$ANT_HOME"
>>ANT_HOME=tools
>>OLD_ANT_OPTS="$ANT_OPTS"
>>ANT_OPTS="-Xms32M -Xmx512M -Djava.endorsed.dirs=lib/endorsed"
>>export ANT_HOME ANT_OPTS
>>
>>"$ANT_HOME/bin/ant" -logger org.apache.tools.ant.NoBannerLogger -emacs  $@
>>ERR=$?
>>
>># ----- Restore ANT_HOME and ANT_OPTS
>>ANT_HOME="$OLD_ANT_HOME"
>>ANT_OPTS="$OLD_ANT_OPTS"
>>export ANT_HOME ANT_OPTS
>>unset OLD_ANT_HOME
>>unset OLD_ANT_OPTS
>>
>>It does seem to do what i thought it should do.
> 
> 
> I don't have RHEL, but I do build this on Fedora Core 3.  I have no
> problems building Cocoon 2.1.7 with either jdk 1.4.2_06-b03 or
> 1.5.0_01-b08.
> 
> 
>>The Ant website [1] seems to indicate that these problems occur when 
>>another ant is somewhere in the classpath. Maybe the call to unset 
>>CLASSPATH fails somehow, can someone try checking $? after the unset call?
> 
> 
> While I do have ANT_HOME set in my environment, I do not have a
> CLASSPATH set.
> 
> I just set my CLASSPATH to $HOME_ANT/lib/ant-launcher.jar and rebuilt
> Cocoon 2.1.7 with jdk 1.4.2 to see what would happen.  As I type this, I
> don't see any problems (currently building the documents).
> 
> I can try jdk 1.5, but I imagine the results will be the same.
> 
> Could remnants of GNU's Java be in the way?  I know Fedora Core 3 has
> this, but I don't know if RHEL does.
> 
> Just some thoughts . . . .
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Mark Eggers <it...@yahoo.com>.
On Tue, 2005-04-05 at 17:13 +0200, Jorg Heymans wrote:

>  From build.sh :
> # ----- Ignore system CLASSPATH variable
> OLD_CLASSPATH="$CLASSPATH"
> unset CLASSPATH
> CLASSPATH="`echo lib/endorsed/*.jar | tr ' ' $S`"
> export CLASSPATH
> 
> # ----- Use Ant shipped with Cocoon. Ignore installed in the system Ant
> OLD_ANT_HOME="$ANT_HOME"
> ANT_HOME=tools
> OLD_ANT_OPTS="$ANT_OPTS"
> ANT_OPTS="-Xms32M -Xmx512M -Djava.endorsed.dirs=lib/endorsed"
> export ANT_HOME ANT_OPTS
> 
> "$ANT_HOME/bin/ant" -logger org.apache.tools.ant.NoBannerLogger -emacs  $@
> ERR=$?
> 
> # ----- Restore ANT_HOME and ANT_OPTS
> ANT_HOME="$OLD_ANT_HOME"
> ANT_OPTS="$OLD_ANT_OPTS"
> export ANT_HOME ANT_OPTS
> unset OLD_ANT_HOME
> unset OLD_ANT_OPTS
> 
> It does seem to do what i thought it should do.

I don't have RHEL, but I do build this on Fedora Core 3.  I have no
problems building Cocoon 2.1.7 with either jdk 1.4.2_06-b03 or
1.5.0_01-b08.

> The Ant website [1] seems to indicate that these problems occur when 
> another ant is somewhere in the classpath. Maybe the call to unset 
> CLASSPATH fails somehow, can someone try checking $? after the unset call?

While I do have ANT_HOME set in my environment, I do not have a
CLASSPATH set.

I just set my CLASSPATH to $HOME_ANT/lib/ant-launcher.jar and rebuilt
Cocoon 2.1.7 with jdk 1.4.2 to see what would happen.  As I type this, I
don't see any problems (currently building the documents).

I can try jdk 1.5, but I imagine the results will be the same.

Could remnants of GNU's Java be in the way?  I know Fedora Core 3 has
this, but I don't know if RHEL does.

Just some thoughts . . . .

-- 
Mark Eggers <it...@yahoo.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Jorg Heymans <jh...@domek.be>.

Upayavira wrote:
>> Wouldn't it be better if build.sh just backed up ANT_HOME, unsets it, 
>> does it's thing and restores it ? Or am I missing something?
> 
> 
> I always thought it did. Don't know why this should prevent it from 
> working. Fancy taking a look?
> 

 From build.sh :
# ----- Ignore system CLASSPATH variable
OLD_CLASSPATH="$CLASSPATH"
unset CLASSPATH
CLASSPATH="`echo lib/endorsed/*.jar | tr ' ' $S`"
export CLASSPATH

# ----- Use Ant shipped with Cocoon. Ignore installed in the system Ant
OLD_ANT_HOME="$ANT_HOME"
ANT_HOME=tools
OLD_ANT_OPTS="$ANT_OPTS"
ANT_OPTS="-Xms32M -Xmx512M -Djava.endorsed.dirs=lib/endorsed"
export ANT_HOME ANT_OPTS

"$ANT_HOME/bin/ant" -logger org.apache.tools.ant.NoBannerLogger -emacs  $@
ERR=$?

# ----- Restore ANT_HOME and ANT_OPTS
ANT_HOME="$OLD_ANT_HOME"
ANT_OPTS="$OLD_ANT_OPTS"
export ANT_HOME ANT_OPTS
unset OLD_ANT_HOME
unset OLD_ANT_OPTS

It does seem to do what i thought it should do.

The Ant website [1] seems to indicate that these problems occur when 
another ant is somewhere in the classpath. Maybe the call to unset 
CLASSPATH fails somehow, can someone try checking $? after the unset call?

I don't have a RH system to test this on so i'm just guessing here.

Regards
Jorg

[1] http://ant.apache.org/faq.html#NoClassDefFoundError


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Upayavira <uv...@upaya.co.uk>.
Jorg Heymans wrote:
> 
> Upayavira wrote:
> 
>> Marc Salvetti wrote:
>>
>>> Hello,
>>>
>>> my isp have the error
>>> ./build.sh
>>> Exception in thread "main" java.lang.NoClassDefFoundError: 
>>> org/apache/tools/ant/launch/Launcher
>>>
>>> when trying to build cocoon 2.1.7 on linux Redhat enterprise 3.0
>>> he has ant 1.6.2 installed,
>>>
>>> does anyone know about this error ?
>>
>>
>>
>> Try
>> export ANT_HOME=
>>
>> As Cocoon has its own Ant within it, which should be used, so you 
>> don't want ANT_HOME to be pointing to the ISP's one.
> 
> 
> This question seemes to come up at least once a week.
> 
> Wouldn't it be better if build.sh just backed up ANT_HOME, unsets it, 
> does it's thing and restores it ? Or am I missing something?

I always thought it did. Don't know why this should prevent it from 
working. Fancy taking a look?

Regards, Upayavira


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Jorg Heymans <jh...@domek.be>.
Upayavira wrote:
> Marc Salvetti wrote:
> 
>> Hello,
>>
>> my isp have the error
>> ./build.sh
>> Exception in thread "main" java.lang.NoClassDefFoundError: 
>> org/apache/tools/ant/launch/Launcher
>>
>> when trying to build cocoon 2.1.7 on linux Redhat enterprise 3.0
>> he has ant 1.6.2 installed,
>>
>> does anyone know about this error ?
> 
> 
> Try
> export ANT_HOME=
> 
> As Cocoon has its own Ant within it, which should be used, so you don't 
> want ANT_HOME to be pointing to the ISP's one.

This question seemes to come up at least once a week.

Wouldn't it be better if build.sh just backed up ANT_HOME, unsets it, 
does it's thing and restores it ? Or am I missing something?

Regards
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: build error, cocoon 2.1.7, ant 1.6.2, linux

Posted by Upayavira <uv...@upaya.co.uk>.
Marc Salvetti wrote:
> Hello,
> 
> my isp have the error
> ./build.sh
> Exception in thread "main" java.lang.NoClassDefFoundError: 
> org/apache/tools/ant/launch/Launcher
> 
> when trying to build cocoon 2.1.7 on linux Redhat enterprise 3.0
> he has ant 1.6.2 installed,
> 
> does anyone know about this error ?

Try
export ANT_HOME=

As Cocoon has its own Ant within it, which should be used, so you don't 
want ANT_HOME to be pointing to the ISP's one.

Regards, Upayavira

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org