2 Replies Latest reply on Jul 2, 2007 11:34 AM by Zalder R

    2 problems after upgrading to 2.0.0.BETA1

    Zalder R Newbie

      After upgrading all libs and config files to seam 2.0.0.BETA1, I'm facing two problems :

      - I'm unable to access seam components from non jsf servlets (despite the <web:context-filter url-pattern="/servlet/*"/> configuration ... I get a "java.lang.IllegalStateException: No application context active at org.jboss.seam.Component.forName(Component.java:1690)" exception
      - a validation on a backing bean property using the @AssertTrue hibernate validator does not work anymore (@Email is still ok)

      Here are my 3 main configurations files ... maybe some mistake I made (?)

      components.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
      xmlns:core="http://jboss.com/products/seam/core"
      xmlns:drools="http://jboss.com/products/seam/drools"
      xmlns:security="http://jboss.com/products/seam/security"
      xmlns:mail="http://jboss.com/products/seam/mail"
      xmlns:transaction="http://jboss.com/products/seam/transaction"
      xmlns:persistence="http://jboss.com/products/seam/persistence"
      xmlns:web="http://jboss.com/products/seam/web"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
      http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
      http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
      http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
      http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
      http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
      http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
      http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">

      <core:init debug="@debug@" jndi-pattern="@jndiPattern@" />

      <core:manager concurrent-request-timeout="500"
      conversation-timeout="120000"
      conversation-id-parameter="cid"/>

      <core:pages no-conversation-view-id="/index.xhtml" />

      <!-- Seam-managed persistence context with JPA -->
      <persistence:managed-persistence-context name="em" auto-create="true">
      <persistence:persistence-unit-jndi-name>java:/@project.name@EntityManagerFactory</persistence:persistence-unit-jndi-name>
      </persistence:managed-persistence-context>

      <core:resource-bundle>
      <core:bundle-names>
      <value>myapp-messages</value>
      <value>myapp-internals-messages</value>
      </core:bundle-names>
      </core:resource-bundle>

      <core:locale-selector cookie-enabled="true" />

      <core:transactionListener />

      <web:multipart-filter create-temp-files="true"
      max-request-size="1000000"/>

      <security:identity authenticate-method="#{login.login}"/>

      <event type="org.jboss.seam.notLoggedIn">
      <action expression="#{redirect.captureCurrentView}" />
      </event>
      <event type="org.jboss.seam.postAuthenticate">
      <action expression="#{redirect.returnToCapturedView}" />
      </event>

      <!-- integrate custom servlet with seam contexts -->
      <web:context-filter url-pattern="/cm_servlets/*" />

      <drools:rule-base name="securityRules">
      <drools:rule-files>
      <value>/META-INF/security.drl</value>
      </drools:rule-files>
      </drools:rule-base>

      <transaction:ejb-transaction/>

      </components>


      web.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app version="2.4" 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_2_4.xsd">

      <!-- Ajax4jsf -->

      <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      </context-param>

      <context-param>
      <param-name>org.ajax4jsf.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>

      <!-- Seam -->

      <listener>
      <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
      </listener>

      <filter>
      <filter-name>Seam Filter</filter-name>
      <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
      </filter>

      <filter-mapping>
      <filter-name>Seam Filter</filter-name>
      <url-pattern>*.cm</url-pattern>
      </filter-mapping>

      <servlet>
      <servlet-name>Seam Resource Servlet</servlet-name>
      <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
      </servlet>

      <servlet-mapping>
      <servlet-name>Seam Resource Servlet</servlet-name>
      <url-pattern>/seam/resource/*</url-pattern>
      </servlet-mapping>

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>@debug@</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.SKIP_COMMENTS</param-name>
      <param-value>false</param-value>
      </context-param>

      <!-- JSF -->

      <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</param-value>
      </context-param>

      <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>*.cm</url-pattern>
      </servlet-mapping>

      <!--
      <security-constraint>
      <display-name>Restrict raw XHTML Documents</display-name>
      <web-resource-collection>
      <web-resource-name>XHTML</web-resource-name>
      <url-pattern>*.xhtml</url-pattern>
      </web-resource-collection>
      <auth-constraint>
      <role-name>NONE</role-name>
      </auth-constraint>
      </security-constraint>
      -->

      <!-- Export Servlet -->

      <servlet>
      <servlet-name>Export Servlet</servlet-name>
      <servlet-class>com.sopinspace.coment.servlets.ExportServlet</servlet-class>
      </servlet>

      <servlet-mapping>
      <servlet-name>Export Servlet</servlet-name>
      <url-pattern>/cm_servlets/export/*</url-pattern>
      </servlet-mapping>

      <error-page>
      <error-code>404</error-code>
      <location>/404.xhtml</location>
      </error-page>

      <session-config>
      <session-timeout>30</session-timeout>
      </session-config>

      </web-app>


      faces-config.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <faces-config version="1.2"
      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_1_2.xsd">

      <!-- i18n -->
      <application>
      <locale-config>
      <default-locale>en</default-locale>
      <supported-locale>en</supported-locale>
      <supported-locale>fr</supported-locale>
      </locale-config>
      <!-- not with ajax4jsf (?) <view-handler>com.sun.facelets.FaceletViewHandler</view-handler> -->
      </application>

      </faces-config>


        • 1. Re: 2 problems after upgrading to 2.0.0.BETA1
          Zalder R Newbie

          any help / hint ?

          • 2. "No application context active" error in remoting request wi
            Zalder R Newbie

            I'm still stuck with my problem : being unable to access seam components from within a "remoting" request. All worked fine using seam 1.3* but since the 2.0.0B1 upgrade I get the error :

            17:31:19,595 ERROR [ExecutionHandler] Error unmarshalling calls from request
            java.lang.IllegalStateException: No application context active
            at org.jboss.seam.Component.forName(Component.java:1690)
            at org.jboss.seam.remoting.wrapper.BeanWrapper.setElement(BeanWrapper.java:40)
            at org.jboss.seam.remoting.CallContext.createWrapperFromElement(CallContext.java:45)
            at org.jboss.seam.remoting.ExecutionHandler.unmarshalCalls(ExecutionHandler.java:147)
            at org.jboss.seam.remoting.ExecutionHandler.handle(ExecutionHandler.java:58)
            at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:113)
            at org.jboss.seam.servlet.SeamResourceServlet.doGet(SeamResourceServlet.java:69)
            at org.jboss.seam.servlet.SeamResourceServlet.doPost(SeamResourceServlet.java:78)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
            at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:63)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
            at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
            at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
            at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
            at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:595)