Am 06.11.2014 um 18:09 schrieb Lukasz Lenart:
2014-11-06 18:00 GMT+01:00 Lukasz Lenart <[email protected]>:
2014-11-06 17:02 GMT+01:00 Volker Krebs <[email protected]>:
I still have an odd behavior and can't figure out what has changed from
2.3.16.3 to 2.3.18
We have an Action with an service interface as class member.
Something like this pseudo Action:
public class EditAction extends ActionSupport implements Preparable {
protected MyService myService;
public void prepare() throws Exception {
myService = new MyServiceImpl();
}
public String execute() throws Exception {
myService.doSomething();
}
}
In 2.3.16.3 this works fine.
In 2.3.18 I get the following exception.
As you can see from the stack trace we're using spring integration plugin.
2014-11-06 03:14:05,040 ERROR [http-bio-60123-exec-5]
com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler - Could not
create and/or set value back on to object
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'com.mycompany.interfaces.MyService': Could not resolve matching
constructor
at
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:238)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowire(AbstractAutowireCapableBeanFactory.java:308)
at
com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:194)
at
com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.createObject(InstantiatingNullHandler.java:163)
at
com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.nullPropertyValue(InstantiatingNullHandler.java:137)
at
com.opensymphony.xwork2.ognl.OgnlNullHandlerWrapper.nullPropertyValue(OgnlNullHandlerWrapper.java:21)
at ognl.ASTProperty.getValueBody(ASTProperty.java:118)
at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
at ognl.SimpleNode.getValue(SimpleNode.java:258)
at ognl.ASTChain.setValueBody(ASTChain.java:222)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
at ognl.SimpleNode.setValue(SimpleNode.java:301)
at ognl.Ognl.setValue(Ognl.java:737)
at
com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:287)
at
com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:282)
at
com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:282)
at
com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:185)
at
com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:172)
at
com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:150)
at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:309)
at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:227)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:244)
at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:81)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
Any Ideas ?
Nope :( I was digging around but I don't see anything special. Can you
prepare a demo app or post more data?
Just note that the exception is logged in InstantiatingNullHandler
when it tries to create an object which is null and on which you want
set a value
I'm using a params, prepare, params interceptor stack.
The member "myService" (from the example above) is null
and the parameter interceptor tries to initialize it.
Trying to instantiate the Interface.
Is it possible to set ReflectionContextState#CREATE_NULL_OBJECTS to
false via struts config ? This would help.
But I'm also trying to prepare a small example, since this might be an
update issue from 2.3.16.3 to 2.3.18
Regards
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]