aspectj

Suppressing logs from AppClassLoader

一世执手 提交于 2019-12-25 03:54:15
问题 I'm using the spring-instrument java agent in a console application for load time weaving. The application starts up this way: java -javaagent:/path/spring-instrument-4.0.5.RELEASE.jar -classpath ... com.my.MainClass --argument It's working fine, but it's nicely printing these complementary messages in the stdout that I'd like to avoid: [AppClassLoader@24dbf79d] info AspectJ Weaver Version 1.8.1 built on Saturday Jun 21, 2014 at 00:07:06 GMT [AppClassLoader@24dbf79d] info register classloader

Spring Security AspectJMode with @EnableGlobalMethodSecurity not working

蓝咒 提交于 2019-12-25 03:27:28
问题 I am trying to move from XML Config to JavaConfig with spring-security 4.0.0.M1 This is my Configuration which works: @Configuration @ImportResource("classpath:applicationContext-security.xml") public class MethodSecurityXmlConfig {} and applicationContext-security.xml <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

Exclude annotated methods in AspectJ

情到浓时终转凉″ 提交于 2019-12-25 01:48:46
问题 Hi I want to exclude the annotated method here is the code. @Aspect public class ExceptionHandlingAspect { private static final String TAG = ExceptionHandlingAspect.class.getName(); @Pointcut("execution(* android.mobile.peakgames.net.aspectjandroid.AspectActivity.*(..)) " + "&& !@annotation(android.mobile.peakgames.net.aspectjandroid.exception.NoTryCatch)") public void exceptionEntryPoint() { } @AfterThrowing(pointcut = "exceptionEntryPoint()", throwing = "throwable") public void

Spring aop: Pointcut defined for subclasses but only one subclass is invoked

孤人 提交于 2019-12-25 00:33:55
问题 I am defining a JobProcess with a method Object process( JobContext jobContext ); with an impl called JobProcessImpl. Whenever this JobProcessImpl.process method is executed, I want to spy with more than one subclass. I want all this subclasses to be executed. The spy class is defined as base class Task to look for JobProcessImpl.process invocation. In the output, I always see that only log from AnnotationTask and not from ReviewTask. Please let me know, if it is possible and what is the

Using AspectJ project as a jar in other projects

半城伤御伤魂 提交于 2019-12-24 22:39:13
问题 Being new to AspectJ and Spring AOP, I have a Spring AOP project with Aspects defined in it. Pointcut is defined on annotation Loggable . Whenever a method with @Loggable is executed the advices should get executed. Annotation: @Target(ElementType.METHOD) @Retention(RUNTIME) public @interface Loggable { String customMessage() default ""; String[] properties() default {}; String type(); } Below is the Aspect class: LoggingAspect: @Aspect @Component public class LoggingAspect { private final

NoSuchMethodError javax.validation.Validator.forExecutables() but the Junit works

岁酱吖の 提交于 2019-12-24 20:16:06
问题 Why do I get this exception NoSuchMethodError javax.validation.Validator.forExecutables() when I run the application and the following method is called but the exception is never thrown if I call the method from a JUnit test, it executes perfectly. I'm using Spring AOP 3.2.4 + AspectJ and Hibernate Validator 5.0.1. It complains that it can't find the forExecutables method. Thanks @Before("execution(* com.sadc.missioncontrol.api.client.models.workRequest.MaintainTimesheet.getPublicHolidays(..)

Gradle/Eclipse: Different behavior of german “Umlaute” when using equality?

自作多情 提交于 2019-12-24 15:42:00
问题 I am experiencing a weird behavior with german "Umlaute" (ä, ö, ü, ß) when using Java's equality checks (either directly or indirectly. Everything works as expected when running, debugging or testing from Eclipse and input containing "Umlaute" is treated as equal or not as expected. However when I build the application using Spring Boot and run it, these equality checks fail for words that contain "Umlaute", i.e. for words like "Nationalität". Input is retrieved from a webpage via Jsoup and

How to use Dynamic Proxies with JSF when the method signature contains Object … args

本秂侑毒 提交于 2019-12-24 13:33:32
问题 I'm having some trouble with Spring, JPA and Dynamic Proxy DAO classes which are initialized as Spring Beans. This particular project has been plaguing me on the persistence/transaction side for some time, and I'd like to get this nailed down once and for all. First, here's a method from the DAO interface: /** * Perform a named query using numbered parameters and return the results as a list * @param name * @param params * @return query results */ List getNQasList(String name, Object...

Aspectj for anotations with classes not working

半世苍凉 提交于 2019-12-24 12:37:07
问题 Below code is not complied correctly with aspectJ import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.context.annotation.ImportResource; import org.springframework.core.type.AnnotatedTypeMetadata; @Configuration @Conditional(ConditionalConfiguration.Condition)

Difference between call and execution pointcuts in PHP?

守給你的承諾、 提交于 2019-12-24 10:35:29
问题 In AOP in Java (AspectJ) when we talk about method pointcuts, we can differentiate them into two different sets: method call pointcuts and method execution pointcuts . Basing on these resources here on SO: execution Vs. call Join point Difference between call and execution in AOP And some AspectJ background, we can tell that basically the differences between the two can be expressed as the following: Given these classes: class CallerObject { //... public void someMethod() {