Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318696

Summary: Load Time Weaving of classes using org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver on Websphere
Product: z_Archived Reporter: Umesh <umesh.sadalgekar>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Umesh CLA 2010-07-02 07:17:10 EDT
Build Identifier: Spring 2.5.4

Hi,

We are trying to achieve load time weaving of our JPA classes using Spring Framework's InstrumentationLoadTimeWeaver on Websphere. 

On Weblogic, we were able to achieve this successfully using Spring's WebLogicLoadTimeWeaver. 

Since Websphere doesn't have an equivalent, we are using InstrumentationLoadTimeWeaverand starting the application with the -javaagent parameter specified. 
This creates 2 different versions of the same class within the JVM (one instrumented and another non-instrumented) which are incompatible with each other causing exceptions while trying to do any database action like read, insert, etc.

Is there a set of guidelines or steps available to achieve this instrumentation without such errors?

Out entityManager definition in spring looks like:

<bean id="entityManagerFactory" 
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="ds"/> <property name="dataSource" ref="dataSource"/> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<property name="showSql" value="false"/> <property name="generateDdl" value="false"/> </bean> </property> <property name="loadTimeWeaver"> <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
</property>
</bean>

This project is already on critical path. Any early reply / help is appreciated.

Thanks
Umesh


Reproducible: Always

Steps to Reproduce:
1.Deploy any application using JPA  on websphere.
2.
3.
Comment 1 Tom Ware CLA 2010-08-05 11:59:06 EDT
What version of WebSphere?  Is this your own instrumentation, or EclipseLink's instrumentation?

I would expect recent Java EE 5 versions of WebSphere to EclipseLink's load time weaving to work by default, though I am not sure what the impact of adding Spring to the mix is.
Comment 2 Tom Ware CLA 2010-08-09 13:51:32 EDT
Closing pending information on whether this is an issue with eclipselink's weaving.  If it is an issue with EclipseLink's weaving, please feel free to reopen and provide some more detail of the issue.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:23:52 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink