compile-time-weaving

eclipselink static weaving with final fields on Java 9

不打扰是莪最后的温柔 提交于 2021-02-19 01:56:41
问题 I have some JPA annotated fields declared final like this: @Column(name = "SOME_FIELD", updatable = false, nullable = false) private final String someField; Those fields are stored in the database when the entity is inserted in the database. They cannot further be updated. For the Java programming language, such fields can be considered final. With the EclipseLink static weaving plugin, it's possible to lazy load entities, owing to some byte code instrumentation. I don't know if such

Using AspectJ annotations in maven project: weaving is not working

。_饼干妹妹 提交于 2020-03-05 06:31:27
问题 I am trying to use AspectJ in a simple project without using Spring, and while I have seen similar questions and my code seems to be correct, I don't understand why it's not working. I'm using Eclipse Oxygen 4.7.3 (not using AJDT tools), JDK 7, maven 3.5.2, and my code is as follows: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

Using AspectJ annotations in maven project: weaving is not working

六眼飞鱼酱① 提交于 2020-03-05 06:31:05
问题 I am trying to use AspectJ in a simple project without using Spring, and while I have seen similar questions and my code seems to be correct, I don't understand why it's not working. I'm using Eclipse Oxygen 4.7.3 (not using AJDT tools), JDK 7, maven 3.5.2, and my code is as follows: pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

iajc fails to weave aspects from a jar but succeedes from class files

牧云@^-^@ 提交于 2020-01-14 03:13:30
问题 So I defined iajc task for my project that does intertype declarations just fine, then there is a separate jar task that creates a project.jar. Then there is iajc task for junit test target, this task references the project.jar with the goal of weaving its ITDs into test classes like so: <aspectpath> <pathelement path="${dist}/project.jar"/> <fileset dir="${lib.aspect}"> <include name="**/*.jar" /> <include name="**/*.zip" /> </fileset> </aspectpath> That does not work - compiler produces

How can I make sure that aspects generated by Spring roo are woven by a dependent project?

最后都变了- 提交于 2020-01-13 19:13:08
问题 I have a Spring Roo multi module project . I noticed that after including the jar/module containing my domain model in another project, the aspects had not been woven leaving me with domain classes without any usable getters/setters . How can I make sure that aspects generated by Spring roo are woven by the dependent project? EDIT : In order to be able to use Roo's aspects from another project, one needs to include the aspectJ plugin in the dependent project. Note that compile time loading is

Using Aspectj compile time weaving and Java compile time annotation processing in one project

橙三吉。 提交于 2019-12-24 09:52:48
问题 I have searched far and wide and have not found anything that would help me resolve my problem. I am trying to implement a certain functionality and I am creating a PoC solution, here is the issue though: it involves using both compile time weaved AspectJ and compile time annotation processors and I have no idea how to make both of those work at the same time. So far I have been using just AspectJ aspects in *.aj files with the aspectj-maven-plugin, and it was working fine. As soon as I tried

How do you use Java 1.6 Annotation Processing to perform compile time weaving?

女生的网名这么多〃 提交于 2019-12-18 04:51:31
问题 I have created an annotation, applied it to a DTO and written a Java 1.6 style annotationProcessor. I can see how to have the annotationProcessor write a new source file, which isn't what I want to do, I cannot see or find out how to have it modify the existing class (ideally just modify the byte code). The modification is actually fairly trivial, all I want the processor to do is to insert a new getter and setter where the name comes from the value of the annotation being processed. My

Spring with AspectJ compile-time weaving causing: java.lang.VerifyError: Illegal use of nonvirtual function call

懵懂的女人 提交于 2019-12-14 03:49:26
问题 I am trying to use Spring's @AspectJ compile-time weaving instead of <aop:autoproxy/> and it is causing some errors. First there are some warnings during the compilation phase: [WARNING] can not resolve this member: x.y.z.Severity[] x.y.z.ExceptionSeverity.values() [Xlint:unresolvableMember] Then when trying to run some tests that have advised methods I get the following exception: java.lang.VerifyError: (class: x/y/z/MonitoringAspect, method: ajc$inlineAccessMethod$x_y_z_MonitoringAspect$cx

Let eclipse use maven to compile/weave my code

自闭症网瘾萝莉.ら 提交于 2019-12-10 10:03:35
问题 I am using compile time weaving with aspectj to weave in Spring's transactional code so I can use @Transactional . When i run maven compile from inside Eclipse (which uses the aspectj-maven-plugin), eclipse synchronizes to the tomcat server and all goes well. But when Eclipse compiles (project->build automatically) it appears not to weave the spring transactional code and I get this error: javax.persistence.TransactionRequiredException: no transaction is in progress This is very annoying

Compile Time Weaving Null Pointer Exception

ⅰ亾dé卋堺 提交于 2019-12-08 10:28:20
问题 Edit 7: The problem seems to be how to get @Configurable working with HttpSessionListener , a workaround is suggested, but I'dd prefer not to to interact with the WebApplicationContext directly: @Configurable(autowire = Autowire.BY_TYPE, preConstruction = true) public class SessionListener implements HttpSessionListener { private static final Logger log; @Autowired private A a; @Override public void sessionCreated(HttpSessionEvent se) { a.doSomething(); // <- Throws NPE log.info("New session