2013-09-09 4 views
0

Я wiritng портлет для Liferay и нужен компонент ace: fileEntry. У меня уже были некоторые проблемы, которые я, наконец, смог решить. Но теперь я столкнулся с проблемой, которую я не могу понять.Liferay-Portlet 6.1.20 с ICEFaces 3.3.0: ace: fileEntry и icepush

Если на странице просмотра, где включен ace: fileEntry, открыт, после плюс минус 90 секунд появится всплывающее окно с сообщением «Network Connection Interrupted», и мне нужно перезагрузить страницу. После некоторых исследований я обнаружил следующие строки в моем браузере-консоли:

[icepush.0086c.async-connection] closing previous connection... 
[icepush.0086c.async-connection] connect... 
[icepush.0086c.async-connection] empty response received 
[icepush.0086c.async-connection] closing previous connection... 
[icepush.0086c.async-connection] connect... 
[icepush.0086c.async-connection] empty response received 
[icepush.0086c.async-connection] closing previous connection... 
[icepush.0086c.async-connection] connect... 
[icepush.0086c.async-connection] empty response received 
[icepush.0086c.async-connection] blocking connection stopped, too many empty responses received... 
[icepush.0086c.async-connection] failed to connect, first retry... 
[icepush.0086c] connection in trouble 
[icepush.0086c.async-connection] closing previous connection... 
[icepush.0086c.async-connection] connect... 
[icepush.0086c.async-connection] empty response received 
[icepush.0086c.async-connection] blocking connection stopped, too many empty responses received... 
[icepush.0086c.async-connection] failed to connect, second retry... 
[icepush.0086c] connection in trouble 
[icepush.0086c.async-connection] closing previous connection... 
[icepush.0086c.async-connection] connect... 
[icepush.0086c.async-connection] empty response received 
[icepush.0086c.async-connection] blocking connection stopped, too many empty responses received... 
[icepush.0086c] connection to server was lost 

Я использую следующие версии Liferay и ICEfaces:

  • Liferay Portal 6.1.20-EE-gÀ2
  • LifeRay-Грани-мост-IMPL 3.1.2-Ga3
  • ICEfaces 3.3.0

Мои web.xml выглядит как это:

<?xml version="1.0"?> 

<web-app 
    version="3.0" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" 
> 
    <listener> 
     <listener-class> 
      org.springframework.web.context.ContextLoaderListener 
     </listener-class> 
    </listener> 
    <listener> 
     <listener-class> 
      org.springframework.web.context.request.RequestContextListener 
     </listener-class> 
    </listener> 
    <context-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>/WEB-INF/applicationContext.xml</param-value> 
    </context-param> 
    <!-- Instruct Mojarra to utilize JBoss-EL instead of the EL implementation provided by the servlet container. --> 
    <context-param> 
     <param-name>com.sun.faces.expressionFactory</param-name> 
     <param-value>org.jboss.el.ExpressionFactoryImpl</param-value> 
    </context-param> 
    <!-- Instruct ICEfaces to abstain from adding a random query parameter to resource URLs (which it does by default --> 
    <!-- in order to prevent caching of JavaScript resources like bridge.js in a servlet-based webapp). --> 
    <context-param> 
     <param-name>org.icefaces.uniqueResourceURLs</param-name> 
     <param-value>false</param-value> 
    </context-param> 
    <!-- Production wegen Test ob bestimmte Messages verschwinden --> 
    <context-param> 
     <param-name>javax.faces.PROJECT_STAGE</param-name> 
     <param-value>Production</param-value> 
    </context-param> 
    <context-param> 
     <param-name>com.icesoft.faces.concurrentDOMViews</param-name> 
     <param-value>true</param-value> 
    </context-param> 
    <context-param> 
     <param-name>org.icefaces.mandatoryResourceConfiguration</param-name> 
     <param-value>dataTable richTextEntry fileEntry</param-value> 
    </context-param> 
    <!-- Although the FacesServlet will not be invoked by any portlet requests, it is required to initialize JSF. --> 
    <servlet> 
     <servlet-name>Faces Servlet</servlet-name> 
     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>Faces Servlet</servlet-name> 
     <url-pattern>/icefaces/*</url-pattern> 
    </servlet-mapping> 
    <servlet> 
     <servlet-name>Resource Servlet</servlet-name> 
     <servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>Resource Servlet</servlet-name> 
     <url-pattern>/xmlhttp/*</url-pattern> 
    </servlet-mapping> 
    <resource-ref> 
     <res-ref-name>mail/MailSession</res-ref-name> 
     <res-type>javax.mail.Session</res-type> 
     <res-auth>Container</res-auth> 
    </resource-ref> 
</web-app> 

Мое лицо-config.xml выглядит следующим образом:

<?xml version="1.0" encoding="UTF-8"?> 
<faces-config 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" 
    version="2.0"> 
     <application> 
      <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> 
     </application> 
     <lifecycle> 
      <phase-listener>com.liferay.faces.util.lifecycle.DebugPhaseListener</phase-listener> 
      <phase-listener>com.liferay.faces.util.lifecycle.ViewScopePhaseListener</phase-listener> 
     </lifecycle> 
     <navigation-rule> 
      <from-view-id>/views/*</from-view-id> 
      <navigation-case> 
       <from-outcome>warenkorb</from-outcome> 
       <to-view-id>/views/warenkorb.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <from-outcome>checkout</from-outcome> 
       <to-view-id>/views/bestellprozess.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <from-outcome>bestelluebersicht</from-outcome> 
       <to-view-id>/views/bestelluebersicht.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <to-view-id>/views/index.xhtml</to-view-id> 
      </navigation-case> 
     </navigation-rule> 
     <navigation-rule> 
      <from-view-id>/adminviews/*</from-view-id> 
      <navigation-case> 
       <from-outcome>neueKategorie</from-outcome> 
       <to-view-id>/adminviews/neueKategorie.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <from-outcome>verwaltungKategorie</from-outcome> 
       <to-view-id>/adminviews/verwaltungKategorie.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <from-outcome>neuerArtikel</from-outcome> 
       <to-view-id>/adminviews/neuerArtikel.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <from-outcome>absenderMail</from-outcome> 
       <to-view-id>/adminviews/absenderMail.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <from-outcome>bestaetigungsMail</from-outcome> 
       <to-view-id>/adminviews/bestaetigungsMail.xhtml</to-view-id> 
      </navigation-case> 
      <navigation-case> 
       <to-view-id>/adminviews/index.xhtml</to-view-id> 
      </navigation-case> 
     </navigation-rule> 
</faces-config> 

Мой viewpage.xhtml где туз: FileEntry помещается выглядит следующим образом:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
     xmlns:ace="http://www.icefaces.org/icefaces/components" 
     xmlns:ice="http://www.icesoft.com/icefaces/component" 
     xmlns:f="http://java.sun.com/jsf/core" 
     xmlns:h="http://java.sun.com/jsf/html" 
     xmlns:ui="http://java.sun.com/jsf/facelets"> 
    <h:body> 
     <ui:composition template="/adminviews/index.xhtml"> 
      <ui:define name="content"> 
       <ace:panel header="Neuen Artikel anlegen"> 
        <ice:form> 
         <ace:textEntry id="artikelnr" 
            label="Artikelnummer:" 
            labelPosition="left" 
            required="true" 
            requiredMessage="required" 
            value="#{addingBean.newArtikel.artikelnummer}"> 
         </ace:textEntry> 
         <br /> 
         <ace:textEntry id="bezeichnung" 
            label="Bezeichnung:" 
            labelPosition="left" 
            required="true" 
            requiredMessage="required" 
            value="#{addingBean.newArtikel.bezeichnung}"> 
         </ace:textEntry> 
         <br /> 
         <ace:textEntry id="preis" 
            label="Einzelpreis (netto):" 
            labelPosition="left" 
            required="true" 
            requiredMessage="required" 
            value="#{addingBean.newArtikel.preis1}"> 
         </ace:textEntry> 
         <br /> 
         <ace:textEntry id="bestand" 
            label="Bestand:" 
            labelPosition="left" 
            required="true" 
            requiredMessage="required" 
            value="#{addingBean.newArtikel.bestand}"> 
         </ace:textEntry> 
         <br /> 
         <ace:textAreaEntry id="beschreibung" 
            label="Beschreibung:" 
            labelPosition="left" 
            value="#{addingBean.newArtikel.beschreibung}"> 
         </ace:textAreaEntry> 
         <br /> 
         <ace:simpleSelectOneMenu label="Steuerschlüssel:" 
               labelPosition="left" 
               value="#{addingBean.steuerId}" 
               required="true"> 
          <f:selectItem itemValue="" itemLabel="bitte auswählen ..." /> 
          <f:selectItems value="#{requestBean.allSteuerItems}"/> 
         </ace:simpleSelectOneMenu> 
         <br /> 
         <ace:simpleSelectOneMenu label="Kategorie:" 
               labelPosition="left" 
               value="#{addingBean.kategorieId}"> 
          <f:selectItem itemValue="null" itemLabel="keine Kategorie" /> 
          <f:selectItems value="#{requestBean.allKategorieItems}" /> 
         </ace:simpleSelectOneMenu> 
         <br /> 
         <ice:commandButton value="Speichern" 
            actionListener="#{addingBean.addArtikel}" 
            action="default"/> 
        </ice:form> 
        <ice:form> 
         <ice:commandButton value="Abbrechen" 
              action="default"/> 
        </ice:form> 
        <h:form id="bildupload"> 
         <ace:fileEntry id="bild" 
            label="Bildupload" 
            fileEntryListener="#{addingBean.bildListener}" 
            maxFileCount="1" 
            relativePath="/images/"/> 
         <h:commandButton value="Upload"/> 
        </h:form> 
        <ace:messages/> 
       </ace:panel> 
      </ui:define> 
     </ui:composition> 
    </h:body> 
</html> 

ли кто-нибудь вы знаете, как решить проблему или почему это происходит?

ответ

2

Liferay Лицо команда видела это произошло в одном из наших тестовых сред, и обходной путь был, чтобы исключить зависимость icepush.jar из проекта:

<dependency> 
    <groupId>org.icefaces</groupId> 
    <artifactId>icefaces</artifactId> 
    <version>3.3.0</version> 
    <exclusions> 
     <exclusion> 
      <groupId>org.icepush</groupId> 
      <artifactId>icepush</artifactId> 
     </exclusion> 
    </exclusions> 
</dependency> 
+0

кажется, работает после исключения icepush, спасибо вы очень! :) – marc0o

+0

Мне жаль, что я не могу проголосовать за ваш ответ, моя репутация слишком низкая: D – marc0o

+0

np, рад слышать, что это помогло. –