4 Replies Latest reply on Apr 16, 2007 8:28 AM by Juan Francisco Valdes Gayo

    maven repository issues

    Siarhei Dudzin Apprentice

      Hi all,

      I tried to use ajax4jsf repository with the following location (took a while to find :) ): http://repository.jboss.com/maven2

      At this location ajax4jsf 1.1.0 is available, however if I use simple dependency definition

      <dependency>
       <groupId>org.ajax4jsf</groupId>
       <artifactId>ajax4jsf</artifactId>
       <version>1.1.0</version>
       </dependency>


      I also get jsf-api-1.1_02.jar and jsf-impl-1.1_02.jar in my war file along with already defined myfaces libs. I do not expect ajax4jsf to install jsf ri libs however this happens.

      Has anybody tried to use this repository for ajax4jsf so that it doesn't install 'unwannable' jars? The default repository and the one on http://myfaces.zones.apache.org/dist/maven-repository don't have ajax4jsf installed so this repository is the closest thing to a public repository that could be used in a production environment...

      Thanks in advance.

        • 1. Re: maven repository issues
          Alexander Smirnov Master

          With myfaces, Include dependency to ajax4jsf as :

          <dependency>
           <groupId>org.ajax4jsf</groupId>
           <artifactId>ajax4jsf</artifactId>
           <version>1.1.1-SNAPSHOT</version>
           <exclusions>
           <exclusion>
           <groupId>javax.faces</groupId>
           <artifactId>jsf-api</artifactId>
           </exclusion>
           <exclusion>
           <groupId>javax.faces</groupId>
           <artifactId>jsf-impl</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
           <dependency>
           <groupId>org.apache.myfaces.core</groupId>
           <artifactId>myfaces-api</artifactId>
           <version>${myfaces}</version>
           </dependency>
           <dependency>
           <groupId>org.apache.myfaces.core</groupId>
           <artifactId>myfaces-impl</artifactId>
           <version>${myfaces}</version>
           <scope>runtime</scope>
           </dependency>
          


          • 2. Re: maven repository issues
            Siarhei Dudzin Apprentice

            That's exactly what I've done. However the question is whether there is intention to change the situation so that no explicit exclusion is needed? In other words everyone who is using jsf will most want to define an own dependency on desired version of JSF.

            Anyway, at least this post will get 'googlified' so that others can find an example on using jsf with maven :)

            Thanks again!

            • 3. Re: maven repository issues
              Siarhei Dudzin Apprentice

              Just FYI. This is what I have after some futher clean-up of jar dependencies:

               <dependency>
               <groupId>org.ajax4jsf</groupId>
               <artifactId>ajax4jsf</artifactId>
               <version>1.1.0</version>
               <exclusions>
               <exclusion> <!-- myfaces are used, this has to be disabled explicitly for this version -->
               <groupId>javax.faces</groupId>
               <artifactId>jsf-api</artifactId>
               </exclusion>
               <exclusion> <!-- myfaces are used, this has to be disabled explicitly for this version -->
               <groupId>javax.faces</groupId>
               <artifactId>jsf-impl</artifactId>
               </exclusion>
               <exclusion> <!-- included by myfaces implicitly -->
               <groupId>commons-beanutils</groupId>
               <artifactId>commons-beanutils</artifactId>
               </exclusion>
               <exclusion> <!-- included by myfaces implicitly -->
               <groupId>commons-digester</groupId>
               <artifactId>commons-digester</artifactId>
               </exclusion>
               <exclusion> <!-- included by myfaces implicitly -->
               <groupId>javax.servlet</groupId>
               <artifactId>jstl</artifactId>
               </exclusion>
               </exclusions>
               </dependency>
              


              Hope, this is helpful.

              • 4. Re: maven repository issues
                Juan Francisco Valdes Gayo Newbie

                I've just fixed this issue in my application.

                I didn't see the new two jars in my classpath when I updated to 1.1 so I got an unexpected and horrible error.

                Maybe the exception trace could be helpful for someone:

                Exception in PhaseListener RESTORE_VIEW(1) afterPhase
                java.lang.NullPointerException
                at org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
                at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:92)
                at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:99)
                at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
                at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
                at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
                at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
                at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
                at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
                at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
                at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
                at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
                at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
                at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
                at org.mortbay.jetty.Server.handle(Server.java:285)
                at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
                at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
                at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
                at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
                at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
                at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
                at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
                [16 abr 2007 14:20:57 WARN] - EXCEPTION
                javax.servlet.ServletException
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:158)
                at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
                at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
                at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
                at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
                at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
                at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
                at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
                at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
                at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
                at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
                at org.mortbay.jetty.Server.handle(Server.java:285)
                at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
                at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
                at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
                at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
                at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
                at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
                at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
                [16 abr 2007 14:20:57 ERROR] - Nested in javax.servlet.ServletException:
                java.lang.NullPointerException
                at org.ajax4jsf.framework.ajax.AjaxViewHandler.createView(AjaxViewHandler.java:78)
                at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:83)
                at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
                at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
                at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
                at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
                at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
                at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
                at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
                at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
                at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
                at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
                at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
                at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
                at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
                at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
                at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
                at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
                at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
                at org.mortbay.jetty.Server.handle(Server.java:285)
                at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
                at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
                at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
                at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
                at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
                at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
                at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)


                Regards,

                Juan F. Valdés