Servlet spring-servlet is not available (Spring+Bl

2019-08-14 05:55发布

问题:

I'm trying to setup a Flex project using the Spring + BlazeDS integration by working through the refcard kindly posted by James Ward on refcards.dzone.com.

Some problems/challenges are sticking their heads out. The Tomcat deployment is going well, all the files are on the server and I can summon main.swf through the browser.

I get the following ActionScript exception when trying to make the AMF request to Spring/BlazeDS:

RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed: url: 'http://localhost:8080/blazeds/spring/messagebroker/amf'"

When placing the "Failed: url:" URL directly in the browser, Tomcat displays the following error message:

HTTP Status 404 - Servlet Spring MVC Dispatcher Servlet is not available

I've setup all the files like James Ward instructed on his refcard, application-config.xml, web.xml and services-config.xml are all in order as far as I can see.

Any ideas as to what I'm messing up?

PS: I'm noticing small changes in terms of James' refcard and the stable release of the integration. Is there something that changed after the M2 release that might be biting me in the behind?

回答1:

I have the same problem and I fixed it by adding backport-util-concurrent.jar and cfgatewayadapter.jar from test-drive-sample of flex-spring integration , thank you josamoto for your post , finally the integration works good .

regards



回答2:

If you follow along the reference card your URL would be http://localhost:8080/dzone-server/spring/messagebroker/amf. The context-root in the reference card is dzone-server.

The key step is to make sure the URL above matches the endpoint url defined in the services-config.xml. So the matching endpoint for the above URL would be:

<endpoint url="http://{server.name}:{server.port}/{context.root}/spring/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>

Note: this is almost the default added by creating a new flex project in Flex Builder except it has spring added to the endpoint URL.



回答3:

I'm going to answer my own question, it all boils down to me being the dummy. There where some .jars that I did not include in my WEB-INF/lib folder. I copied them accross from the blazeds+spring integration testdrive and that fixed my problem!