Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 282071

Summary: www-servers/tomcat-6.0.20 - ClassNotFoundException: ContextListener
Product: Gentoo Linux Reporter: Michał Kudła <m1k0>
Component: [OLD] JavaAssignee: Java team <java>
Status: RESOLVED DUPLICATE    
Severity: major CC: afansky, ap, cedric.godin, hholt, mike
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: this tomcat patch adds build-examples ant task and overrides allowLinking parameter for /examples
tomcat ebuild with examples bugfix

Description Michał Kudła 2009-08-20 08:05:33 UTC
I cannot start /examples application
cat localhost.2009-08-20.log
2009-08-20 09:24:06 org.apache.catalina.core.StandardContext listenerStart                                                                                                                                      
SEVERE: Error configuring application listener of class listeners.ContextListener                                                                                                                               
java.lang.ClassNotFoundException: listeners.ContextListener                                                                                                                                                     
        at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)                                                                                                                               
        at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)                                                                                                                               ...


Reproducible: Always

Steps to Reproduce:
1.unmerge previous tomcat instalation
2.emerge -av1 =www-servers/tomcat-6.0.20
3./etc/init.d/tomcat-6 restart
4.go to http://localhost:8080/manager/html/start?path=/examples

Actual Results:  
FAIL - Application at context path /examples could not be started


Expected Results:  
OK - Started application at context path /examples


emerge --info
Portage 2.2_rc38 (default/linux/x86/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r3 i686)
=================================================================                                            
System uname: Linux-2.6.30-gentoo-r3-i686-AMD_Athlon-tm-_64_Processor_3000+-with-glibc2.1                    
Timestamp of tree: Tue, 18 Aug 2009 11:30:01 +0000                                                           
app-shells/bash:     3.2_p39                                                                                 
dev-java/java-config: 1.3.7-r1, 2.1.8-r1                                                                     
dev-lang/python:     2.4.6, 2.5.4-r3                                                                         
dev-python/pycrypto: 2.0.1-r6                                                                                
dev-util/cmake:      2.6.4                                                                                   
sys-apps/baselayout: 2.0.0                                                                                   
sys-apps/openrc:     0.4.3-r3                                                                                
sys-apps/sandbox:    1.6-r2                                                                                  
sys-devel/autoconf:  2.13, 2.63-r1                                                                           
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2                                               
sys-devel/binutils:  2.18-r3                                                                                 
sys-devel/gcc-config: 1.4.1                                                                                  
sys-devel/libtool:   2.2.6a                                                                                  
virtual/os-headers:  2.6.27-r2                                                                               
ACCEPT_KEYWORDS="x86"                                                                                        
CBUILD="i686-pc-linux-gnu"                                                                                   
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/openjms/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="pl en pl_PL en_GB"
MAKEOPTS="-j2"
PKGDIR="/usr/local/portage/binpkg"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/repo-m1k0"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac aalib accessibility acl acpi addbookmarks additions admin administrator akode alias alsa amd amr amrnb amrr amrwb animgif apache2 asf audiofile autoipd automount avahi bash-completion berkdb bittorrent bittorrent-external blender-game bluetooth bookmarks branding bzip2 c++ cairo cdda cdr cdrom chm cleartype cli colordiff connectionstatus consolekit contactnotes cpudetection cracklib crypt css cups curl cvs dbus derby dhclient dhcpcd dia dict dirac directfb dri dts dv dvbplayer dvd dvdnav dvdr embedded emboss emf encode evo exif expat fam fame fat ffmpeg firefox firefox3 flac fortran ftp gallery gd gdbm geoip geos gif git glib gnutls google-gadgets gpm graphviz gs gsm gstreamer gtk gtk2 hal hdri highlight history htmlhandbook icalsrv iconv id3tag imagemagick imap imlib inkjar inotify ipv6 irc isdnlog jabber jai java java5 javacomm javamail javascript jce jingle jmf jms jmx joystick jpeg jpeg2k kde lame lcms ldap libgcrypt libnotify libsamplerate libssh2 logrotate lzo mad matroska mdnsresponder-compat melt mikmod mjpeg mmx mmxext mng modplug mp3 mp4 mpeg mplayer mtp mudflap musepack mydms mysql ncurses networkmanager nls npp nptl nptlonly nsplugin nss ntfs odk ogg openal openexr opengl openmp pam pango passwordsave pch pcntl pcre pdf pdo perl phonon php plasma plotutils png pnm postgis postgres postscript ppds pppd proj python q32 qt3 qt3support qt4 quicktime radio rar readline realmedia redland reflection resolvconf rss rtsp samba sasl schroedinger sdl semantic-desktop session shout skins slang slp sms sndfile sound sox speech speex spell spl sql sqlite sqlite3 sse sse2 ssl startup-notification statistics stream subversion svg sysfs tcl tcpd teamarena texteffect theora threads threadsafe thumbnail tiff timidity tk tordns translator truetype unicode urandom usb v4l v4l2 vcd vhosts vidix vorbis vorbis-psy webdav webdav-serf webkit win32codecs wmf wxwindows x264 x86 xanim xcb xcomposite xine xinerama xml xorg xulrunner xv xvid xvmc yv12 zeroconf zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl en pl_PL en_GB" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

# cat localhost.2009-08-20.log 
2009-08-20 09:24:06 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class listeners.ContextListener
java.lang.ClassNotFoundException: listeners.ContextListener                      
        at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(Unknown Source)
        at org.apache.catalina.core.StandardContext.listenerStart(Unknown Source)
        at org.apache.catalina.core.StandardContext.start(Unknown Source)        
        at org.apache.catalina.core.ContainerBase.addChildInternal(Unknown Source)
        at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)        
        at org.apache.catalina.core.StandardHost.addChild(Unknown Source)         
        at org.apache.catalina.startup.HostConfig.deployDirectory(Unknown Source) 
        at org.apache.catalina.startup.HostConfig.deployDirectories(Unknown Source)
        at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)       
        at org.apache.catalina.startup.HostConfig.start(Unknown Source)            
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown Source)   
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown Source)
        at org.apache.catalina.core.ContainerBase.start(Unknown Source)                
        at org.apache.catalina.core.StandardHost.start(Unknown Source)                 
        at org.apache.catalina.core.ContainerBase.start(Unknown Source)                
        at org.apache.catalina.core.StandardEngine.start(Unknown Source)               
        at org.apache.catalina.core.StandardService.start(Unknown Source)              
        at org.apache.catalina.core.StandardServer.start(Unknown Source)               
        at org.apache.catalina.startup.Catalina.start(Unknown Source)                  
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                 
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)                                     
        at org.apache.catalina.startup.Bootstrap.start(Unknown Source)                          
        at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
Comment 1 Alistair Bush (RETIRED) gentoo-dev 2009-08-20 08:58:59 UTC
Where did you get the examples app from?

http://www.gentoo.org/proj/en/java/tomcat6-guide.xml#doc_chap4_sect5
Comment 2 Michał Kudła 2009-08-20 16:07:30 UTC
from =www-servers/tomcat-6.0.20
I find, that examples are not compiled. Directory classes contains ony .java files
Comment 3 Beju 2009-10-01 10:05:25 UTC
I am also experiencing this bug.
Comment 4 Harry Holt 2009-11-03 15:40:58 UTC
It seems that nothing is built other than the basic Tomcat container stuff.  If you run ant from the /var/lib/tomcat-6/webapps directory, it will build the ROOT application.  You can then do `'ln -s ../build/ROOT ROOT' in that directory and you'll have a working ROOT application.

The build scripts for the docs application is nowhere to be found after the install.  Looking at the ebuild it appears to not even try to build them, it just copies the raw files from the upstream source into the directories, so you end up with junk in there instead of a working application.
Comment 5 Arsen Shnurkov 2009-11-08 07:08:32 UTC
I have the same bug.

I did 
cd /var/lib/tomcat-6/webapps && ant && ln -s ../build/ROOT ROOT
.

Tomcat shows it's interface. 
But now I have who identical set of files:
- one under folder /var/lib/tomcat-6/webapps
- another under /var/lib/tomcat-6/webapps/ROOT
Comment 6 Mike Weissman 2009-11-08 14:40:31 UTC
This bug only effects the examples, the summary should be changed to reflect that. 

Comment#4 is correct, the example applications are NOT built during the build of the Catalina Core like they have in the past, this is in part to the security issues with the example applications, by default we shouldn't install applications that are insecure, that should be a user decision.

-weisso 
Comment 7 Harry Holt 2010-03-06 22:09:14 UTC
(In reply to comment #6)
> This bug only effects the examples, the summary should be changed to reflect
> that. 
> 
> Comment#4 is correct, the example applications are NOT built during the build
> of the Catalina Core like they have in the past, this is in part to the
> security issues with the example applications, by default we shouldn't install
> applications that are insecure, that should be a user decision.
> 
> -weisso 
> 

Comment#4 was not about the example applications.  The ROOT tomcat app is different from the example webapp (and the manager and host-manager, which work, but are installed in odd locations, without making the required changes to the ROOT app, so all the links end up broken.  The ROOT may or may have some security issues, but with the default install without any users configured, the functionality won't work anyway without setting up users first.

As far as the examples go, I haven't figured out yet how to get those to work yet.  There is a USE flag to install it or not, but that just adds the files.  Tomcat sees it as a valid stopped application, but is unable to start it (results in 

FAIL - Application at context path /examples could not be started

)
Comment 8 Alexey Fansky 2010-08-29 12:07:25 UTC
Created attachment 245213 [details, diff]
this tomcat patch adds build-examples ant task and overrides allowLinking parameter for /examples
Comment 9 Alexey Fansky 2010-08-29 12:11:04 UTC
Created attachment 245214 [details]
tomcat ebuild with examples bugfix
Comment 10 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-02-23 18:56:29 UTC
Closing per William's request.

*** This bug has been marked as a duplicate of bug 283273 ***