[Red5] Classloader Issues with Hibernate
Daniel Rossi
electroteque at gmail.com
Tue Apr 14 20:16:12 PDT 2009
On 15/04/2009, at 9:02 AM, Tyler Kocheran wrote:
> Oh, well here's a really simple, sweet example (built by Ivy, 18.5
> KB!) that was my first intro to AOP. It's really simple, but AOP
> rocks. Being able to "intercept" method calls is so rad, especially
> for security. It's definitely something I need to learn more about.
> Daniel, what's the purpose in using AOP with Hibernate? I'm still
> kind of unclear as to why so many people include it in their projects.
If you have a look at the config, and the docs, it traps the get /
set / delete methods and handles caching / transactions accordingly
aparantly ?
>
>
> On Tue, Apr 14, 2009 at 3:49 PM, Mondain <mondain at gmail.com> wrote:
> I dont use AOP so I wasnt commenting on its use. I do believe that
> Dominick and I are using AOP in the project where the dir list came
> from, but I didnt configure it.. he did.
>
> Paul
>
>
> On Tue, Apr 14, 2009 at 3:45 PM, Tyler Kocheran
> <rfkrocktk at gmail.com> wrote:
> My AOP project works great using the spring-aop library, but yeah
> I'm not using namespaces but the old way in my markup.
>
> On Tue, Apr 14, 2009 at 1:13 PM, Daniel Rossi
> <electroteque at gmail.com> wrote:
> SO the recommended system is to not use AOP, and use the old v 1.0
> way for transactions ?
>
> On 15/04/2009, at 5:24 AM, Mondain wrote:
>
>> It should, but i would have to test it to find out if it actually
>> works. I've heard that Spring does some funky stuff in their
>> weavers...
>>
>> On Tue, Apr 14, 2009 at 10:31 AM, Tyler Kocheran
>> <rfkrocktk at gmail.com> wrote:
>> For all Spring-related stuff, does the webapp class-loader
>> automatically delegate to the global class loader? IE: Should I put
>> all Spring libraries in the global lib? (Eg: Spring ORM)
>>
>> 2009/4/13 Mondain <mondain at gmail.com>
>>
>> I had a problem with the primary quartz scheduler recently because
>> it is loaded outside of the webapp where I was trying access it.
>> This is why changed the codebase to allow schedulers based within a
>> webapp/red5app when required. My particular problem was that the
>> scheduler could not load a class inside my webapp since it had no
>> idea that my webapp classloader existed and since it was loaded by
>> the urlclassloader it only checked itself and the appclassloader
>> (main top level parent). This may be the problem with your client
>> registry, if you are not creating the registry class within your
>> webapp then it will not be able to use your webapp classes properly.
>>
>> AppClassLoader <- UrlClassLoader <- WebAppClassLoader (one of these
>> for each of your apps)
>>
>> I know this seems very simple, but trust me when I say it is not..
>>
>> A lot of the time the problem finding classes will be that a
>> library or instance is trying to use
>> Thread.getCurrentContext().getClassLoader() or it will just do a
>> Class.forName() without supplying the loader to use (so it uses
>> AppClassLoader). If the thread is within the Red5 process it will
>> not find your webapp classes, this has caused a lot of problems..
>> and continues to confuse and irritate the #$!% out of me.
>>
>> Enough rambling..
>>
>> Paul
>>
>>
>> On Mon, Apr 13, 2009 at 7:42 PM, Daniel Rossi
>> <electroteque at gmail.com> wrote:
>>
>> On 14/04/2009, at 12:02 PM, Mondain wrote:
>>
>>> How is it broken again?
>>
>> It was all working and I alerted about that and then suddenly I was
>> getting class not found errors again. It is still working for the
>> hibernateTest app but not my other app which does hibernate stuff
>> inside a ClientRegistry thats where the class not found error
>> happens. So i will have to setup tests for that aswell now.
>>
>>
>>> Look at my directory list and clearly it works fine. As for your
>>> question TK, youve pretty much got it nailed except the last bit
>>> where it searches the AppClassLoader which the top-most level and
>>> if it doesnt find the class there (-cp xxxx.jar) then you get the
>>> exception. Webapp class loaders look down first and then follow
>>> standard class loading procedure by looking up the loader list.
>>>
>>> Paul
>>>
>>> On Mon, Apr 13, 2009 at 4:29 PM, Daniel Rossi <electroteque at gmail.com
>>> > wrote:
>>> No the classloader was fixed, but after a recent update it
>>> suddenly broke again, I will try and create an example app for
>>> this, the hibernateTest works, but when trying to do hibernate
>>> stuff inside the ClientRegistry it somehow breaks and cannot find
>>> a class. I had to move all the jars into the common lib to get
>>> around it.
>>>
>>> On 14/04/2009, at 5:55 AM, Mondain wrote:
>>>
>>>> Tyler,
>>>> Here is the directory dump of a project that Dominick and I are
>>>> working on.. Both webapps use hibernate + mysql (names and some
>>>> jars removed to protect the innocent) and work without fail.
>>>> Hopefully this will help you with placement of your jars, also
>>>> note that the r3509 was our base version and we are currently
>>>> running trunk.
>>>>
>>>> http://pastebin.com/m69b741c3
>>>>
>>>> Paul
>>>>
>>>> On Mon, Apr 13, 2009 at 11:46 AM, Tyler Kocheran <rfkrocktk at gmail.com
>>>> > wrote:
>>>> I'm trying to set up a pretty simple Hibernate project for use
>>>> with Red5, using the latest trunk. The project is built with Ant
>>>> and Ivy, which makes it easy to have all of the dependencies
>>>> resolved. However, the Red5 class loader seems to still be having
>>>> some issues with loading classes. The reason I believe that the
>>>> project is not starting is because of all of the 'unnecessary'
>>>> dependencies that Ivy satisfies anyway (eg. commons-logging etc.).
>>>>
>>>> On start of my server, the webapp begins to start, but my
>>>> datasource (ComboPooledDataSource, I love c3p0) cannot find my
>>>> database driver (com.mysql.jdbc.Driver) in the classpath. I have
>>>> tried copying my JAR files from the webapp lib to the global lib,
>>>> but if I do that, the server won't start at all. I'm ready to
>>>> start messing around with the Java ClassLoader for Red5, since it
>>>> seems to be the cause of my problems. How should I dive in to
>>>> fixing that? Any tips, recommendations? I'd love to help lay this
>>>> bug to rest, since it seems to have been present for so long.
>>>>
>>>> - TK
>>>> (I can also attach my project to the list if that's helpful at
>>>> all, but I'll probably just post it to JIRA)
>>>>
>>>> --
>>>> And do this, knowing the time, that now it is high time to awake
>>>> out of sleep;
>>>> for now our salvation is nearer than when we first believed.
>>>>
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> Red5 at osflash.org
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://gregoire.org/
>>>> http://osflash.org/red5
>>>> _______________________________________________
>>>> Red5 mailing list
>>>> Red5 at osflash.org
>>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>>
>>>
>>>
>>>
>>> --
>>> http://gregoire.org/
>>> http://osflash.org/red5
>>> _______________________________________________
>>> Red5 mailing list
>>> Red5 at osflash.org
>>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>>
>>
>> --
>> http://gregoire.org/
>> http://osflash.org/red5
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>>
>>
>> --
>> And do this, knowing the time, that now it is high time to awake
>> out of sleep;
>> for now our salvation is nearer than when we first believed.
>>
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>>
>>
>>
>>
>> --
>> http://gregoire.org/
>> http://osflash.org/red5
>> _______________________________________________
>> Red5 mailing list
>> Red5 at osflash.org
>> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>
>
> --
> And do this, knowing the time, that now it is high time to awake out
> of sleep;
> for now our salvation is nearer than when we first believed.
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>
>
> --
> http://gregoire.org/
> http://osflash.org/red5
>
> _______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
>
>
>
>
> --
> And do this, knowing the time, that now it is high time to awake out
> of sleep;
> for now our salvation is nearer than when we first believed.
> <red5-aop.zip>_______________________________________________
> Red5 mailing list
> Red5 at osflash.org
> http://osflash.org/mailman/listinfo/red5_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5_osflash.org/attachments/20090415/0ca3f4b8/attachment-0001.html>
More information about the Red5
mailing list