[Red5] Config/lib changes needed for Spring with red5-0.8.0/tomcat?

Mondain mondain at gmail.com
Thu Aug 6 13:15:43 PDT 2009


The classloader scheme is way more complicated than I would want to detail
here, but put as a simple line it goes something like this:ExtClassloader <-
AppClassloader <- UrlClassloader -> WebAppClassloader
All classloaders resolve "up" first except the webapp loader which goes
"down" first in this order
1. WEB-INF/lib
2. WEB-INF/classes
The webapp classloader is a Tomcat class so there should be no difference
between it and one running with Tomcat.

Paul

On Thu, Aug 6, 2009 at 1:06 PM, Jack Punt <jpjj05-red5 at yahoo.com> wrote:

>
> I have confirmed that my app starts as expected when run in a normal Tomcat
> installation.
> But when run from the red5/webapps it gets these [classpath] problems.
> Both Tomcat and Jetty make very clear statements about the classloader
> order:
>  0. the bootstrap and system classes (like servlet) that cannot be
> overridden
>  1. the webapp's WEB-INF/lib (and classes) *first*
>  2. then up the classloader chain, to find the container's lib/*.jar
>
> You say the classload in 0.8.0 is better; can you point to a reference
> document
> that explains what the classpath resolution order is when running under
> red5?
>
> In my experience, it seems that the container/lib is being found *before*
> the webapp/WEB-INF/lib
> [so if there are duplicate jars in container and webapp, bad things happen]
>
>
>
> Jack Punt wrote:
> >
> > Same question, but with more specific subject line.
> > My spring-based web-app that works in red5-0.7.0 fails in red5-0.8.0
> > Common knowledge says the classloader/classpath is problem; but what to
> do
> > to fix?
> > The app previously used the bundled/omnibus Spring-2.5.4.jar,
> >  removing that jar as red5 provides most of those classes/jars, i had to
> > add Spring-tx.jar
> >
> > Now the problem is classes in aspectjweaver.jar not being found, although
> > that jar is in my WEB-INF/lib
> > [NoClassDefFoundError:
> > org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldException]
> >
> > I'll be studying the Tomcat classloader rules, but if someone out there
> > knows
> > why this jar would not be found, or where some other version is
> > hiding/masking it,
> > that would be very helpful.
> >
> > Alternatively, will red5-0.8 (standalone) work with Jetty (as red5-0.7
> > did)?
> > I see various notes indicating that Tomcat is "preferred" (although not
> > why...)
> >
> >
> > Jack Punt wrote:
> >>
> >> Paul, thanks for the inspiration.
> >>  To clarify (and perhaps motivate a Spring or Tomcat expert to reply),
> >> The app/war in question does not use red5 per se; it is just the
> database
> >> and web support part.
> >> [the video/rtmp/red5 streaming app is also not working, but it uses
> >> Spring and shows the same symptoms]
> >>
> >> So this is just a Spring/Hibernate app which happens to declare/use the
> >> spring namespaces in xml configs.
> >> But running them inside the red5-0.8.0/webapps fails due to this
> >> [presumably] classpath problem.
> >> [but works fine in red5-0.7.0/webapps]
> >>
> >> Anybody know what makes Spring (or the classloader) get lost on this?
> >>
> >> Caused by:
> >>
> org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> >> Configuration problem: Unable to locate Spring NamespaceHandler for XML
> >> schema namespace [http://www.springframework.org/schema/tx]
> >>
> >> ps, I downloaded the java5 tarball, with the included src.zip;
> >> but I don't see any java/examples; not that I expect oflaDemo to clarify
> >> Spring conflicts...
> >>
> >>
> >>
> >> Mondain wrote:
> >>>
> >>> Use the oflaDemo in java/examples as your guide. The primary spring
> jars
> >>> are
> >>> in the server itself so you dont need to add them to your application
> >>> unless
> >>> you use spring-jdbc or such. You should find the classloader in 0.8.0
> >>> and
> >>> later works much better than Jetty or any previous version of Red5.
> >>> Paul
> >>>
> >>> On Wed, Aug 5, 2009 at 12:07 AM, Jack Punt <jpjj05-red5 at yahoo.com>
> >>> wrote:
> >>>
> >>>>
> >>>> My app works fine on red5-0.7.0 (on jetty)
> >>>> but now I'm upgrading to red5-0.8.0 (on tomcat...)
> >>>>
> >>>> I'm getting: Unable to locate Spring NamespaceHandler ...
> >>>> ... for [http://www.springframework.org/schema/tx]
> >>>>
> >>>> My app included 'spring-2.5.4.jar' and thinking there might be
> >>>> conflicts
> >>>> with the spring files included in red5-0.8.0 I moved that (and
> >>>> aopalliance.jar, etc)
> >>>> out of my WEB-INF/lib [which fixed some earlier errors]
> >>>>
> >>>> But I don't know where to look to fix this.
> >>>>
> >>>> Suggestions or Solutions would be greatly appreciated.
> >>>> --
> >>>> View this message in context:
> >>>>
> http://www.nabble.com/migrating-from-0.7.0-to-0.8.0-tp24821786p24821786.html
> >>>
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Config-lib-changes-needed-for-Spring-with-red5-0.8.0-tomcat-tp24821786p24853465.html
> Sent from the Red5 - English mailing list archive at Nabble.com.
>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>



-- 
http://gregoire.org/
http://code.google.com/p/red5/
http://code.google.com/p/blue5/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090806/5c438e22/attachment-0001.html>


More information about the Red5 mailing list