Uploaded image for project: 'Spring Integration Samples'
  1. Spring Integration Samples
  2. INTSAMPLES-72

Web Service Inbound Gateway Sample fails to run

    Details

    • Type: Defect
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 2.2 RC3
    • Component/s: Basic
    • Labels:

      Description

      The tests in the Web Service Inbound Gateway Sample fail to run.

      InboundGatewayTests
      While trying to run org.springframework.integration.samples.ws.InboundGatewayTests, it failed with:

      java.lang.NoSuchMethodError: org.springframework.beans.BeanUtils.instantiateClass(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/Object;
      	at org.springframework.test.context.ContextLoaderUtils.resolveContextLoader(ContextLoaderUtils.java:87)
      	at org.springframework.test.context.ContextLoaderUtils.buildMergedContextConfiguration(ContextLoaderUtils.java:298)
      	at org.springframework.test.context.TestContext.<init>(TestContext.java:100)
      	at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:117)
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:119)
      	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:108)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
      	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
      	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
      	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:29)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:40)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:30)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      

       
      InContainerTests
      For running the other test, org.springframework.integration.samples.ws.InContainerTests (referring to the sample's readme):

      • Created war with mvn clean package
      • Deployed the war file on Apache Tomcat 6.0.32
      • Ran the test
        The test failed with:
        org.springframework.ws.client.WebServiceTransportException: Internal Server Error [500]
        	at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:663)
        	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:587)
        	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:537)
        	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:492)
        	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:436)
        	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:421)
        	at org.springframework.integration.samples.ws.InContainerTests.testWebServiceRequestAndResponse(InContainerTests.java:53)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
        	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        

        From the tomcat's catalina.log, I found that the deployment of war failed with:

        SEVERE: Error deploying web application archive ws-inbound-gateway-2.1.0.BUILD-SNAPSHOT.war
        java.lang.NoClassDefFoundError: org/springframework/web/servlet/FrameworkServlet
        	at java.lang.ClassLoader.defineClass1(Native Method)
        	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
        	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
        	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
        	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
        	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
        	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)
        	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)
        	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)
        	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
        	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
        	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
        	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
        	at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
        	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
        	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
        	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:585)
        	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
        	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
        

        To avoid the deployment error, I added two dependencies spring-webmvc-3.1.0.RELEASE, spring-context-3.1.0.RELEASE to ws-inbound-gateway/pom.xml. After deploying the newly built war, again the test failed with:

        org.springframework.ws.client.WebServiceTransportException: Internal Server Error [500]
        	at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:663)
        	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:587)
        	at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:537)
        	at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:492)
        	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:436)
        	at org.springframework.ws.client.core.WebServiceTemplate.sendSourceAndReceiveToResult(WebServiceTemplate.java:421)
        	at org.springframework.integration.samples.ws.InContainerTests.testWebServiceRequestAndResponse(InContainerTests.java:53)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
        	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hillert Gunnar Hillert
                Reporter:
                nrochan Nihar Rochan
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: