Class Weaving

View: New views
5 Messages — Rating Filter:   Alert me  

Class Weaving

by Gaurav Malhotra () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

  For some of my jpa entities the class weaving is not happening. There is no exception in the log.

  I am using spring org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.

  Can somebody give me pointers how to debug this issue???

   I can also see that in TransformationFactory.buildToplinkWeaver the classDetailMap contain the entry for the entity 'Relation'
com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@18a84ed

Also in spring InstrumentationLoadTimeWeaver, I am able to see in the spring's InstrumentationLoadTimeWeaver,PersistenceWeaver (containing below data) is added using InstrumentationLoadTimeWeaver.addTransformer(ClassFileTransformer transformer)

com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@2cc04e

More intrestingly in the
org.springframework.orm.jpa.persistenceunit.ClassFileTransformerAdapter.transform method, I can again see in its classTransformer
com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@2cc04e

In ClassFileTransformerAdapter.transform while debugging I cannot find the className I looking i.e. Relation. Hence I am assuming weaving for the Relation entity is not happening.  (no logging that class has been weaved)
 
No exception... I think weaving for the Relation entity is also not happening

I also enabled the eclipse link finest logging and found the following logging for the entity Relation
[EL Finer]: 2009-07-14 22:48:07.14--ServerSession(18812899)--Thread(Thread[main,5,main])--Class [com.oracle.healthinsurance.orm.entities.Relation] registered to be processed by weaver.

But not logging stating

[EL Finest]: 2009-07-14 22:50:26.859--ServerSession(18812899)--Thread(Thread[main,5,main])--Weaved persistence (PersistenceEntity) [com/oracle/healthinsurance/orm/entities/Relation].

+ change tracking + FetchGroupTracker

Why????

I am able to see indirectionlist which fetch the relation entity.

Gaurav Malhotra

Re: Class Weaving

by tware :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Guarav,

   What symptoms are you seeing that indicate you are not getting weaving?  Are
you certain that some classes are getting weaved and some are not?

   Here are some things you can do to get started debugging.

- Set logging to FINEST (eclipselink.logging.level=FINEST)
- When EclipseLink starts weaving a class it will log the string "Begin weaver
class transformer processing class" + className and when it ends weaving, it
will log the string "End weaver class transformer processing class" + class.
Look for those logging strings with the classes you suspect are not being weaved
and see if any errors are logged between those strings.
- There are some debug flags that can be set as System properties that will
allow you to output the weaved classes. (eclipselink.weaving.output.path=<path>
and "eclipselink.weaving.overwrite.existing=true").  If you set those flags, you
should be able to see the classes that are weaved.  A decompiler will show you
the source.
- Successfully weaved classes will implement the
org.eclipse.persistence.internal.weaving.PersistenceWeaved interface.  Check for
it on your suspect classes.

-Tom


Gaurav Malhotra wrote:

> Hi,
>
>   For some my jpa entities the class weaving is not happening. There is no
> exception in the log.
>
>   I am using spring
> org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.
>
>   Can somebody give me pointer how to debug this issue???
>
> Gaurav Malhotra
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Class Weaving

by Gaurav Malhotra :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi tom,

I also enabled the eclipse link finest logging and found the following logging for the entity Relation
[EL Finer]: 2009-07-14 22:48:07.14--ServerSession(18812899)--Thread(Thread[main,5,main])--Class [com.oracle.healthinsurance.orm.entities.Relation] registered to be processed by weaver.

But not logging stating

[EL Finest]: 2009-07-14 22:50:26.859--ServerSession(18812899)--Thread(Thread[main,5,main])--Weaved persistence (PersistenceEntity) [com/oracle/healthinsurance/orm/entities/Relation].

+ change tracking + FetchGroupTracker

Also in my test case I set the debugging properties you mentioned

        @BeforeClass
        public static void setup() {
                System.setProperty("eclipselink.weaving.output.path", "D:\\projects\\ohi_next\\ohi\\trunk\\ohi-orm\\weavedclasses");
                System.setProperty("eclipselink.weaving.overwrite.existing","true");
        }

Again I cannot see the weaved class.

tware wrote:
Hi Guarav,

   What symptoms are you seeing that indicate you are not getting weaving?  Are
you certain that some classes are getting weaved and some are not?

   Here are some things you can do to get started debugging.

- Set logging to FINEST (eclipselink.logging.level=FINEST)
- When EclipseLink starts weaving a class it will log the string "Begin weaver
class transformer processing class" + className and when it ends weaving, it
will log the string "End weaver class transformer processing class" + class.
Look for those logging strings with the classes you suspect are not being weaved
and see if any errors are logged between those strings.
- There are some debug flags that can be set as System properties that will
allow you to output the weaved classes. (eclipselink.weaving.output.path=<path>
and "eclipselink.weaving.overwrite.existing=true").  If you set those flags, you
should be able to see the classes that are weaved.  A decompiler will show you
the source.
- Successfully weaved classes will implement the
org.eclipse.persistence.internal.weaving.PersistenceWeaved interface.  Check for
it on your suspect classes.

-Tom


Gaurav Malhotra wrote:
> Hi,
>
>   For some my jpa entities the class weaving is not happening. There is no
> exception in the log.
>
>   I am using spring
> org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.
>
>   Can somebody give me pointer how to debug this issue???
>
> Gaurav Malhotra
_______________________________________________
eclipselink-users mailing list
eclipselink-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Re: Class Weaving

by Gaurav Malhotra :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am also uploading the entity for which weaving is not happening
Relation.java

Gaurav Malhotra wrote:
Hi,

  For some of my jpa entities the class weaving is not happening. There is no exception in the log.

  I am using spring org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.

  Can somebody give me pointers how to debug this issue???

   I can also see that in TransformationFactory.buildToplinkWeaver the classDetailMap contain the entry for the entity 'Relation'
com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@18a84ed

Also in spring InstrumentationLoadTimeWeaver, I am able to see in the spring's InstrumentationLoadTimeWeaver,PersistenceWeaver (containing below data) is added using InstrumentationLoadTimeWeaver.addTransformer(ClassFileTransformer transformer)

com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@2cc04e

More intrestingly in the
org.springframework.orm.jpa.persistenceunit.ClassFileTransformerAdapter.transform method, I can again see in its classTransformer
com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@2cc04e

In ClassFileTransformerAdapter.transform while debugging I cannot find the className I looking i.e. Relation. Hence I am assuming weaving for the Relation entity is not happening.  (no logging that class has been weaved)
 
No exception... I think weaving for the Relation entity is also not happening

I also enabled the eclipse link finest logging and found the following logging for the entity Relation
[EL Finer]: 2009-07-14 22:48:07.14--ServerSession(18812899)--Thread(Thread[main,5,main])--Class [com.oracle.healthinsurance.orm.entities.Relation] registered to be processed by weaver.

But not logging stating

[EL Finest]: 2009-07-14 22:50:26.859--ServerSession(18812899)--Thread(Thread[main,5,main])--Weaved persistence (PersistenceEntity) [com/oracle/healthinsurance/orm/entities/Relation].

+ change tracking + FetchGroupTracker

Why????

I am able to see indirectionlist which fetch the relation entity.

Gaurav Malhotra

Re: Class Weaving

by tware :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gaurav,

   Can you try to run the static weaver and see if it successfully weaves your
class.  That will help to isolate whether this is a weaving issue or a
classloading issue.

http://wiki.eclipse.org/Using_EclipseLink_JPA_Extensions_%28ELUG%29#How_to_Configure_Static_Weaving_for_JPA_Entities

-Tom

Gaurav Malhotra wrote:

> I am also uploading the entity for which weaving is not happening
> http://www.nabble.com/file/p24488214/Relation.java Relation.java
>
>
> Gaurav Malhotra wrote:
>> Hi,
>>
>>   For some of my jpa entities the class weaving is not happening. There is
>> no exception in the log.
>>
>>   I am using spring
>> org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver.
>>
>>   Can somebody give me pointers how to debug this issue???
>>
>>    I can also see that in TransformationFactory.buildToplinkWeaver the
>> classDetailMap contain the entry for the entity 'Relation'
>> com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@18a84ed
>>
>> Also in spring InstrumentationLoadTimeWeaver, I am able to see in the
>> spring's InstrumentationLoadTimeWeaver,PersistenceWeaver (containing below
>> data) is added using
>> InstrumentationLoadTimeWeaver.addTransformer(ClassFileTransformer
>> transformer)
>>
>> com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@2cc04e
>>
>> More intrestingly in the
>> org.springframework.orm.jpa.persistenceunit.ClassFileTransformerAdapter.transform
>> method, I can again see in its classTransformer
>> com/oracle/healthinsurance/orm/entities/Relation=org.eclipse.persistence.internal.weaving.ClassDetails@2cc04e
>>
>> In ClassFileTransformerAdapter.transform while debugging I cannot find the
>> className I looking i.e. Relation. Hence I am assuming weaving for the
>> Relation entity is not happening.  (no logging that class has been weaved)
>>  
>> No exception... I think weaving for the Relation entity is also not
>> happening
>>
>> I also enabled the eclipse link finest logging and found the following
>> logging for the entity Relation
>> [EL Finer]: 2009-07-14
>> 22:48:07.14--ServerSession(18812899)--Thread(Thread[main,5,main])--Class
>> [com.oracle.healthinsurance.orm.entities.Relation] registered to be
>> processed by weaver.
>>
>> But not logging stating
>>
>> [EL Finest]: 2009-07-14
>> 22:50:26.859--ServerSession(18812899)--Thread(Thread[main,5,main])--Weaved
>> persistence (PersistenceEntity)
>> [com/oracle/healthinsurance/orm/entities/Relation].
>>
>> + change tracking + FetchGroupTracker
>>
>> Why????
>>
>> I am able to see indirectionlist which fetch the relation entity.
>>
>> Gaurav Malhotra
>>
>
_______________________________________________
eclipselink-users mailing list
eclipselink-users@...
https://dev.eclipse.org/mailman/listinfo/eclipselink-users