plugin package convention and classloading

18 views
Skip to first unread message

Enrico Giurin

unread,
May 4, 2013, 10:26:16 PM5/4/13
to paranc...@googlegroups.com
Hello,
as you might know parancoe is used in jugevents.
In jugevents version 3, hereafter named JE3, I am trying to separate the core part composed by BO, PO, DAO from the web part, the first being in the jugevents-core module.

The POs used in jugevents refer to some POs of the plugins spring-securityevolution and world, therefore I have to define the  lambico lambico:discover-persistent-classe and lambico:define-daos for these two plugins in the test spring configuration file.
These 2 plugins, as all the other parancoe plugins, have all the classes in the same package with this convention org.parancoe.plugins.<plugin-name>

Unfortunately in this package there are not only POs and DAOs but also listener components which require the parancoe-web dependency.

Because of this situation when I execute the test in jugevents-core I get  this exception:
    Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
In  jugevents-core, of course, I don't want to have the parancoe-web dependency, just the parancoe-core.

After having debugged the code,  I found out that this class is required by the plugin listener which is loaded, due to the situation previously described, in the org.lambico.spring.xml.ContextUtils class.

I've identified two possible solutions:
1) To have specific sub-packages for dao and po in the plugins in order to avoid this conflict, names should be org.parancoe.plugins.<plugin>.dao and org.parancoe.plugins.<plugin>.po
2) Explicitly  declaring each single plugin dao and po in the test configuration file, giving up to the benefit of the lambico lambico:discover-persistent-classe and lambico:define-daos

What do you think?
Cheers,
Enrico.



Enrico Giurin

unread,
May 25, 2013, 7:39:56 PM5/25/13
to paranc...@googlegroups.com
Hello,
I was trying to move the tests related to the dao from jugevents-web to jugevents-core when I came across the same problem.
I got the ClassNotFoundException related to org.springframework.web.context.ContextLoaderListener which is part of the dependencies of parancoe-web.

The reason is again due to the fact the plugins have all the classes in the same package: dao, po and listener. the latter requiring the spring-web module.
As temporary workaround I'll add parancoe-web as test dependency in the jugevents-core module, anyway a stable fixing of the problem would be appreciated.

Cheers,
Enrico.
Reply all
Reply to author
Forward
0 new messages