I'm concerned about the solution you propose. The most apps based on 5.1
will be broken after the upgrade. It's very common to have common abstract
super classes for services. Tapestry has been know for adapting the code of
app developers. With the proposed solution Tapestry would dictate app
developers how they code should look like: namely no package private or
protected methods in any of the classes inside reloadable packages. This is
a huge regression that will annoy too many developers. I believe we need a
solution for this issue.


On Wed, Aug 11, 2010 at 6:54 PM, Howard Lewis Ship <[email protected]> wrote:

> You can see these kinds of exceptions for a service implementation
> that accesses protected or package private members of another class.
> Because the service implementation class is loaded in a new
> ClassLoader (to support live class reloading), it is considered to be
> in a different Java package from the other classes (even though this
> new package has the exact same name). When the specially loaded code
> accesses those private members, this is recognized by the JVM which
> throws the exception you are seeing.
>
> You should either make those other members (including constructors)
> public OR mark the service in question as not live-reloadable.  This
> can be accomplished as:
>
> public static void bind(ServiceBinder binder)
> {
>  binder.bind(MyInterface.class, MyImplementation.class).preventReloading();
> }
>
> On Wed, Aug 11, 2010 at 12:42 AM, Vjeran Marcinko
> <[email protected]> wrote:
> > Hello,
> >
> > I tried to port my 5.1 app to 5.2 alpha, and also got IllegalAccessError.
> >
> > I have my own ComponentRequestFilter implementation (for Hibernate
> session
> > management) registered naturally in Tapestry's module class (service
> > package), and IllegalAccessError is raised when this filter tries to
> access
> > other helper class from same package.
> >
> > My filter and mentioned helper classes is located in my arbitrary package
> > <tapestry-.root-package>/my/arbitrary/package
> >
> > I thought maybe some packaging policy has been changed since 5.1 to 5.2,
> so
> > I tried to move all classes (filter and helpers) to "service" package
> since
> > that's where Tapestry's module class is located and references filter,
> but
> > to no avail. Same error occurs.
> >
> > I guess this is bug then, since I can see Peter has mentioned similar
> error.
> >
> > Regards,
> > Vjeran
> >
> > ----- Original Message ----- From: <[email protected]>
> > Newsgroups: gmane.comp.java.tapestry.user
> > To: "Tapestry users" <[email protected]>
> > Sent: Tuesday, August 10, 2010 1:49 PM
> > Subject: Re: Tapestry 5.2.0 Alpha Release Now Available
> >
> >
> >> I guess you're autobuilding a service (AlertFilterCacheRepositoryImpl)
> >> with a constructor that receives two Strings. Am I right?
> >
> > Not quite, there is no explicit auto-loading, I simply build my IoC
> registry
> > adding a bunch of modules to it in the process... the constructor for
> that
> > service looks like this:
> >
> > public AlertFilterCacheRepositoryImpl(@HfdbDatabase HfdbSession session)
> {
> > session_ = session;
> > cache_ = new
> > LookupCacheWrapper<AlertFilterDigest,Integer>(AlertFilterDigest.class);
> > }
> >
> >
> > The annotation is a marker, followed by an interface and all this does is
> > simply determine the database to reference, the cache object is
> constructed
> > and also populated, its all pretty innocuous so I don't see how it
> relates
> > to the IllegalAccessError?
> >
> > Peter
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Thiago H. de Paula Figueiredo" <[email protected]>
> > To: "Tapestry users" <[email protected]>
> > Sent: Tuesday, 10 August, 2010 13:58:58 GMT +02:00 Athens, Beirut,
> > Bucharest, Istanbul
> > Subject: Re: Tapestry 5.2.0 Alpha Release Now Available
> >
> > On Tue, 10 Aug 2010 05:30:32 -0300, <[email protected]> wrote:
> >
> >> Hi Guys,
> >
> > Hi!
> >
> >> I just tried the upgrade from 5.1, but having no luck getting it
> >> running, I am getting this exception:
> >
> >> Caused by: java.lang.IllegalAccessError: tried to access method
> >>
> >>
> com.albourne.db.alert.cache.AlertFilterDigest.<init>(IILjava/lang/String;Ljava/lang/String;)V
> >> > from class com.albourne.db.alert.cache.AlertFilterCacheRepositoryImpl
> >
> > I guess you're autobuilding a service (AlertFilterCacheRepositoryImpl)
> > with a constructor that receives two Strings. Am I right?
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
>
>
> --
> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Reply via email to