You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by antalk <an...@intercommit.nl> on 2011/10/03 15:14:18 UTC

TAP5-1233 re-open ? java.lang.IllegalAccessError:

Hi all,

I've hit TAP5-1233 again, ( i think) but in some different way:

Take a service: 



And its implementation:



The contribution class is as follows:



And lives in the same package as the service (ofcourse)

Then bind the service and contribute a class:







When now injecting the service and calling the testMe method , Tapestry
(5.2.6) comes up with:




Is this related to this issue or a new one or expected, which i think is
very strange, behaviour ?

Antal



--
View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
It sometimes happens that formatted code doesn't appear on mail. 

You can check the code by directly visiting nabble

http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html

I even get my mails rejected if formatting is on

On Oct 4, 2011, at 6:42 AM, Bob Harner wrote:

> No, it's not just you. The code is missing for me too.
> 
> On Mon, Oct 3, 2011 at 12:35 PM, Josh Canfield <jo...@gmail.com> wrote:
>> Is it just me, or is there code missing form this message?
>> On Oct 3, 2011 6:14 AM, "antalk" <an...@intercommit.nl> wrote:
>>> Hi all,
>>> 
>>> I've hit TAP5-1233 again, ( i think) but in some different way:
>>> 
>>> Take a service:
>>> 
>>> 
>>> 
>>> And its implementation:
>>> 
>>> 
>>> 
>>> The contribution class is as follows:
>>> 
>>> 
>>> 
>>> And lives in the same package as the service (ofcourse)
>>> 
>>> Then bind the service and contribute a class:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> When now injecting the service and calling the testMe method , Tapestry
>>> (5.2.6) comes up with:
>>> 
>>> 
>>> 
>>> 
>>> Is this related to this issue or a new one or expected, which i think is
>>> very strange, behaviour ?
>>> 
>>> Antal
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
It sometimes happens that formatted code doesn't appear on mail. 

You can check the code by directly visiting nabble

http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html

I even get my mails rejected if formatting is on

On Oct 4, 2011, at 6:42 AM, Bob Harner wrote:

> No, it's not just you. The code is missing for me too.
> 
> On Mon, Oct 3, 2011 at 12:35 PM, Josh Canfield <jo...@gmail.com> wrote:
>> Is it just me, or is there code missing form this message?
>> On Oct 3, 2011 6:14 AM, "antalk" <an...@intercommit.nl> wrote:
>>> Hi all,
>>> 
>>> I've hit TAP5-1233 again, ( i think) but in some different way:
>>> 
>>> Take a service:
>>> 
>>> 
>>> 
>>> And its implementation:
>>> 
>>> 
>>> 
>>> The contribution class is as follows:
>>> 
>>> 
>>> 
>>> And lives in the same package as the service (ofcourse)
>>> 
>>> Then bind the service and contribute a class:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> When now injecting the service and calling the testMe method , Tapestry
>>> (5.2.6) comes up with:
>>> 
>>> 
>>> 
>>> 
>>> Is this related to this issue or a new one or expected, which i think is
>>> very strange, behaviour ?
>>> 
>>> Antal
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Howard Lewis Ship <hl...@gmail.com>.
You can have your protected method on the contribution object OR live
class reloading for the service, but not both. You can mark a service
as not reloadable when binding it with the ServiceBinder:

  binder.bind(Service.class, ServiceImpl.class).preventReloading();

On Tue, Oct 11, 2011 at 5:20 AM, antalk <an...@intercommit.nl> wrote:
> Thanks for your testing and work on this. I've commented on Tap5-1233
> relating to this thread. Hopefully one of the contributors can clear this
> issue.
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4891605.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by antalk <an...@intercommit.nl>.
Thanks for your testing and work on this. I've commented on Tap5-1233
relating to this thread. Hopefully one of the contributors can clear this
issue.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4891605.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Cezary Biernacki <ce...@gmail.com>.
Hi,
AFAIK, it is a side effect of how service reloading works internally. Each
service is loaded by a dedicated class loader, so from JVM point of view
their are in a different package than normally loaded classes from the same
package. I guess it is not easy to implemented service reloading other way.
.

Best regards,
Cezary

On Tue, Oct 11, 2011 at 10:08 AM, Steve Eynon <
steve.eynon@alienfactory.co.uk> wrote:

> Hiya,
>
> I can confirm that yes, it does appear to be a bug - an
> IllegalAccessError is thrown when trying to access a protected method
> on the contribution.
>
> After playing with the code, a workaround is to declare the methods on
> MyContribution as public.
>
> public class MyContribution {
>
>        private String name;
>
>        public MyContribution(final String name) {
>                this.name = name;
>        }
>
>        public String getName() {
>                return name;
>        }
> }
>
> Then it works like a charm!
>
> I've had another quick squizz at the IoC Docs (
> http://tapestry.apache.org/tapestry-ioc-configuration.html ) but nope,
> nothing there mentions you can't have *protected* methods in your
> contribution classes.
>
> Steve.
>
> On 11 October 2011 15:13, antalk <an...@intercommit.nl> wrote:
> > Hi Guys,
> >
> > I would really appreciate if someone could have a look at this and see if
> it
> > really is a bug...
> >
> > Thx.
> >
> > --
> > View this message in context:
> http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4890925.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Steve Eynon <st...@alienfactory.co.uk>.
Hiya,

I can confirm that yes, it does appear to be a bug - an
IllegalAccessError is thrown when trying to access a protected method
on the contribution.

After playing with the code, a workaround is to declare the methods on
MyContribution as public.

public class MyContribution {

	private String name;

	public MyContribution(final String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}
}

Then it works like a charm!

I've had another quick squizz at the IoC Docs (
http://tapestry.apache.org/tapestry-ioc-configuration.html ) but nope,
nothing there mentions you can't have *protected* methods in your
contribution classes.

Steve.

On 11 October 2011 15:13, antalk <an...@intercommit.nl> wrote:
> Hi Guys,
>
> I would really appreciate if someone could have a look at this and see if it
> really is a bug...
>
> Thx.
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4890925.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by antalk <an...@intercommit.nl>.
Hi Guys, 

I would really appreciate if someone could have a look at this and see if it
really is a bug...

Thx.

--
View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4890925.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by antalk <an...@intercommit.nl>.
Once more, the code, this time without markup:


Take a service:

public interface MyService {

	public void testMe();
}


And its implementation:

public class MyServiceImpl implements MyService {

	public MyServiceImpl(Collection<MyContribution> config) {
		for (MyContribution contrib: config) {
			System.err.println("contributed name" + contrib.getName());
		}
		
	}
	
	@Override
	public void testMe() {
		System.out.println("Hello World");
	}
}


The contribution class is as follows:

public class MyContribution {

	private String name;
	
	public MyContribution(final String name) {
		this.name = name;
	}
	
	protected String getName() {
		return name;
	}
}


And lives in the same package as the service (ofcourse)

Then bind the service and contribute a class:

binder.bind(MyService.class,MyServiceImpl.class);


 public static void contributeMyService(Configuration<MyContribution>
configuration) {
    	configuration.add(new MyContribution("testme"));
    }




When now injecting the service and calling the testMe method , Tapestry
(5.2.6) comes up with:

Caused by: java.lang.RuntimeException: Error invoking constructor public
<package>.MyServiceImpl(java.util.Collection) (for service 'MyService'):
tried to access method <package>.MyContribution.getName()Ljava/lang/String;
from class <package>.MyServiceImpl
	at
org.apache.tapestry5.ioc.internal.ConstructorServiceCreator.createObject(ConstructorServiceCreator.java:76)
	at
org.apache.tapestry5.ioc.internal.ReloadableServiceImplementationObjectCreator.createInstance(ReloadableServiceImplementationObjectCreator.java:52)
	at
org.apache.tapestry5.ioc.internal.AbstractReloadableObjectCreator$1.invoke(AbstractReloadableObjectCreator.java:148)
	at
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:65)
	... 97 more
Caused by: java.lang.IllegalAccessError: tried to access method
<package>.MyContribution.getName()Ljava/lang/String; from class
<package>.MyServiceImpl
	at <package>.MyServiceImpl.<init>(MyServiceImpl.java:12)




Can someone have a look at this?

	

--
View this message in context: http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4867652.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Taha Hafeez Siddiqi <ta...@gmail.com>.
It sometimes happens that formatted code doesn't appear on mail. 

You can check the code by directly visiting nabble

http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html

I even get my mails rejected if formatting is on

On Oct 4, 2011, at 6:42 AM, Bob Harner wrote:

> No, it's not just you. The code is missing for me too.
> 
> On Mon, Oct 3, 2011 at 12:35 PM, Josh Canfield <jo...@gmail.com> wrote:
>> Is it just me, or is there code missing form this message?
>> On Oct 3, 2011 6:14 AM, "antalk" <an...@intercommit.nl> wrote:
>>> Hi all,
>>> 
>>> I've hit TAP5-1233 again, ( i think) but in some different way:
>>> 
>>> Take a service:
>>> 
>>> 
>>> 
>>> And its implementation:
>>> 
>>> 
>>> 
>>> The contribution class is as follows:
>>> 
>>> 
>>> 
>>> And lives in the same package as the service (ofcourse)
>>> 
>>> Then bind the service and contribute a class:
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> When now injecting the service and calling the testMe method , Tapestry
>>> (5.2.6) comes up with:
>>> 
>>> 
>>> 
>>> 
>>> Is this related to this issue or a new one or expected, which i think is
>>> very strange, behaviour ?
>>> 
>>> Antal
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Bob Harner <bo...@gmail.com>.
No, it's not just you. The code is missing for me too.

On Mon, Oct 3, 2011 at 12:35 PM, Josh Canfield <jo...@gmail.com> wrote:
> Is it just me, or is there code missing form this message?
> On Oct 3, 2011 6:14 AM, "antalk" <an...@intercommit.nl> wrote:
>> Hi all,
>>
>> I've hit TAP5-1233 again, ( i think) but in some different way:
>>
>> Take a service:
>>
>>
>>
>> And its implementation:
>>
>>
>>
>> The contribution class is as follows:
>>
>>
>>
>> And lives in the same package as the service (ofcourse)
>>
>> Then bind the service and contribute a class:
>>
>>
>>
>>
>>
>>
>>
>> When now injecting the service and calling the testMe method , Tapestry
>> (5.2.6) comes up with:
>>
>>
>>
>>
>> Is this related to this issue or a new one or expected, which i think is
>> very strange, behaviour ?
>>
>> Antal
>>
>>
>>
>> --
>> View this message in context:
> http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>

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


Re: TAP5-1233 re-open ? java.lang.IllegalAccessError:

Posted by Josh Canfield <jo...@gmail.com>.
Is it just me, or is there code missing form this message?
On Oct 3, 2011 6:14 AM, "antalk" <an...@intercommit.nl> wrote:
> Hi all,
>
> I've hit TAP5-1233 again, ( i think) but in some different way:
>
> Take a service:
>
>
>
> And its implementation:
>
>
>
> The contribution class is as follows:
>
>
>
> And lives in the same package as the service (ofcourse)
>
> Then bind the service and contribute a class:
>
>
>
>
>
>
>
> When now injecting the service and calling the testMe method , Tapestry
> (5.2.6) comes up with:
>
>
>
>
> Is this related to this issue or a new one or expected, which i think is
> very strange, behaviour ?
>
> Antal
>
>
>
> --
> View this message in context:
http://tapestry.1045711.n5.nabble.com/TAP5-1233-re-open-java-lang-IllegalAccessError-tp4864790p4864790.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>