This may be a consequence of live class reloading for services, if you
are invoking protected (or package private) methods of other classes.
Try turning live class reloading entirely off; if that fixes the
problem, you can disabled service reloading for the individual
service(s) using the ServiceBinder.

On Thu, Aug 2, 2012 at 9:44 AM, bigcache1 <sharp.maes...@gmail.com> wrote:
> In my application I use the idea if middle data access layers. I implemented
> that through the set of different data access objects, which I named
> mediators. Each mediator is presented through the interface and implementing
> class, which are binded with the Tapestry IoC.
> But mediators are referencing each other interfaces in their classes. And
> this is where I get this exception when the one class is loaded by different
> classloaders. Here is the structure of that references:
> TeacherPage.tml calls the tMed.getActiveClients(), where the tMed is
> annotated with @Inject. This, first, inject is fine.
>
> TeacherPage.tml:
> <html t:type="layout"
>       xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
>       xmlns:p="tapestry:parameter">
>         <ul t:type="loop" t:source="tMed.activeClients" t:value="tClient">
>                 <li>
>                         ${tClient.name}
>                 </li>
>         </ul>
> </html>
>
> TeacherPage.java:
> public class TeacherPage {
>         @Inject
>         @Property
>         private TeacherMed tMed; //TeacherMed is the Interface. 
> TeacherMediator is
> the implementing class.
>
>         @Property
>         private Client tClient;
> }
>
> TeacherMediator.java:
> public class TeacherMediator implements TeacherMed {
>
>         @Inject
>         private CrudServiceDAO dao;
>
>         @Inject
>         private ClientMed clientMed; //ClientMed is the interface, and
> ClientMediator is the implementing class.
>
>         public Teacher unit;
>
>         public List<Client> getActiveClients() {
>                 return clientMed.filterByActiveTeacher(unit).getGroup();
>         }
> }
>
> And here, when clientMed is called, exception occurs:
> /java.lang.LinkageError
> loader constraint violation in interface itable initialization: when
> resolving method
> "tap.execounting.dal.mediators.ClientMediator.setGroup(Ljava/util/List;)Ltap/execounting/dal/mediators/ClientMediator;"
> the class loader (instance of
> org/apache/tapestry5/internal/plastic/PlasticClassLoader) of the current
> class, tap/execounting/dal/mediators/ClientMediator, and the class loader
> (instance of org/mortbay/jetty/webapp/WebAppClassLoader) for interface
> tap/execounting/dal/mediators/interfaces/ClientMed have different Class
> objects for the type
> ounting.dal.mediators.ClientMediator.setGroup(Ljava/util/List;)Ltap/execounting/dal/mediators/ClientMediator;
> used in the signature/
> http://pastebin.com/kSvHbDqc Full stack.  /  http://pastebin.com/mWpC37Lw
> Tapestry report
>
> I checked/tried the following things:
> 1) Tried to move classes into different package.
> 2) Tried to annotate ClientMed as @Environmental.
> 3) Tried to run the project on the linux, on the mac, on the glassfish
> server (which works in another linux)
> 4) Tried to run with different JREs.
> 5) Checked the Inject annotation itself. It is correct.
>
> I still want to use IoC concept in that fashion.
> Is it right to use tapestry @Inject in such way? Or should I use other IoC
> container for the rest (not Pages and Components) of application?
>
>
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/another-java-lang-LinkageError-loader-constraint-violation-in-interface-itable-initialization-tp5714993.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to