在Web服务器中使用GraniteDS + REST(Jersey)进行故障排除(Troubles with GraniteDS + REST (Jersey) in a web server)

编程入门 行业动态 更新时间:2024-10-26 08:26:26
在Web服务器中使用GraniteDS + REST(Jersey)进行故障排除(Troubles with GraniteDS + REST (Jersey) in a web server)

我正在尝试使Granite数据服务和REST服务在单个Web服务器中工作。 目标是使服务器应用程序支持GraniteDS类映射和Rest请求。

这些项目正在单独工作,但是当我将web.xml文件合并在一起并通过在相同路径中复制和粘贴类和配置将所有内容包装到一个项目中时,我在Flex请求上得到以下问题:

[RPC Fault faultString="[MessagingError message='Destination 'userService' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to 'userService'"] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:333] at mx.rpc.remoting::Operation/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\remoting\Operation.as:247] at mx.rpc.remoting::Operation/send()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\remoting\Operation.as:219] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.rpc::AbstractService/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AbstractService.as:353] at test/___test_Button1_click()[/Users/mkahler/Documents/Adobe Flash Builder 4.6/Comp3.6/src/test.mxml:11]

我的web.xml看起来像:

<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>NeoHermes</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/app-config.xml</param-value> </context-param> <listener> <listener-class>de.neo7even.neohermes.utils.AppServletContextListener</listener-class> </listener> <listener> <listener-class>org.granite.config.GraniteConfigListener</listener-class> </listener> <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>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> <servlet> <servlet-name>jersey-serlvet</servlet-name> <servlet-class> com.sun.jersey.spi.container.servlet.ServletContainer </servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>de.neo7even.neohermes.endpoint.rest.services</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey-serlvet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app>

I am trying to make Granite Data Services and REST services work inside a single web server. The goal is to have a Server Application that supports GraniteDS class mappings and Rest requests.

The projects are working separetedly but when I merge the web.xml files together and wrap everything into one project by copying and pasting classes and configs in the same paths I get the following Issue on a Flex request:

[RPC Fault faultString="[MessagingError message='Destination 'userService' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']" faultCode="InvokeFailed" faultDetail="Couldn't establish a connection to 'userService'"] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:333] at mx.rpc.remoting::Operation/http://www.adobe.com/2006/flex/mx/internal::invoke()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\remoting\Operation.as:247] at mx.rpc.remoting::Operation/send()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\remoting\Operation.as:219] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.rpc::AbstractService/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[C:\autobuild\3.x\frameworks\projects\rpc\src\mx\rpc\AbstractService.as:353] at test/___test_Button1_click()[/Users/mkahler/Documents/Adobe Flash Builder 4.6/Comp3.6/src/test.mxml:11]

My web.xml looks like :

<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>NeoHermes</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/app-config.xml</param-value> </context-param> <listener> <listener-class>de.neo7even.neohermes.utils.AppServletContextListener</listener-class> </listener> <listener> <listener-class>org.granite.config.GraniteConfigListener</listener-class> </listener> <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>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> <servlet> <servlet-name>jersey-serlvet</servlet-name> <servlet-class> com.sun.jersey.spi.container.servlet.ServletContainer </servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>de.neo7even.neohermes.endpoint.rest.services</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jersey-serlvet</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app>

最满意答案

尝试将AMFMessageServlet的load-on-startup值设置为2

Try setting the value of load-on-startup of the AMFMessageServlet to 2

更多推荐

本文发布于:2023-07-16 03:58:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1123430.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:故障排除   器中   REST   Web   GraniteDS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!