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
4
votes
1 answer

AspectJ load-time weaving + Spring 3.0.5.RELEASE + Tomcat 7 not working

I am trying to figure out why load-time weaving is not working yet for my web application. For my normal application (not webapp) it is working. The test-project can be found on github (github/peterbollen/helloLtw): helloLtwAspect When I start the…
Peter Bollen
  • 59
  • 1
  • 5
4
votes
1 answer

Load time weaving for non-spring beans in a spring application

I have a spring boot application with some REST controllers, service classes and helper classes. The controllers and service classes are spring managed while helper classes are not spring managed and mostly contain static methods. The AspectJ…
Avi
  • 1,070
  • 1
  • 15
  • 28
4
votes
1 answer

LazyToOne and Spring LoadTimeWeaver

I have the known problem, that Hibernate loads the data eager even with the annotation fetchtype.lazy (described for example here: http://justonjava.blogspot.de/2010/09/lazy-one-to-one-and-one-to-many.html). So I added the annotation…
BenHeid
  • 214
  • 2
  • 14
4
votes
1 answer

How to set Spring weaver options in Java config class?

I am using Spring AOP with the provided default DefaultContextLoadTimeWeaver. I would like to be able to weave persisted entities and I know I have to set a weaver option (warning from console): warning javax.* types are not being woven because the…
3
votes
1 answer

EnableLoadTimeWeaving annotation causes application context to fail to load

I am trying to enable AspectJ load-time weaving (not Spring AOP) in a Spring Boot application. My goal is to weave advice into annotated fields and java.lang.reflect.Field.set(Object, Object) at load-time. Per the Spring docs, I…
3
votes
1 answer

Load-Time-Weaving differences between aspectj-weaver and spring-weaver

I am having some strange problems using spring and Load-Time-Weaving using AspectJ. In one of my Apsects, I wanted to react on invocations of the "doAuthentication" Method of the class org.springframework.flex.security3.SpringSecurityLoginCommand.…
Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34
3
votes
1 answer

How to use Spring AOP + AspectJ LTW combined in one application?

Maybe some people here know me. Usually I am the guy answering AspectJ questions. I consider myself kind of an expert there. In many cases I also answer Spring AOP questions even though I am not a Spring user. There are two things, though, which…
kriegaex
  • 63,017
  • 15
  • 111
  • 202
3
votes
1 answer

AspectJ AOP LTW not working with dynamic loading of javaagent

Here is my sample non-working project. It contains 2 modules: aop-lib - Aspects used as lib. It contains the following classes Wrap.java - It's the annotation used to attach advice WrapDef.java - It is the definition of the above mentioned Wrap…
Pankaj Singhal
  • 15,283
  • 9
  • 47
  • 86
3
votes
1 answer

Simple @Configurable with modern spring-boot + gradle

My goal is to get a bare bones aspectj+spring aop setup such that I can use @Configurable on one class. One additional restriction is that it needs to use load-time weaving as Lombok doesn't work with CTW. The good news: I have it working! The bad…
Casey
  • 6,166
  • 3
  • 35
  • 42
3
votes
1 answer

How do you enable AspectJ to execute advice on a joinpoint called by a method of the same class?

I'm implementing an AOP-based caching layer similar to Spring Cache, and I'm having trouble getting my advice to execute when the joinpoint is called by another method in its own class. I was initially using Spring AOP's AspectJAutoProxy, and I…
Jared
  • 2,043
  • 5
  • 33
  • 63
3
votes
0 answers

Hibernate 5 with Static Weaving - Fetching explicitly defined relationships

I've been reviewing various JPA implementations (OpenJPA, Eclipselink, Hibernate so far) and while testing Hibernate 5 I've run into an issue with obtaining relationships explicitly defined by a SQL Select statement. Here's an example set of…
3
votes
0 answers

ClassFormatError while using TomcatInstrumentableClassLoader : illegal modifiers: 0x18

I am using TomcatInstrumentableClassLoader to implement AspectJ Load Time Weaving. During initial setup of my application I use ClassUtils.getClass() to load all classes. At this stage I am getting java.lang.ClassFormatError : Method…
Achyut
  • 35
  • 3
3
votes
1 answer

Spring Boot load time weaving doesn't work in embedded tomcat

I can't get LTW to work in Spring Boot 1.2.2 w/ Embedded Tomcat. My application is a WAR file, not a .JAR file. When I run in DEBUG, it never stops in my aspect even with hitting calls that should match the pointcuts, so that is how I figure it is…
Jason
  • 2,006
  • 3
  • 21
  • 36
3
votes
1 answer

AspectJ and Java8 - bad type on operand stack

Looking at This Eclipse Bug it seems the Java Verifier (since 1.6) has had issues with ApsectJ. The bug says AspectJ 1.8.1 will fix the problem. But using that with Java8u11 I still get the verify error. I'm running JUnit4 under STS 3.6.0 (Eclipse…
Terry
  • 911
  • 10
  • 26
3
votes
1 answer

Apache Felix OSGi framework's WeavingHook.weave() method isn't invoked

I use fabric8-karaf-1.1.0.CR5 which includes: .../system/org/apache/felix/org.apache.felix.framework/4.0.3.redhat-610379/org.apache.felix.framework-4.0.3.redhat-610379.jar .../org.apache.felix.framework-4.0.0/doc/changelog.txt contains: ** New…
Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
1 2
3
10 11