views:

1876

answers:

4

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?

A: 

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.

Boiler Bill
I had it like that, still didn't work. I tried mapping the servlet url as they do in the Spring-Flex testdrive samples. I basically changed the servlets url pattern to /messagebroker/* from /spring/*. I've just deleted the project, starting over, maybe I get it right this time.
Joe Zephyr
I've recreated the project, but the problem is still the same. This time I didn't fiddle with any URL's except to change my context. The url for the message broker is http://localhost:8080/blazeds/spring/messagebroker/amf. The flex .swf is loading in the browser meaning the context is correct. No idea about the rest though.
Joe Zephyr
What about adding /spring/ to both endpoint defintions in services-config.xml (by default that file has the same URL minus the spring node)?
Boiler Bill
As part of the refcard, James gets you to update them already, here's what mine look like:http://{server.name}:{server.port}/{context.root}/spring/messagebroker/amf
Joe Zephyr
...and the url pattern for my servlet: <url-pattern>/spring/*</url-pattern>
Joe Zephyr
I'm tired and silly...I'm getting a class not found exception on org.springframework.web.servlet.DispatcherServlet. So I forgot to include something, but what. I already included spring.jar, the blaze integration jar and the antlr jar. What am I missing?
Joe Zephyr
I just copied all the jars from the spring/dist/modules folder. And I'm now getting a different error, which is good: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.NullPointerException
Joe Zephyr
A: 

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!

Joe Zephyr
A: 

And what jars were these?

EK
A: 

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

sami boussacsou