Flex Cairngorm Spring Blazeds - 远程处理错误 - 请帮助我
当我尝试从 Flex/Cairngorm 应用程序访问远程 Java 类(在 Spring/BlazeDS 上)时,我似乎收到以下错误。我现在快要疯了,试图找出问题所在 - 任何帮助将不胜感激 - 谢谢迈克。
**Error: C0007E: RemoteObject not found for mycomponentsService
at RemoteObjects/getService()
at com.adobe.cairngorm.business::ServiceLocator/getRemoteObject()
at com.nomura.dashboard.client.business::DashBoardDelegate()**
我的所有配置文件如下:
Cairngorm - BusinessDelegate.as
this.service = ServiceLocator.getInstance().getRemoteObject("**mycomponentsService**");
Cairngorm - Services.mxml
mx:RemoteObject id="mycomponentsService"
destination="remotecomponentService"
showBusyCursor="true">
Spring/BlazeDS - application-config.xml
flex:remote-service ref="remotecomponentService"
bean id="remotecomponentService"
class="com.mycompany.dashboard.server.dao.ComponentsDAO"
Spring/BlazeDS - services-config.xml
channel-definition id="myamf" class="mx.messaging.channels.AMFChannel"
endpoint url="http://localhost:8080/dashboard-server/spring/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"
web.xml 还包含 Spring 引用 - 见下文
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4">
<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
<display-name>dashboard-server</display-name>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/*-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map /spring/* requests to the DispatcherServlet -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
</web-app>
I seem to be getting the following error when I try to access a Remote Java class (on Spring/BlazeDS) from the Flex/Cairngorm application. I am going crazy at the moment trying to see what is wrong - any help would be greatly appreciated - thanks Mike.
**Error: C0007E: RemoteObject not found for mycomponentsService
at RemoteObjects/getService()
at com.adobe.cairngorm.business::ServiceLocator/getRemoteObject()
at com.nomura.dashboard.client.business::DashBoardDelegate()**
All my config files are below:
Cairngorm - BusinessDelegate.as
this.service = ServiceLocator.getInstance().getRemoteObject("**mycomponentsService**");
Cairngorm - Services.mxml
mx:RemoteObject id="mycomponentsService"
destination="remotecomponentService"
showBusyCursor="true">
Spring/BlazeDS - application-config.xml
flex:remote-service ref="remotecomponentService"
bean id="remotecomponentService"
class="com.mycompany.dashboard.server.dao.ComponentsDAO"
Spring/BlazeDS - services-config.xml
channel-definition id="myamf" class="mx.messaging.channels.AMFChannel"
endpoint url="http://localhost:8080/dashboard-server/spring/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"
The web.xml also contains Spring references - see below
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4">
<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
<display-name>dashboard-server</display-name>
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/*-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map /spring/* requests to the DispatcherServlet -->
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/spring/*</url-pattern>
</servlet-mapping>
</web-app>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们也可以看看您的 web.xml 吗?我很惊讶地在端点 URL 中看到“spring”一词。我的端点看起来总是像
这样:我认为你的 services-config.xml 应该看起来更像这样。
我还建议不要对端点 URL 进行过多的硬编码。只需选择
Update:
OK,这样您的 web.xml 看起来就可以了,URL 中包含
spring
也是如此。我在 Spring 配置文件 (application-config.xml
) 中看到的是 Spring URL 映射。例如,在我的 Spring 配置文件中,除了 bean 定义之外,还有一个映射。例如:(我有一个基于 Spring 的应用程序,另一个使用 BlazeDS,但不是两者都有...所以我可能会遗漏一些东西。也就是说,我所要求的仍然应该是有效的。理论上但请持保留态度。)
也许需要进行一些超级基本的调试。您能否检查对服务器的调用是否在这些问题端点上返回
HTTP 404
?有几种方法可以做到这一点:GET /dashboard-server/spring/messagebroker/amf
的访问日志。这些请求的 HTTP 状态代码是什么? (免费、简单、无需新工具。)了解这些请求是否在通信堆栈上失败,这对于缩小问题范围非常有帮助。
Can we see your web.xml also please? I am surprised to see the word "spring" in the endpoint URL. My endpoints have always looked like
E.g.: I think your services-config.xml should look more like this.
I would also suggest not hardcoding the end-point URL so much. Just go with
Update:
OK, so your web.xml looks OK, as does having the
spring
in your URL. What I don's see in your Spring configuration file (application-config.xml
) is the Spring URL mapping. For example, in my Spring config files, in addition to the the bean definitions, there is a mapping. E.g.:(I have one app that is Spring-based, and another that uses BlazeDS, but not both...so I might be missing something. That said, what I'm asking still should be valid. In theory. But take it with a grain of salt.)
Maybe some some super basic debugging is in order. Can you check to see if the calls to your server are returning
HTTP 404
or not on theses problem endpoints? A couple ways to do this:GET /dashboard-server/spring/messagebroker/amf
. What is the HTTP status code for these requests? (Free, easy, no new tools.)It will very helpful to narrow down the problem to know if where these requests are failing on the communications stack.
我在下面附上了 web.xml。就“Spring”一词而言 - 我正在使用标准 BlazrDS/Spring 集成 WAR 文件,该文件需要“spring”存在。 bean id="remotecomponentService" 实际上是一个 Spring bean。
您是说即使使用 BlazeDS/Spring WAR 我也可以使用您上面的解决方案吗?
web.xml 还包含 Spring 引用 - 见下文
I have attached web.xml below. In terms of the word "Spring" - I am using the standard BlazrDS/Spring integration WAR file which requires "spring" to be there. The bean id="remotecomponentService" is acutally a Spring bean.
Are you saying even with the BlazeDS/Spring WAR I can use your solution above?
The web.xml also contains Spring references - see below