0

I am working on Struts2 and spring integrated project.

I am getting OGNL exception as: -

Error setting expression 'lookupLicProductSKU.udiPID' with value '[Ljava.lang.String;@1feae0f'
ognl.OgnlException: target is null for setProperty(null, "udiPID", [Ljava.lang.String;@1feae0f)

I also have Spring AOP configured for all the actions to capture few logs. When ever AOP in in action and when I get the OGNL exception specified above, the flow breaks. If I remove the AOP defined in applicationContext.xml, flow runs smooth though there are the above specified OGNL exceptions. I do not understand the reason why this is happening.

Is there a way to make it work with AOP in place? Please let me know.

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
kumarji.alluri
  • 197
  • 1
  • 3
  • 13
  • What is it you are doing via AOP. Share some code. – Rachit Agrawal Jun 11 '13 at 11:37
  • Maybe you need to fix this error. – Aleksandr M Jun 11 '13 at 12:07
  • I added AOP just for capturing few logs. I have added before and after point cuts. – kumarji.alluri Jun 11 '13 at 12:40
  • I added AOP to do logging using MDC context map. I just add few values to a map in my AOP aspect. Code is here- @After("execution(* com.kumar.swift.myapp.*.action.*.execute(..)) ") public void afterActionAspect(JoinPoint joinPoint) throws Throwable { Map mapObj = SplunkLogger.getSplunkLogger(); mapObj.put("ATT",(System.currentTimeMillis() - (Long)mapObj.get("AST")) / 1000); } – kumarji.alluri Jun 11 '13 at 12:44
  • This is my before point cut- @Before("execution(* com.kumar.swift.myapp.*.action.*.execute(..)) ") public void beforeActionAspect(JoinPoint joinPoint) throws Throwable { Map mapObj = SplunkLogger.getSplunkLogger(); mapObj.put("ACN", joinPoint.getTarget().getClass().getCanonicalName()); mapObj.put("AMN",joinPoint.getSignature().getName()); mapObj.put("AST", System.currentTimeMillis()); } – kumarji.alluri Jun 11 '13 at 12:46
  • Putting that much code in comments is useless. Edit the question. – Dave Newton Jun 11 '13 at 13:35
  • @user1321648 It couldn't set property because the bean has a null reference. This means you didn't instantiated it in the action or in a collection. – Roman C Jun 11 '13 at 16:04

0 Answers0