517 questions
1
vote
1
answer
48
views
Annotate JUnit @Test case with custom aspect annotation
Spring beginner here.
I am making two custom annotations @Satisfy and @Verify, meant to be used to track
requirements in code.
@Satisfy denotes where the requirement is implemented
@Verify denotes ...
1
vote
1
answer
88
views
How to restrict aspectj-maven-plugin to only weave aspects from a dependency and ignore local aspects in the project
I’m currently using AspectJ alongside Spring AOP in my Maven project.
I want to enable compile-time weaving for aspects that are provided by a dependency (my-aspect-library) while retaining Spring’s ...
1
vote
0
answers
68
views
How do I implement an automatic error logger that handles both uncaught and caught (caught in try catch block) exceptions?
I was wondering if it is possible to implement an automatic error logger with specific functionality that logs errors into a PostGres Table. Basically, in my application i have both handled and ...
0
votes
0
answers
34
views
I can't run LogAspect using Castle DynamicProxy
I am using an Interceptors structure created with Castle DynamicProxy in the project and I wrote a LogAspect for logging operations. However, LogAspect is not triggered in any way. I am sharing my ...
0
votes
1
answer
57
views
Getting inner methods result variable data using Spring Boot Aspect @After Advice
I am wanting to capture the data returned by a method inside of a method I am wanting to perform advice on. I want to use @After, because this method can throw exceptions, and I want to capture this ...
0
votes
1
answer
258
views
Annotations with Spring Boot AOP do not work
I have been trying to get Spring AOP to work for the last day or two and have looked at many different resources but can't seem to get it working. I must be missing something obvious but I am spinning ...
0
votes
1
answer
211
views
Why is AspectJ Logging Not Triggering When Aspect and Interface are Annotated?
I'm looking for a way to get logging around methods.
So I've started looking at examples of Spring-AOP and AspectJ.
However, none of these seem to actually work, or at least are missing pieces in ...
1
vote
1
answer
37
views
Getting an error while making the below staticInitialisation advice generic
Since the below given advice works only for a specific class
@Before("staticinitialization(org.mazouz.aop.Main1)")
I tried to make the advice generic such that it can work for any package
@...
-1
votes
1
answer
149
views
Fitting an image inside of a circle when the aspect ratio is not 1:1
I have a form where users upload an avatar of themselves. Sometimes the file they upload is a perfect square, but often it's not. Here's the HTML I'm using to display the image:
<img src="&...
0
votes
0
answers
52
views
How to print the caller method name as the caller name in the aspect
Why does the Aspect print the caller class name instead of the calling method name in the caller information? When attempting to print the calling method name, why does it result in a StackOverflow ...
0
votes
1
answer
388
views
Spring Boot custom method annotation not working while using @Aspect
I am working on a spring boot application and I am trying to implement a custom annotation to log execution time and memory used by the method annotated with my custom annotation. I am not able to ...
0
votes
3
answers
431
views
simple Spring AOP, but Aspect won't be triggered [closed]
I am trying to Practice Spring AOP. The Problem is, My program is not what I expect.
It should Look something like this when Aspect works.
Sep 27, 2020 1:11:11 PM aspects.LoggingAspect log
INFO: ...
2
votes
2
answers
3k
views
AmbiguousBindingException On Spring Boot upgrade from 2.7.14 to 3.2.0
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthEndpointGroupsBeanPostProcessor' defined in class path resource [org/springframework/boot/actuate/...
1
vote
0
answers
95
views
Aspect AOP not intercepting all methods within pointcut
I have created an aspect for the purpose of error logging and reporting within a microservices system but it is not intercepting all the methods that throw an exception within the pointcut.
import ...
0
votes
1
answer
281
views
AspectJ in multithreading
Currently im working on a application that runs the same process(with different input parameters in this case TaskInformation) parallelly on 16 threads. I would like to create Aspect from which i ...
0
votes
1
answer
811
views
Hibernate filter not getting applied within Async process
I have a hibernate filter defined on my entities which I am injecting using aspect for all repositories which implements my TenantableRepository.
The issue is that the filter is not getting injected ...
0
votes
1
answer
29
views
i cannot see the aspect logs when i run the method to be intercepted
thats my code and this is only showing the logs as method is executed in intellij
INFO: Publishing comment: Demo comment. Also added the dependencies but still i cant see whats the error.
package com....
1
vote
0
answers
63
views
Postsharp aspects reach to HttpContext
I am using PostSharp, and within my aspects, I want to check a header from the incoming request during the entry phase of a method. I am unable to access HttpContext. Is there a way to achieve this?
...
1
vote
1
answer
78
views
How do I test private annotation aspect in spring boot?
How do I test private annotation aspect in spring boot ?
Example:
@Aspect
@Component
@Slf4j
public class AspectClass {
@AfterReturning(value = "@annotation(CustomAnnotation)")
...
1
vote
1
answer
722
views
How to implement interceptors/aspects in a dotnet Maui app?
I'm implementing a dotnet Maui app, and got to the point when I'd need some aspects to hanlde errors and certain responses.
In the past, I implemented interceptors using Castle Windsor, but how can I ...
0
votes
1
answer
259
views
Does Aspect Oriented Programming require recompilation whenever an aspect changes?
One important design principle is the OCP, which states that we would like our modules to be open for extension but closed to modification.
When we use Aspect Oriented Programming, we impact the whole ...
0
votes
1
answer
2k
views
Spring AOP with Spring Webflux after authentication
I have a Enabled Spring AOP for my logging purpose and use webflux for the API entrypoint,
things work fine if the api does not go through ReactiveAuthenticationManager like my login api but the ...
0
votes
1
answer
175
views
How to change pointCut expression inside an aspect which has been compiled when I use this aspect in other project?
I have a logging aspect like this, it will print args, result or any other exceptions. I use aspectj-maven-plugin to compile this aspect. Then, the compiled result will be packaged to a jar. I will ...
0
votes
1
answer
231
views
Cannot run ajc compiled class file in the terminal using Java
I trying to learn aspectj for a project. I wish to run the java files from the terminal using ajc and java but I am unable to do so.
I have 2 files in my directory HelloWorld.java and HWTracer.aj
...
0
votes
1
answer
45
views
First time trying to use Aspect. What if I want to output a different value for specific logs?
First of all, I am not 100% sure if my code is correct, since this is the first time I am ever using Aspect in Spring, so I will be happy if you point out any errors.
First a little background.
I have ...
3
votes
1
answer
496
views
How to labeling text based on aspect term and sentiment
I have coded to label text data by term aspect then sentiment with vader lexicon. But the result is only output -1 which means negative and 1 which means positive, where there should be 3 classes of ...
0
votes
0
answers
131
views
Not going inside the Aspect in Aspect-Oriented-Programming
Hello I am new to Aspect Oriented Programming and trying to understand some concepts.
I am writing a simple Spring Boot Application where I defined a dummyEndpoint where I am calling a method of a ...
3
votes
1
answer
562
views
Golang tgbotapi v5: sendVideo has wrong aspect ratio on iOS
I am using v5.5.1 of go-telegram-bot-api to send videos with the following code. However, the actual aspect ratio 4:5 is broken and video seems as 1:1 on iOS devices.
I also have MacOS and videos have ...
1
vote
1
answer
138
views
Aspect does not triggered
I am trying to implement read-only data source in my application.
According to the following repo implementation, this aspect method should be called when a transaction happens but it never triggers ...
1
vote
1
answer
251
views
Aspect not getting called on non-spring maven project
I'm using Java 8, testng, maven and selenium for UI automation frame work and trying to use aspectj to execute aspects before and after for switching iframes(entry and exit) when any method in an ...
0
votes
1
answer
485
views
How to test Aspects
I have found and tried to follow this answer by Roman Puchkovskiy with a detailed example, but I am missing some detail.
Here is the aspect I am trying to test:
package com.company.reporting.logger....
-1
votes
1
answer
64
views
(Unity)Game view and smartphone view are different
In the game view, it appears horizontally as expected, but in the smartphone view, it appears vertically. I do not know what is the problem. How to fix?(My smartphone has 1080 x 2400 pixels, 20:9 ...
0
votes
1
answer
528
views
Exception handler is not called when exception is thrown because of Interceptor Around [duplicate]
I have a method handleException that return a ResponseEntity :
@ExceptionHandler({Exception.class})
public ResponseEntity handleException(Exception e) {
Map<String, String> data = new ...
0
votes
2
answers
236
views
Pointcut on annotated method
I'm trying to add a custom annotation for JPA repository methods to have a advice on @Query value.
Below is the piece of code I tried
MyFilter class
@Aspect
@Component
public class MyFilter {
@...
0
votes
1
answer
2k
views
Aspect Method is not triggered
I'm trying to get my Aspect class to work but it gets completely ignored.
I have following files:
MyAnnotation.java
package annotations;
import java.lang.annotation.ElementType;
import java.lang....
0
votes
0
answers
294
views
Is it possible to use @Transactional annotation on aspect method instead of service method?
I have a micro-service project and I am adding a common feature to every service. For that I wrote code in my common service and it works fine as long as I put @Transactional annotation on every ...
1
vote
1
answer
1k
views
Spring AOP - How to pass in a different number of parameters?
I have an Aspect:
@Aspect
@Component
public class BusinessAspect {
@Around("@annotation(Business)")
public Object getCorrespondingBusiness(ProceedingJoinPoint joinPoint, Business ...
1
vote
1
answer
2k
views
Spring SQS Message Handler - add custom message attributes to existing message before sending it to Dead-Letter-Queue
Currently, the messages on source queue are sent to dead-letter-queue on every exception. My goal is to add custom attributes to the failed message so that engineers have more information about ...
0
votes
2
answers
595
views
Window aspect ratio varies depending on window size
I'm trying to understand how a program is determining the new width/height when resizing it.
One would think it's merely an aspect ratio like 4:3 (which would lead to a 1.333333 ish value) however as ...
0
votes
1
answer
631
views
Not able to read annotation property inside Aspect when writing pointcut in a method
I have a custom annotation as
annotation class MyHandler(val value:String)
I wrote an aspect for functions using this annotation, also reading the value within the annotation for my processing.
@...
9
votes
1
answer
3k
views
SwiftUI clipped image still accepts tap gesture [duplicate]
I have trouble clipping the image in SwiftUI
Here is the code with minimal wrong-working example:
struct TestView: View {
var body: some View {
Image("iPhone13Pro")
....
1
vote
1
answer
1k
views
SpringBoot application fails startup when I have Aspect defined on a Bean Method
Working with Springboot 2.7.0. I had a a working application and I made these changes on top of it
Aspect Configuration
@Configuration
@EnableAspectJAutoProxy
@ComponentScan
public class AspectConfig {...
1
vote
1
answer
988
views
Spring AOP, Use only one pointcut when two pointcut match
anyone have an idea of how doing that :
I have two pointcut, one generic and an one specific. The two pointcuts will intercept the same method invocation but I want to just call the specific pointcut.
...
0
votes
1
answer
820
views
How to interrupt JoinPoint execution in AOP
Is it possible to interrupt invoking the actual method from within the aspect execution?
For example:
public class CheckPermissionAspect {
@Around("@annotation(CheckPermission)")
...
1
vote
0
answers
751
views
Write an aspect class for my Dropwizard project?
Trying to write a aspectJ class for my dropwizard project. Below is the class
@Aspect
public class LoggingAspect {
@Around("execution(* javax.servlet.http.HttpServlet.*(..)) *)")
public ...
0
votes
1
answer
906
views
Is it possible to throw checked exception in Spring AOP?
Hello I'm trying to throw custom Exceptions from my @Aspect, but no matter what exception I throw, my Aspect is throwing UndeclaredThrowableException,
My custom exception is
public class ...
0
votes
0
answers
900
views
Retrieving the response body as an empty string in Spring AOP
I have a requirement wherein I need to save any request and response being passed to a Rest Controller in a database, so I decided to implement Spring AOP for the same. The issue that is now being ...
1
vote
1
answer
10k
views
as-pect.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module"
When I test with as-pect I get an error in CRUD dApp with NEAR. The whole error I get is as follows;
yarn test
[Error] There was a problem loading [/Users/malibilgin/Documents/Web3/order-management-...
0
votes
0
answers
60
views
@AfterReturning for multiple methods in a same controller AOP [duplicate]
I want to call multiple methods included in a same controller. But methods are different from input parameters. So I need to use one aspect method for those three methods included in same controller.
...
1
vote
0
answers
236
views
applying Aspect before spring security
I have an application that use spring security and JWT for Authorization and Authentication. Here you can see my security config
@Override
protected void configure(HttpSecurity http) throws ...