4 Replies Latest reply on Aug 16, 2010 12:51 PM by PHANTOMIASA

    Channel.Connect.Failed error & flex.samples.factories.SpringFactory not found

    PHANTOMIASA Level 1

      Hello to all!

       

      I use Eclipse with the Flash Builder 4 Plugin and I want to run a Flex4<->BlazeDS4<->J2EE (with Spring) application.

      I changed the context-root (serverContextRoot="/my-project" in file .flexProperties) to /my-project, but now I get this error, calling a Java backend method:

       

      In the Flash Player:

      [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500: url: 'http://localhost:8080/my-project/messagebroker/amf'"]
          at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[X:\flex\trunk\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:345]
          at mx.rpc::Responder/fault()[X:\flex\trunk\frameworks\projects\rpc\src\mx\rpc\Responder.as:68]
          at mx.rpc::AsyncRequest/fault()[X:\flex\trunk\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:113]
          at mx.messaging::ChannelSet/faultPendingSends()[X:\flex\trunk\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1614]
          at mx.messaging::ChannelSet/channelFaultHandler()[X:\flex\trunk\frameworks\projects\rpc\src\mx\messaging\ChannelSet.as:1206]
          at flash.events::EventDispatcher/dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.messaging::Channel/connectFailed()[X:\flex\trunk\frameworks\projects\rpc\src\mx\messaging\Channel.as:1128]
          at mx.messaging.channels::PollingChannel/connectFailed()[X:\flex\trunk\frameworks\projects\rpc\src\mx\messaging\channels\PollingChannel.as:406]
          at mx.messaging.channels::AMFChannel/statusHandler()[X:\flex\trunk\frameworks\projects\rpc\src\mx\messaging\channels\AMFChannel.as:453]
      
      

       

      And in Eclipse (Console tab) after getting the error of the frontend:

      **** MessageBrokerServlet in application 'my-project' failed to initialize due to runtime exception:   Exception: flex.messaging.config.ConfigurationException: An error occurred trying to construct FlexFactory 'flex.samples.factories.SpringFactory'.   The underlying cause is: 'flex.messaging.MessageException: Cannot create class of type 'flex.samples.factories.SpringFactory'. Type 'flex.samples.factories.SpringFactory' not found.'.
          at flex.messaging.config.FactorySettings.createFactory(FactorySettings.java:73)
          at flex.messaging.config.MessagingConfiguration.createFactories(MessagingConfiguration.java:158)
          at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:108)
          at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:132)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at java.lang.Thread.run(Unknown Source)
      Caused by: flex.messaging.MessageException: Cannot create class of type 'flex.samples.factories.SpringFactory'. Type 'flex.samples.factories.SpringFactory' not found.
          at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)
          at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:53)
          at flex.messaging.config.FactorySettings.createFactory(FactorySettings.java:56)
          ... 15 more
      
      23.06.2010 16:05:31 org.apache.catalina.core.StandardWrapperValve invoke
      FATAL: Allocate exception for servlet MessageBrokerServlet
      flex.messaging.MessageException: Cannot create class of type 'flex.samples.factories.SpringFactory'. Type 'flex.samples.factories.SpringFactory' not found.
          at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)
          at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:53)
          at flex.messaging.config.FactorySettings.createFactory(FactorySettings.java:56)
          at flex.messaging.config.MessagingConfiguration.createFactories(MessagingConfiguration.java:158)
          at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:108)
          at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:132)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at java.lang.Thread.run(Unknown Source)
      
      

       

      So, what is wrong here? I am using Spring 3.0.3, because it seems that this is a problem caused with Spring?

       

      Best Regards PHANTOMIAS.