A testcase in qi4j-chronos failed, due to non-public interface of a service
composite.

@Mixins( CommentFactory.CommentFactoryMixin.class )
interface CommentFactory extends ServiceComposite
{
    Comment create( String comment, User user );

    abstract class CommentFactoryMixin
        implements CommentFactory
    {

if I mark the Mixin public, get the same problem. But if I make the
CommentFactory public it works.

If I break at the constructor.newInstance() where it is thrown, and execute
isAccessible() I get back "true", so it is more subtle than that.

The exception thrown is;


java.lang.IllegalAccessError: tried to access class
org.qi4j.chronos.domain.model.common.comment.assembly.CommentFactory from
class
org.qi4j.chronos.domain.model.common.comment.assembly.CommentFactory_CommentFactoryMixin_Stub
 at
org.qi4j.chronos.domain.model.common.comment.assembly.CommentFactory_CommentFactoryMixin_Stub.<clinit>(Unknown
Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.qi4j.runtime.composite.ConstructorModel.newInstance(ConstructorModel.java:105)
 at
org.qi4j.runtime.composite.ConstructorsModel.newInstance(ConstructorsModel.java:182)
at org.qi4j.runtime.composite.MixinModel.newInstance(MixinModel.java:140)
 at org.qi4j.runtime.composite.MixinsModel.newMixins(MixinsModel.java:45)
at org.qi4j.runtime.service.ServiceModel.newInstance(ServiceModel.java:266)
 at
org.qi4j.runtime.service.ServiceReferenceInstance.getInstance(ServiceReferenceInstance.java:111)
at
org.qi4j.runtime.service.ServiceReferenceInstance.access$100(ServiceReferenceInstance.java:36)
 at
org.qi4j.runtime.service.ServiceReferenceInstance$ServiceInvocationHandler.invoke(ServiceReferenceInstance.java:166)
at
org.qi4j.chronos.domain.model.common.comment.assembly.$Proxy34.create(Unknown
Source)
 at
org.qi4j.chronos.domain.model.common.comment.assembly.CommentFactoryTest.createCommentTest(CommentFactoryTest.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


-- 
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java

I  live here; http://tinyurl.com/2qq9er
I  work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to