希望有人可以帮助我。
我正在开发一个后端为 Spring MVC + Hibernate + Tomcat 7 和前端为 blazeDS + Cairngorm 的项目,我们需要从 blazeDS 迁移到 graniteDS 但我有一个:Channel.Connect.Failed 错误 NetConnection.Call。失败:HTTP:尝试与后端连接时的状态 500,并且在 tomcat 控制台中:
ERROR AMFMessageFilter:160 - AMF 消息错误 java.io.EOFException at java.io.DataInputStream.readUnsignedShort
我不明白我在这里缺少什么,我一直在网上寻找,我发现的最具代表性的资源是:http: //www.graniteds.org/public/docs/3.0.0/docs /reference/flex/en-US/html/index.html,http://narup.blogspot.com/2008/08/getting-started-project-graniteds-with.html _ _
提前致谢!
这是我的 web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>com.bamboo.common.factory.Log4JContextListener</listener-class>
</listener>
<!-- Spring listener -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-
class>
</listener>
<!-- read services-config.xml file at web application startup -->
<listener>
<listener-class>org.granite.config.GraniteConfigListener</listener-class>
</listener>
<!-- Spring listener for web-scopes (request, session) -->
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<!-- handle AMF requests ([de]serialization) -->
<filter>
<filter-name>AMFMessageFilter</filter-name>
<filter-class>org.granite.messaging.webapp.AMFMessageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AMFMessageFilter</filter-name>
<url-pattern>/graniteamf/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- handle AMF requests (execution) -->
<servlet>
<servlet-name>AMFMessageServlet</servlet-name>
<servlet-class>org.granite.messaging.webapp.AMFMessageServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AMFMessageServlet</servlet-name>
<url-pattern>/graniteamf/*</url-pattern>
</servlet-mapping>
</web-app>
和 services-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config.xml" />
</services>
<factories>
<factory id="springFactory" class="org.granite.spring.SpringServiceFactory" />
</factories>
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel" >
<endpoint url="http://{server.name}:{server.port}/{context.root}/graniteamf/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
</channels>
</services-config>
远程配置.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage" >
<destination id="remoteObject-destination">
<channels>
<channel ref="my-amf"/>
</channels>
<properties>
<factory>springFactory</factory>
<source>catalogFacade</source>
<scope>application</scope>
</properties>
</destination>
</service>