Re: Non-Accessible Public Method??

2017-06-08 Thread Niclas Hedhman
Also, I think that this will go away when the classloading is fixed (if it
can be fixed)

Just to give some history for those who weren't around;

When we set out back in 2006 to do Qi4j, one of the starting points was to
not need any particular classloading approach, classes were always supposed
to be loaded by regular code, and never call ClassLoader.loadClass(). That
was the idea and it served us quite well, until the introduction of
FragmentClassLoader (and we also have TransientClassLoader for an
unfinished feature), needed to unify behavior when calling methods
externally or internally, i.e. the redirection of this.methodCall() to the
methodCall() of the composite.
And when that was done, the lack of classloading strategy became a burden,
with the solution being somewhat hacky as we needed to support both J2EE as
well as OSGi classloading.


Cheers
Niclas

On Fri, Jun 9, 2017 at 12:04 PM, Niclas Hedhman  wrote:

> Wow!!!
>
> If I had read the exception a bit clearer, I would probably have gotten
> this sooner.
>
> The return type is not public, and since the _Stud is in a different class
> space, it is not accessible.
>
> Since I am probably one of the few in the world who don't make every class
> public, this is probably a small concern. But I will try to put in a more
> reasonable error message.
>
>
> Cheers
> Niclas
>
> On Fri, Jun 9, 2017 at 11:31 AM, Niclas Hedhman 
> wrote:
>
>> N... That was the Proxy of the mixin, that had the application
>> classloader. Of course
>>
>> Continue to dig in this.
>>
>> On Fri, Jun 9, 2017 at 11:11 AM, Niclas Hedhman 
>> wrote:
>>
>>> Ok, so I have traced this down to;
>>>
>>> The private mixin sqlTable is loaded by the Application/System
>>> classloader, but the public mixin is loaded by the Fragment classloader.
>>>
>>> The test that I tried to replicate this problem, both are loaded with
>>> the Fragment classloader.
>>>
>>> So, there is something here that triggers/prevents the fragment
>>> classloader to be used. Should not be impossible to track that down.
>>>
>>>
>>> Cheers
>>>
>>> On Wed, Jun 7, 2017 at 6:00 PM, Niclas Hedhman 
>>> wrote:
>>>

 I am inclined to think it is somehow related to the classloaders. There
 is one classloader per mixin type, which doesn't seem right. And I can't
 manage to trigger it in a test either, although the code in question is not
 that convoluted.

 In essence, 2 private Mixins inside a service, and one of them
 (SqlTable) also refers to the other (jooqDslContext). Perhaps it really is
 classloading issues, and maybe I have just found a breaking case. And the
 course of action would be to work around the issue now, and schedule
 ClassLoader renovation for 3.1

 public class JooqEntityStoreMixin
 implements EntityStore, EntityStoreSPI, ServiceActivation
 {

 @This
 private SqlTable sqlTable;

 @This
 private JooqDslContext jooqDslContext;


 @Override
 public EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, 
 ModuleDescriptor module, EntityReference reference )
 {
 BaseEntity baseEntity = sqlTable.fetchBaseEntity( reference, module ); 
  // Problem happens here...



 @Mixins( SqlTable.Mixin.class )
 public interface SqlTable
 {
 BaseEntity fetchBaseEntity( EntityReference reference, 
 ModuleDescriptor module );


 class Mixin
 implements SqlTable, Initializable, TableFields
 {

 @Structure
 private Application application;

 @Structure
 private ObjectFactory objectFactory;

 @This
 private JooqDslContext dsl;

 @This
 private Configuration configuration;

 @Uses
 private ServiceDescriptor serviceDescriptor;

 @Service
 private DataSource datasource;

 private Schema schema;

 private SQLDialect dialect;

 private EntitiesTable entitiesTable;
 private TypesTable types;

 @Override
 public BaseEntity fetchBaseEntity( EntityReference reference, 
 ModuleDescriptor module )
 {
 return entitiesTable.fetchBaseEntity( reference, module );
 }


 java.lang.IllegalAccessError: tried to access class 
 org.apache.polygene.entitystore.jooq.BaseEntity from class 
 org.apache.polygene.entitystore.jooq.SqlTable_Mixin_Stub
at 
 org.apache.polygene.entitystore.jooq.SqlTable_Mixin_Stub._fetchBaseEntity(Unknown
  Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
 

Build failed in Jenkins: Polygene(JavaEdition)-develop-java8-checkDists #240

2017-06-08 Thread Apache Jenkins Server
See 


--
Started by an SCM change
[EnvInject] - Loading node environment variables.
Building remotely on H17 (ubuntu xenial) in workspace 

java.io.IOException: Failed to mkdirs: 

at hudson.FilePath.mkdirs(FilePath.java:1169)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1279)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Retrying after 10 seconds
java.io.IOException: Failed to mkdirs: 

at hudson.FilePath.mkdirs(FilePath.java:1169)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1279)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Retrying after 10 seconds
java.io.IOException: Failed to mkdirs: 

at hudson.FilePath.mkdirs(FilePath.java:1169)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1279)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Archiving artifacts
ERROR: Build step failed with exception

 does not exist.
at 
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
at 
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
at 
hudson.tasks.ArtifactArchiver$ListFiles.invoke(ArtifactArchiver.java:292)
at 
hudson.tasks.ArtifactArchiver$ListFiles.invoke(ArtifactArchiver.java:272)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2731)
at hudson.remoting.UserRequest.perform(UserRequest.java:153)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at ..remote call to H17(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:830)
at hudson.FilePath.act(FilePath.java:985)
at hudson.FilePath.act(FilePath.java:974)
at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:238)
at 
hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1753)
at 

Re: Non-Accessible Public Method??

2017-06-08 Thread Niclas Hedhman
Wow!!!

If I had read the exception a bit clearer, I would probably have gotten
this sooner.

The return type is not public, and since the _Stud is in a different class
space, it is not accessible.

Since I am probably one of the few in the world who don't make every class
public, this is probably a small concern. But I will try to put in a more
reasonable error message.


Cheers
Niclas

On Fri, Jun 9, 2017 at 11:31 AM, Niclas Hedhman  wrote:

> N... That was the Proxy of the mixin, that had the application
> classloader. Of course
>
> Continue to dig in this.
>
> On Fri, Jun 9, 2017 at 11:11 AM, Niclas Hedhman 
> wrote:
>
>> Ok, so I have traced this down to;
>>
>> The private mixin sqlTable is loaded by the Application/System
>> classloader, but the public mixin is loaded by the Fragment classloader.
>>
>> The test that I tried to replicate this problem, both are loaded with the
>> Fragment classloader.
>>
>> So, there is something here that triggers/prevents the fragment
>> classloader to be used. Should not be impossible to track that down.
>>
>>
>> Cheers
>>
>> On Wed, Jun 7, 2017 at 6:00 PM, Niclas Hedhman 
>> wrote:
>>
>>>
>>> I am inclined to think it is somehow related to the classloaders. There
>>> is one classloader per mixin type, which doesn't seem right. And I can't
>>> manage to trigger it in a test either, although the code in question is not
>>> that convoluted.
>>>
>>> In essence, 2 private Mixins inside a service, and one of them
>>> (SqlTable) also refers to the other (jooqDslContext). Perhaps it really is
>>> classloading issues, and maybe I have just found a breaking case. And the
>>> course of action would be to work around the issue now, and schedule
>>> ClassLoader renovation for 3.1
>>>
>>> public class JooqEntityStoreMixin
>>> implements EntityStore, EntityStoreSPI, ServiceActivation
>>> {
>>>
>>> @This
>>> private SqlTable sqlTable;
>>>
>>> @This
>>> private JooqDslContext jooqDslContext;
>>>
>>>
>>> @Override
>>> public EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, 
>>> ModuleDescriptor module, EntityReference reference )
>>> {
>>> BaseEntity baseEntity = sqlTable.fetchBaseEntity( reference, module );  
>>> // Problem happens here...
>>>
>>>
>>>
>>> @Mixins( SqlTable.Mixin.class )
>>> public interface SqlTable
>>> {
>>> BaseEntity fetchBaseEntity( EntityReference reference, ModuleDescriptor 
>>> module );
>>>
>>>
>>> class Mixin
>>> implements SqlTable, Initializable, TableFields
>>> {
>>>
>>> @Structure
>>> private Application application;
>>>
>>> @Structure
>>> private ObjectFactory objectFactory;
>>>
>>> @This
>>> private JooqDslContext dsl;
>>>
>>> @This
>>> private Configuration configuration;
>>>
>>> @Uses
>>> private ServiceDescriptor serviceDescriptor;
>>>
>>> @Service
>>> private DataSource datasource;
>>>
>>> private Schema schema;
>>>
>>> private SQLDialect dialect;
>>>
>>> private EntitiesTable entitiesTable;
>>> private TypesTable types;
>>>
>>> @Override
>>> public BaseEntity fetchBaseEntity( EntityReference reference, 
>>> ModuleDescriptor module )
>>> {
>>> return entitiesTable.fetchBaseEntity( reference, module );
>>> }
>>>
>>>
>>> java.lang.IllegalAccessError: tried to access class 
>>> org.apache.polygene.entitystore.jooq.BaseEntity from class 
>>> org.apache.polygene.entitystore.jooq.SqlTable_Mixin_Stub
>>> at 
>>> org.apache.polygene.entitystore.jooq.SqlTable_Mixin_Stub._fetchBaseEntity(Unknown
>>>  Source)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at 
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>> at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>> at 
>>> org.apache.polygene.runtime.composite.TypedModifierInvocationHandler.invoke(TypedModifierInvocationHandler.java:37)
>>> at 
>>> org.apache.polygene.runtime.composite.CompositeMethodInstance.invoke(CompositeMethodInstance.java:66)
>>> at 
>>> org.apache.polygene.runtime.composite.TransientInstance.invoke(TransientInstance.java:124)
>>> at 
>>> org.apache.polygene.runtime.composite.CompositeMethodModel.invoke(CompositeMethodModel.java:116)
>>> at 
>>> org.apache.polygene.runtime.composite.CompositeMethodsModel.invoke(CompositeMethodsModel.java:119)
>>> at 
>>> org.apache.polygene.runtime.composite.CompositeModel.invoke(CompositeModel.java:235)
>>> at 
>>> org.apache.polygene.runtime.composite.TransientInstance.invoke(TransientInstance.java:60)
>>> at com.sun.proxy.$Proxy50.fetchBaseEntity(Unknown Source)
>>> at 
>>> 

Re: Non-Accessible Public Method??

2017-06-08 Thread Niclas Hedhman
N... That was the Proxy of the mixin, that had the application
classloader. Of course

Continue to dig in this.

On Fri, Jun 9, 2017 at 11:11 AM, Niclas Hedhman  wrote:

> Ok, so I have traced this down to;
>
> The private mixin sqlTable is loaded by the Application/System
> classloader, but the public mixin is loaded by the Fragment classloader.
>
> The test that I tried to replicate this problem, both are loaded with the
> Fragment classloader.
>
> So, there is something here that triggers/prevents the fragment
> classloader to be used. Should not be impossible to track that down.
>
>
> Cheers
>
> On Wed, Jun 7, 2017 at 6:00 PM, Niclas Hedhman  wrote:
>
>>
>> I am inclined to think it is somehow related to the classloaders. There
>> is one classloader per mixin type, which doesn't seem right. And I can't
>> manage to trigger it in a test either, although the code in question is not
>> that convoluted.
>>
>> In essence, 2 private Mixins inside a service, and one of them (SqlTable)
>> also refers to the other (jooqDslContext). Perhaps it really is
>> classloading issues, and maybe I have just found a breaking case. And the
>> course of action would be to work around the issue now, and schedule
>> ClassLoader renovation for 3.1
>>
>> public class JooqEntityStoreMixin
>> implements EntityStore, EntityStoreSPI, ServiceActivation
>> {
>>
>> @This
>> private SqlTable sqlTable;
>>
>> @This
>> private JooqDslContext jooqDslContext;
>>
>>
>> @Override
>> public EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, 
>> ModuleDescriptor module, EntityReference reference )
>> {
>> BaseEntity baseEntity = sqlTable.fetchBaseEntity( reference, module );  
>> // Problem happens here...
>>
>>
>>
>> @Mixins( SqlTable.Mixin.class )
>> public interface SqlTable
>> {
>> BaseEntity fetchBaseEntity( EntityReference reference, ModuleDescriptor 
>> module );
>>
>>
>> class Mixin
>> implements SqlTable, Initializable, TableFields
>> {
>>
>> @Structure
>> private Application application;
>>
>> @Structure
>> private ObjectFactory objectFactory;
>>
>> @This
>> private JooqDslContext dsl;
>>
>> @This
>> private Configuration configuration;
>>
>> @Uses
>> private ServiceDescriptor serviceDescriptor;
>>
>> @Service
>> private DataSource datasource;
>>
>> private Schema schema;
>>
>> private SQLDialect dialect;
>>
>> private EntitiesTable entitiesTable;
>> private TypesTable types;
>>
>> @Override
>> public BaseEntity fetchBaseEntity( EntityReference reference, 
>> ModuleDescriptor module )
>> {
>> return entitiesTable.fetchBaseEntity( reference, module );
>> }
>>
>>
>> java.lang.IllegalAccessError: tried to access class 
>> org.apache.polygene.entitystore.jooq.BaseEntity from class 
>> org.apache.polygene.entitystore.jooq.SqlTable_Mixin_Stub
>>  at 
>> org.apache.polygene.entitystore.jooq.SqlTable_Mixin_Stub._fetchBaseEntity(Unknown
>>  Source)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>  at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>  at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>  at java.lang.reflect.Method.invoke(Method.java:498)
>>  at 
>> org.apache.polygene.runtime.composite.TypedModifierInvocationHandler.invoke(TypedModifierInvocationHandler.java:37)
>>  at 
>> org.apache.polygene.runtime.composite.CompositeMethodInstance.invoke(CompositeMethodInstance.java:66)
>>  at 
>> org.apache.polygene.runtime.composite.TransientInstance.invoke(TransientInstance.java:124)
>>  at 
>> org.apache.polygene.runtime.composite.CompositeMethodModel.invoke(CompositeMethodModel.java:116)
>>  at 
>> org.apache.polygene.runtime.composite.CompositeMethodsModel.invoke(CompositeMethodsModel.java:119)
>>  at 
>> org.apache.polygene.runtime.composite.CompositeModel.invoke(CompositeModel.java:235)
>>  at 
>> org.apache.polygene.runtime.composite.TransientInstance.invoke(TransientInstance.java:60)
>>  at com.sun.proxy.$Proxy50.fetchBaseEntity(Unknown Source)
>>  at 
>> org.apache.polygene.entitystore.jooq.JooqEntityStoreMixin.entityStateOf(JooqEntityStoreMixin.java:79)
>>  at 
>> org.apache.polygene.entitystore.jooq.JooqEntityStoreMixin_Stub._entityStateOf(Unknown
>>  Source)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>  at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>  at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>  at java.lang.reflect.Method.invoke(Method.java:498)
>>  at 
>>