Just my two cents regarding:
>  binder.bind(MyInterface.class, MyImplementation.class).preventReloading();

Since Tapestry knows it can't reload package private or protected services, 
surely then it should not attempt to? If convention over configuration is 
embraced then the framework should only reload for public constructors, and 
disregard the rest, the above code should not be a requirement for the 
developer... its ugly and obscure. 

And a last comment, lets bear in mind that this is an Alpha release so is not 
yet perfect, despite some valid points raised.

regards,
Peter

----- Original Message -----
From: "Peter Stavrinides" <p.stavrini...@albourne.com>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Thursday, 12 August, 2010 10:19:08 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Another IllegalAccessError in 5.2 alpha [bug?]

Thanks for the help Howard... it makes perfect sense when you understand whats 
happening, otherwise we have no chance of guessing it from this error.

Cheers,
Peter

----- Original Message -----
From: "Howard Lewis Ship" <hls...@gmail.com>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Wednesday, 11 August, 2010 19:54:58 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Another IllegalAccessError in 5.2 alpha [bug?]

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
<vjeran.marci...@email.t-com.hr> 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: <p.stavrini...@albourne.com>
> Newsgroups: gmane.comp.java.tapestry.user
> To: "Tapestry users" <users@tapestry.apache.org>
> 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" <thiag...@gmail.com>
> To: "Tapestry users" <users@tapestry.apache.org>
> 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, <p.stavrini...@albourne.com> 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: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>
>
> ---------------------------------------------------------------------
> 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


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


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

Reply via email to