Announcement Announcement Module
Collapse
No announcement yet.
Bean Proxy Losing Argument Values Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bean Proxy Losing Argument Values

    Our team has a Spring based application exposing SOAP services via JaxWS and core Spring DI throughout the application stack. While testing performance of this application we've come across a fatal error where by the arguments passed into an injected internal service become null at a certain load and remain null for all subsequent invocations of the service regardless of the load. The only way to clear this issue is by restarting the application. In logging of the arguments, we can see the object passed into the service is not null but by the time the object reaches the service implementation via spring proxying, the object becomes null. Note, we've experienced this issue at multiple service methods at varying load levels. I've copied some snippets of our setup below for reference. Any help is greatly appreciated.

    Server: WebLogic Server 10.3.5.0.2
    Java Version: Oracle JRockit(R) Version R28.1.4-7-144370-1.6.0_26-20110617-2130-linux-x86_64
    Tested Spring Versions: 3.1.2 - 3.1.4

    Code:
    <bean name="sampleMediator" class="com.example.SampleMediator" />
    Code:
    public class SampleMediator {
        ...
        @Inject
        public SampleMediator(final CartService cartService) {
            this.cartService = cartService;
        }
    
       ...
    
       private CartServiceResult addItemToCart(final UpdateCartRequest updateCartRequest, final CartItem cartItem) {
            final CartServiceRequest request = new CartServiceRequest(updateCartRequest, cartItem); <<< Verified object is not null
            return cartService.addItem(request);
        }
      
       ...
    }
    Code:
    public interface CartService {
         CartServiceResult addItem(AddItemToCartRequest request);
    }
    Code:
    public class SampleCartService implements CartService{
        public CartServiceResult addItem(final CartServiceRequest request) {
            return addItem(request.getUpdateCartRequest(), request.getCartItem());  <<< This line throws a NullPointer
        }
    }
    Code:
    java.lang.NullPointerException
    	at com.example.SampleCartService.addItem(SampleCartService.java:163)
    	at sun.reflect.GeneratedMethodAccessor554.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:319)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy78.addItem(Unknown Source)
    	at com.example.SampleMediator.addItemToCart(SampleMediator.java:164)
Working...
X