Questions tagged [load-time-weaving]

Binary weaving of aspects when a class is loaded.

Load-Time Weaving (LTW) is instrumentation (binary weaving of aspects) at class loading time in a VM.

For example, in Java, it is implemented by AspectJ.

Alternatively, in the .NET world, it is also called "Runtime Weaving" (see the PostSharp documentation).

162 questions
38
votes
2 answers

@Transactional in super classes not weaved when using load time weaving

The project I am working on has a similar structure for the DAOs to the one bellow: /** * Base DAO class */ @Transactional public class JPABase { @PersistenceContext private EntityManager entityManager; public void persist(Object…
16
votes
5 answers

Spring's LoadTimeWeaver Agent not starting up

I'm attempting to implement Load time weaving using Spring and AspectJ. To the best of my knowledge I have everything configured properly but I keep getting the error when I try to run my integration…
Conner McNamara
  • 365
  • 1
  • 5
  • 15
14
votes
2 answers

Tomcat 8, Spring Boot, @Configurable LoadTimeWeaving without -javaagent?

I'm trying to setup a @Configurable domain object(not managed by the spring container). I've got this working by adding the -javaagent:path/to/spring-instrument.jar as a JVM argument but it's not 100% clear to me whether or not this -javaagent MUST…
mjj1409
  • 3,075
  • 6
  • 28
  • 28
14
votes
2 answers

How to configure AspectJ with Load Time Weaving without Interface

On my project, I currently use AspectJ (not just Spring AOP due to some limitation) with the weaving at the Compile Time. In order to speed up the development on Eclipse, I want to do the weaving at the Load Time. I succeed to do that but with one…
12
votes
2 answers

Spring AOP with AspectJ: Load time weaving

If I'm using AspectJ based Spring AOP, am I then tied to configuring my aspects to use load time weaving? Or does Spring AOP also support run time/compile time weaving when using the AspectJ based approach?
Shane
  • 461
  • 2
  • 8
  • 23
12
votes
2 answers

OSGi WeavingHook Examples

Does anybody have any examples of using the OSGi 4.3+ Weaving Hook Service? What about with AspectJ, ASM, JavaAssist? Is anybody actually using OSGi WeavingHooks? The example in OSGi Core 5.0.0 section 56.2 simply leaves out the actual weaving and…
John Ellinwood
  • 14,291
  • 7
  • 38
  • 48
11
votes
6 answers

jetty-maven-plugin and loadTimeWeaver

can't seem to have my spring webapp working with jetty-maven pluging i always get org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loadTimeWeaver': Initialization of bean failed; nested exception is…
mfirry
  • 3,634
  • 1
  • 26
  • 36
9
votes
3 answers

Aspect weaving at runtime

I'm looking for a Java solution that would allow me to use AOP to weave new code on top of already running code at runtime. The key is not to require the restart of the JVM. Also, I'd like to remove the woven at runtime, leaving the old code running…
Faustas
  • 350
  • 1
  • 2
  • 10
9
votes
2 answers

How to configure load-time weaving with AspectJ and Tomcat?

I tried to configure load-time weaving (for doing profiling with Perf4J) in the next way: 1) I added aop.xml to META-INF folder. When deployed, META-INF is placed in the artifact root directory (i.e. MyAppDeployed/META-INF). 2) I put…
Roman
  • 64,384
  • 92
  • 238
  • 332
8
votes
1 answer

Running Unit Tests using Maven in Spring LTW Environment

I am developing an application in a ddd architecture using Spring LoadTimeWeaving feature. The problem is i can run my Junit tests using eclipse but not through Maven. I have tried all the options given on various sites but it simply isn't working.…
8
votes
0 answers

Saving ManyToMany with @ChangeTracking relation throws PersistenceException

When I am trying to save a ManyToMany relation I get a database exception: Exception in thread "main" javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217-774c696):…
ZBiro
  • 81
  • 4
8
votes
2 answers

How to enable load time / runtime weaving with Hibernate JPA and Spring Framework

I'm using Hibernate as a JPA provider (I'm using its EntityManagerFactory instead of its SessionFactory) in a Spring Framework application. I managed to get Spring Framework's load time weaving support working, so I'm past that hurdle. I need to…
7
votes
1 answer

AspectJ load-time weaving for signed jars

Does anybody success in using AspectJ load-time weaving with signed jars? I got an exception and have no idea how to fix it (tested with AspectJ 1.6.8-16.10): Exception in thread "main" java.lang.NoClassDefFoundError: com/package/clazz$AjcClosure1 …
FoxyBOA
  • 5,788
  • 8
  • 48
  • 82
7
votes
2 answers

Trouble configuring AspectJ LTW with Tomcat and Spring

I'm having some problems getting load-time weaving to work with Spring in my Tomcat 6 webapp. I only want to use it for transactions (so that self-invocation respects transactional annotations, which it doesn't with AOP proxying). It appears that…
Kelly Ellis
  • 1,081
  • 1
  • 11
  • 13
6
votes
3 answers

Spring: Is CGLIB required for injection of a concrete class using @Resource

I have configured Spring 3.0.6 with AspectJ LTW using spring-instrument.jar and: When removing CGLIB from…
Mohsen
  • 3,512
  • 3
  • 38
  • 66
1
2 3
10 11