Интеграция flex с graniteds

#java #apache-flex #graniteds

#java #apache-flex #graniteds

Вопрос:

У меня есть серверный API wirtten на Java, а клиентская часть написана на flex, и я пытаюсь настроить их вместе, используя GraniteDS. Однако при попытке добавить эту строку:

<graniteds:flex-filter url-pattern="/*"/>

к ApplicationContext.xml — затем при попытке развернуть мое веб-приложение (через glassfish) на сервере я получаю эту ошибку:

org.apache.catalina.LifecycleException: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 86 in XML document from ServletContext resource [/WEB-INF/commonContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'graniteds:flex-filter'.

Есть идеи, в чем может быть проблема?

Ответ №1:

В вашем commonContext.xml файле вы должны определить xmlns:graniteds пространство имен и соответствующее ему xsi:schemaLocation .

Как указано в документации:

 <?xml version="1.0" encoding="UTF-8"?>
<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:graniteds="http://www.graniteds.org/config"
  xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://www.graniteds.org/config http://www.graniteds.org/public/dtd/2.1.0/granite-config-2.1.xsd">

  <graniteds:flex-filter url-pattern="/*" />

</beans>