com.ocpsoft.pretty.PrettyException: Failed to load configuration

Splash Forums Rewrite Users com.ocpsoft.pretty.PrettyException: Failed to load configuration

This topic contains 28 replies, has 3 voices, and was last updated by  Lincoln Baxter III 2 years, 5 months ago.

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • #25861

    naska.om
    Participant

    I am using ocpsoft rewrite. Why do I get a pretty faces exception? I had pretty faces config jar in my lib folder, then I deleted it and cleared Netbeans cache. Then I cleaned and rebuilt my project. It’s gone with the first deploy but comes back with redeploy.

    #25862

    That’s not a very helpful error description. Please post the full stacktrace, your configuration files and the names of all JARs you added to your project.

    #25864

    naska.om
    Participant

    Thanks Christian. I’m posting them all bellow.
    My configuration provider:

    @Inject
        private LocaleBean localeBean;
        
        private static final Map<String, Properties> langToViews = new HashMap<>();
        private static final Map<String, Properties> langToPaths = new HashMap<>();
        
        private String getView(String lang, String path){
            Properties viewMap = getViewMap(lang);
            String view = viewMap.getProperty(path);
            return String.format("/%s.xhtml", view);
        }
        private Properties getViewMap(String lang){
            Properties props = langToViews.get(lang);
            if(props == null){
                props = new Properties();
                try{
                    props.load(getClass().getResourceAsStream(String.format("text_%s.properties",lang)));
                    langToViews.put(lang, props);
                } catch(IOException e){
                    throw new RuntimeException(e);
                }
            }
            return props;
        }
        private String getPath(String lang, String view){
            Properties pathMap = getPathMap(lang);
            String path = pathMap.getProperty(view);
            return String.format("/%s/%s",lang, path);
        }
        private Properties getPathMap(String lang){
            Properties props = langToPaths.get(lang);
            if(props == null){
                props = new Properties();
                try{
                    props.load(getClass().getResourceAsStream(String.format("text_%s.properties",lang)));
                    langToPaths.put(lang, props);
                }catch (IOException e){
                    throw new RuntimeException(e);
                }
            }
            return props;
        }
        
        private Cookie getCookie(HttpServletRequest request, String name){
            if(request.getCookies() != null){
                for(Cookie cookie:request.getCookies()){
                    if(cookie.getName().equalsIgnoreCase(name)){
                        return cookie;
                    }
                }            
            }
            return null;
        }    
    
       @Override
       public Configuration getConfiguration(final ServletContext context)
       {
           //final String contextPath = context.getContextPath();
           //final ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
           //HttpServletRequest request = (HttpServletRequest) 
           
         return ConfigurationBuilder.begin()
                 
                 .addRule()
                 .when(Direction.isInbound().and(Path.matches("/{lang}/{path}")))
                 .perform(new HttpOperation(){
                     @Override
                     public void performHttp(HttpServletRewrite event, EvaluationContext context){                     
                         String lang = (String) Evaluation.property("lang").retrieve(event, context);
                         String path = (String) Evaluation.property("path").retrieve(event, context);
                         String view = getView(lang, path);
                         localeBean.setLang(lang);
                         Forward.to(view).perform(event, context);                     
                     }
                 })             
                 .where("lang").matches("en|ar|fa")             
                 
                 .addRule()
                 .when(Direction.isOutbound().and(Path.matches("/{view}.xhtml")))
                 .perform(new HttpOperation(){
                     @Override
                     public void performHttp(HttpServletRewrite event, EvaluationContext context){
                         String lang = localeBean.getLocale().getLanguage();
                         String view = (String) Evaluation.property("view").retrieve(event, context);
                         String path = getPath(lang, view);
                         Substitute.with(path).perform(event, context);                     
                     }
                 })                             
                 
                 //Redirect to Home
                .addRule()             
                .when(Path.matches("/"))
                 .perform(new HttpOperation(){
                    @Override
                    public void performHttp(HttpServletRewrite event, EvaluationContext context){
                        HttpServletRequest request =   (HttpServletRequest) event.getRequest();                      
                        if (request !=null){
                            Cookie langCookie = getCookie(request, "language");                        
                            if(langCookie != null){                                   
                                    Redirect.temporary(event.getContextPath() + "/"+ langCookie.getValue() + "/Home").perform(event, context);                             
                                }else{                                   
                                    Redirect.temporary(event.getContextPath() + "/Select_Language").perform(event, context);
                                }                    
                            }else{                                 
                                Redirect.temporary(event.getContextPath() + "/Select_Language").perform(event, context);
                        }
                    }
                 })
                 .addRule(Join.path("/Select_Language")
                 .to("/Select_Language.xhtml")
                 .withInboundCorrection())
                 
                 //Login Page
                 .addRule(Join.path("/Login")
                 .to("/Login.xhtml")
                 .withInboundCorrection())
                 
                 .addRule(Join.path("/admin/home")
                 .to("/admin/index.xhtml")
                 .withInboundCorrection());            
                                           
       }    
       @Override
       public int priority()
       {
         return 10;
       }

    My web.xml:

    <filter>
            <filter-name>OCPsoft Rewrite Filter</filter-name>
            <filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
            <async-supported>true</async-supported>
        </filter>
        <filter-mapping>
          <filter-name>OCPsoft Rewrite Filter</filter-name>
          <url-pattern>/*</url-pattern>
          <dispatcher>FORWARD</dispatcher>
          <dispatcher>REQUEST</dispatcher>
          <dispatcher>INCLUDE</dispatcher>
          <dispatcher>ASYNC</dispatcher>
          <dispatcher>ERROR</dispatcher>
        </filter-mapping>

    my libraries:

    rewrite-integration-cdi-2.0.11.Final.jar
    rewrite-integration-faces-2.0.11.Final.jar
    rewrite-servlet-2.0.11.Final.jar
    rewrite-transform-2.0.11.Final.jar
    rewrite-transform-markup-2.0.11.Final.jar
    rewrite-integration-cdi-2.0.11.Final-sources.jar
    rewrite-integration-faces-2.0.11.Final-sources.jar
    rewrite-transform-2.0.11.Final-sources.jar

    whole stack trace:

    INFO:   RewritePhaseListener starting up.
    INFO:   RewritePhaseListener starting up.
    INFO:   Monitoring jndi:/server/resht/WEB-INF/faces-config.xml for modifications
    INFO:   Running on PrimeFaces 3.2
    INFO:   Running on PrimeFaces 3.2
    INFO:   Using OmniFaces version 1.4.1
    INFO:   WebModule[null] ServletContext.log():Initializing Shiro environment
    SEVERE:   [admin-listener(5)] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
    SEVERE:   [admin-listener(5)] INFO org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialized in 871 ms.
    SEVERE:   Startup of context /resht failed due to previous errors
    SEVERE:   Exception during cleanup after start failed
    org.apache.catalina.LifecycleException: Manager has not yet been started
    	at org.apache.catalina.session.StandardManager.stop(StandardManager.java:934)
    	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:6099)
    	at com.sun.enterprise.web.WebModule.stop(WebModule.java:720)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5916)
    	at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.security.auth.Subject.doAs(Subject.java:356)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:744)
    
    SEVERE:   ContainerBase.addChild: start: 
    org.apache.catalina.LifecycleException: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5920)
    	at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.security.auth.Subject.doAs(Subject.java:356)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:744)
    Caused by: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    	at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:90)
    	at org.ocpsoft.rewrite.prettyfaces.PrettyConfigContextListener.contextInitialized(PrettyConfigContextListener.java:41)
    	at org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener.contextInitialized(RewriteServletContextListener.java:38)
    	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5362)
    	at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:743)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5898)
    	... 44 more
    Caused by: java.lang.RuntimeException: Error instantiating class org.ocpsoft.rewrite.cdi.CdiBeanNameResolver
    	at org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:342)
    	at org.ocpsoft.common.services.ServiceLoader.loadClass(ServiceLoader.java:243)
    	at org.ocpsoft.common.services.ServiceLoader.loadService(ServiceLoader.java:234)
    	at org.ocpsoft.common.services.ServiceLoader.loadServiceFile(ServiceLoader.java:196)
    	at org.ocpsoft.common.services.ServiceLoader.reload(ServiceLoader.java:145)
    	at org.ocpsoft.common.services.ServiceLoader.iterator(ServiceLoader.java:394)
    	at com.ocpsoft.pretty.faces.el.LazyBeanNameFinder.<init>(LazyBeanNameFinder.java:70)
    	at com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(AnnotationConfigurationProvider.java:59)
    	at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63)
    	... 49 more
    Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456 Argument resolvedBean must not be null
    	at org.jboss.weld.util.Preconditions.checkArgumentNotNull(Preconditions.java:40)
    	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:751)
    	at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
    	at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:368)
    	at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:377)
    	at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72)
    	at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60)
    	at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66)
    	at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:142)
    	at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
    	at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64)
    	at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:91)
    	at org.ocpsoft.rewrite.cdi.CdiServiceEnricher.enrich(CdiServiceEnricher.java:77)
    	at org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:324)
    	... 57 more
    
    WARNING:   java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1044)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.security.auth.Subject.doAs(Subject.java:356)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:744)
    
    SEVERE:   Exception while invoking class com.sun.enterprise.web.WebApplication start method
    java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.security.auth.Subject.doAs(Subject.java:356)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:744)
    
    SEVERE:   Exception during lifecycle processing
    java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.security.auth.Subject.doAs(Subject.java:356)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:744)
    
    SEVERE:   Exception while loading the app
    SEVERE:   Undeployment failed for context /resht
    
    #25866

    It looks like the root cause is CDI failing to resolve a bean for field injection:

    Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456 Argument resolvedBean must not be null

    Additionally, it looks like you have both PrettyFaces and Rewrite in your application, but you don’t seem to be using PrettyFaces. Could you please list your dependencies? It’s possible that you have duplicates.

    Also, on a related note, have you seen our recent i18n functionality? The idea was contributed by another community member ๐Ÿ™‚ Check it out, it may simplify your configuration quite significantly: http://ocpsoft.org/rewrite/docs/configuration/i18n

    Alternately, it’s possible that PrettyFaces/Rewrite is starting before CDI starts. You might want to check into that.

    ~Lincoln

    #25867

    naska.om
    Participant

    Thanks for the link. It was a much simpler solution. I searched for pretty in my project root in netbeans and found a lot of pretty faces configurations in META-INF. META-INF/faces-config only contains pretty faces configuration. And it found pretty faces jar files there in META-INF too. They’re not shown in META-INF when I open the folder. I don’t know where are they coming from.
    Here is the whole list of my libraries:
    AlchemyAPIAnnotator-2.3.1.jar
    OpenCalaisAnnotator-2.3.1.jar
    Tagger-2.3.1.jar
    WhitespaceTokenizer-2.3.1.jar
    activation-1.1.jar
    apache-mime4j-core-0.7.2.jar
    apache-mime4j-dom-0.7.2.jar
    attributes-binder-1.0.1.jar
    bcmail-jdk15-1.45.jar
    bcprov-jdk15-1.45.jar
    boilerpipe-1.1.0.jar
    carrot2-mini-3.6.2.jar
    cglib-nodep-2.2.jar
    commons-beanutils-1.7.0.jar
    commons-beanutils-1.8.3.jar
    commons-beanutils-core-1.8.3.jar
    commons-cli-1.2.jar
    commons-codec-1.7.jar
    commons-collections-3.2.1.jar
    commons-compress-1.4.1.jar
    commons-fileupload-1.2.1.jar
    commons.io-2.1.jar
    commons-lang-2.6.jar
    commons-logging-1.1.1.jar
    dom4j-1.6.1.jar
    fontbox-1.7.1.jar
    guava-13.0.1.jar
    hppc-0.4.1.jar
    httpclient-4.2.3.jar
    httpcore-4.2.2.jar
    httpmime-4.2.3.jar
    icu4j-49.1.jar
    isoparser-1.0.RC-1.jar
    jackson-core-asl-1.7.4.jar
    jackson-mapper-asl-1.7.4.jar
    jcl-over-slf4j-1.6.4.jar
    jdom-1.0.jar
    jempbox-1.7.1.jar
    jsonic-1.2.7.jar
    juniversalchardet-1.0.3.jar
    langdetect-1.1.-20120112.jar
    log4j-1.2.17.jar
    mahout-collections-1.0.jar
    mahout-math-0.6.jar
    mail-1.4.1.jar
    metadata-extractor-2.6.2.jar
    morfologik-fsa-1.5.5.jar
    morfologik-polish-1.5.5.jar
    morfologik-stemming-1.5.5.jar
    netcdf-4.2-min.jar
    objenesis-1.2.jar
    omnifaces-1.4.1.jar
    org.restlet-2.1.1.jar
    org.restlet.ext.servlet-2.1.1.jar
    pdfbox-1.7.1.jar
    poi-3.8.jar
    poi-ooxml-3.8.jar
    poi-ooxml-schemas-3.8.jar
    poi-scratchpad-3.8.jar
    primefaces-3.2.jar
    rome-0.9.jar
    rewrite-integration-cdi-2.0.11.Final.jar
    rewrite-integration-faces-2.0.11.Final.jar
    rewrite-servlet-2.0.11.Final.jar
    rewrite-transform-2.0.11.Final.jar
    rewrite-transform-markup-2.0.11.Final.jar
    servlet-api-3.0.jar
    shiro-all-1.2.1.jar
    shiro-core-1.2.1.jar
    shiro-web-1.2.1.jar
    simple-xml-2.6.4.jar
    slf4j-api-1.7.2.jar
    slf4j-simple-1.7.2.jar
    spatial4j-0.3.jar
    tagsoup-1.2.1.jar
    tika-core-1.3.jar
    tika-parsers-1.3.jar
    uimaj-core-2.3.1.jar
    velocity-1.7.jar
    velocity-tools-2.0.jar
    vorbis-java-core-0.1.jar
    vorbis-java-tika-0.1.jar
    wstx-asl-3.2.7.jar
    xmlbeans-2.3.0.jar
    xz-1.0.jar

    I’m not sure if any of these libraries has to do anything with pretty faces.

    • This reply was modified 2 years, 5 months ago by  naska.om.
    #25871

    naska.om
    Participant

    I found that pretty faces libraries were in the web/WEB-INF/lib folder from where I added them to the project in netbeans. I deleted them and they stopped to get added to build folder with each build command. Thanks for your replies.

    I got to another issue though, I applied the i18n way you suggested. I get an error with rewrite instantiation now. Here is the stacktrace:

    WARNING:   WELD-001529 An InjectionTarget implementation is created for a class org.primefaces.context.PrimePartialViewContextFactory which does not have any appropriate constructor.
    INFO:   RewritePhaseListener starting up.
    INFO:   RewritePhaseListener starting up.
    INFO:   Monitoring jndi:/server/resht/WEB-INF/faces-config.xml for modifications
    INFO:   Running on PrimeFaces 3.5
    INFO:   WebModule[null] ServletContext.log():Initializing Shiro environment
    SEVERE:   [admin-listener(3)] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
    SEVERE:   [admin-listener(3)] INFO org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialized in 799 ms.
    INFO:   RewriteFilter starting up...
    SEVERE:   WebModule[/resht]Exception starting filter OCPsoft Rewrite Filter
    java.lang.InstantiationException
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:135)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5297)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5909)
    	at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at javax.security.auth.Subject.doAs(Subject.java:356)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
    	at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
    	at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:744)
    Caused by: java.lang.RuntimeException: Error instantiating class org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge
    	at org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:342)
    	at org.ocpsoft.common.services.ServiceLoader.loadClass(ServiceLoader.java:243)
    	at org.ocpsoft.common.services.ServiceLoader.loadService(ServiceLoader.java:234)
    	at org.ocpsoft.common.services.ServiceLoader.loadServiceFile(ServiceLoader.java:196)
    	at org.ocpsoft.common.services.ServiceLoader.reload(ServiceLoader.java:145)
    	at org.ocpsoft.common.services.ServiceLoader.iterator(ServiceLoader.java:394)
    	at org.ocpsoft.common.util.Iterators.asList(Iterators.java:40)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.init(RewriteFilter.java:81)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:131)
    	... 46 more
    Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456 Argument resolvedBean must not be null
    	at org.jboss.weld.util.Preconditions.checkArgumentNotNull(Preconditions.java:40)
    	at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:751)
    	at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
    	at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:368)
    	at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:377)
    	at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:72)
    	at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:60)
    	at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:66)
    	at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:142)
    	at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
    	at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:64)
    	at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:91)
    	at org.ocpsoft.rewrite.cdi.CdiServiceEnricher.enrich(CdiServiceEnricher.java:77)
    	at org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:324)
    	... 55 more
    #25873

    Hey there. This exception is the same one that I pointed out earlier. The root cause is:

    Caused by: org.jboss.weld.exceptions.IllegalArgumentException: WELD-001456 Argument "resolvedBean" must not be null

    Could you try putting a breakpoint here:

    org.ocpsoft.rewrite.cdi.CdiServiceEnricher.enrich(CdiServiceEnricher.java:77)

    And see what is happening?

    I’m not convinced this is a bug with Rewrite. I think it’s probably a CDI mis-configuration of some kind.

    Thanks,
    Lincoln

    #25874

    naska.om
    Participant

    Hi Lincoln. Thanks for your reply. I ran into this issue with glassfish 4.0.
    line 77 in org.ocpsoft.rewrite.cdi.CdiServiceEnricher is inside produce method and not inside enrich and because the code is precompiled I cannot put a breakpoint there. However I put a breakpoint in both produce(Class<T> type) and enrich(T service) methods. Here is the debugger console:

    Attaching to localhost:9009
    LineBreakpoint CityLclFacade.java : 33 successfully submitted.
    MethodBreakpoint [org.ocpsoft.rewrite.cdi.CdiServiceEnricher].produce '(Ljava/lang/Class;)Ljava/util/Collection;' successfully submitted.
    MethodBreakpoint [org.ocpsoft.rewrite.cdi.CdiServiceEnricher].enrich '(Ljava/lang/Object;)V' successfully submitted.
    User program running
    Method breakpoint hit in org.ocpsoft.rewrite.cdi.CdiServiceEnricher.produce at line 43 by thread admin-listener(3).
    Thread admin-listener(3) stopped at CdiServiceEnricher.java:43.

    And stacktrace is the same. I stepped over CdiServiceEnricher.java lines, it went to return java.security.AccessController.doPrivileged(action, createContext(subject, currentAcc)); in Subject.java and when I stepped over that too, website started and I got the exception.

    #25875

    Hmm, not really sure that this gives me enough to work with. Any chance you could upload a sample maven project that reproduces this issue?

    #25877

    naska.om
    Participant

    Unfortunately I can’t build a sample project with maven at this point since I’m not familiar with maven at all. I’ve only worked with ant.

    Alternately, itโ€™s possible that PrettyFaces/Rewrite is starting before CDI starts. You might want to check into that.

    How do I check this?
    And what other possibilities could be there? I searched for that exception but found only a few pages related to Arquillian, which was a bug. In this case I’m not sure what could cause this. Do you think I may have missed a dependency? Or could my components’ versions be incompatible? I use rewrite-2.0.11.Final, primefaces-3.5, glassfish-4.0, jsf-2.2

    #25878

    naska.om
    Participant

    @lincoln when I clean my project, restart glassfish and rebuid and redeploy my project I don’t get that exception but rewrite does not work and my URLs don’t get filtered though it worked in glassfish 3.1.2. When I redeploy my project, I get that weird exception. I’ll check my recent library changes for that exception, but even with the following stacktrace which indicates rewrite filter has been initialized I don’t get rewrite to work:

    INFO:   WELD-000900 2.0.0 (SP1)
    WARNING:   Class 'javax.ejb.PostActivate' not found, interception based on it is not enabled
    WARNING:   Class 'javax.ejb.PrePassivate' not found, interception based on it is not enabled
    INFO:   Initializing Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) for context '/resht'
    WARNING:   WELD-001529 An InjectionTarget implementation is created for a class org.primefaces.context.PrimePartialViewContextFactory which does not have any appropriate constructor.
    INFO:   RewritePhaseListener starting up.
    INFO:   RewritePhaseListener starting up.
    INFO:   Monitoring jndi:/server/resht/WEB-INF/faces-config.xml for modifications
    INFO:   Running on PrimeFaces 3.5
    INFO:   WebModule[null] ServletContext.log():Initializing Shiro environment
    SEVERE:   [admin-listener(4)] INFO org.apache.shiro.web.env.EnvironmentLoader - Starting Shiro environment initialization.
    SEVERE:   [admin-listener(4)] INFO org.apache.shiro.web.env.EnvironmentLoader - Shiro environment initialized in 1047 ms.
    INFO:   RewriteFilter starting up...
    INFO:   Loaded [12] org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener [org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge<-100>, org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge<-100>, org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge<-100>, org.ocpsoft.rewrite.cdi.bridge.RewriteLifecycleEventBridge<-100>, org.ocpsoft.rewrite.faces.FacesRewriteLifecycleListener<0>, org.ocpsoft.rewrite.faces.FacesRewriteLifecycleListener<0>, org.ocpsoft.rewrite.servlet.impl.DefaultRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.impl.DefaultRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.config.lifecycle.JoinRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.config.lifecycle.JoinRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.impl.DefaultRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.config.lifecycle.JoinRewriteLifecycleListener<2147483647>]
    INFO:   Loaded [7] org.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper [org.ocpsoft.rewrite.servlet.impl.HttpRewriteRequestCycleWrapper<0>, org.ocpsoft.rewrite.cdi.bridge.RequestCycleWrapperBridge<0>, org.ocpsoft.rewrite.cdi.bridge.RequestCycleWrapperBridge<0>, org.ocpsoft.rewrite.cdi.bridge.RequestCycleWrapperBridge<0>, org.ocpsoft.rewrite.servlet.impl.HttpRewriteRequestCycleWrapper<0>, org.ocpsoft.rewrite.servlet.impl.HttpRewriteRequestCycleWrapper<0>, org.ocpsoft.rewrite.cdi.bridge.RequestCycleWrapperBridge<0>]
    INFO:   Loaded [7] org.ocpsoft.rewrite.spi.RewriteProvider [org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider<0>, org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider<0>, org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider<0>, org.ocpsoft.rewrite.cdi.bridge.RewriteProviderBridge<100>, org.ocpsoft.rewrite.cdi.bridge.RewriteProviderBridge<100>, org.ocpsoft.rewrite.cdi.bridge.RewriteProviderBridge<100>, org.ocpsoft.rewrite.cdi.bridge.RewriteProviderBridge<100>]
    INFO:   Loaded [3] org.ocpsoft.rewrite.spi.RewriteResultHandler [org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler<0>, org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler<0>, org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler<0>]
    INFO:   Loaded [3] org.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpInboundRewriteProducer<0>, org.ocpsoft.rewrite.servlet.impl.HttpInboundRewriteProducer<0>, org.ocpsoft.rewrite.servlet.impl.HttpInboundRewriteProducer<0>]
    INFO:   Loaded [3] org.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteProducer<0>, org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteProducer<0>, org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteProducer<0>]
    INFO:   Loaded [0] org.ocpsoft.rewrite.servlet.spi.ContextListener []
    INFO:   Loaded [0] org.ocpsoft.rewrite.servlet.spi.RequestListener []
    INFO:   Loaded [0] org.ocpsoft.rewrite.servlet.spi.RequestParameterProvider []
    INFO:   Loaded [7] org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider [org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>, org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>, org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider<30>, org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>, org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider<30>, org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>, org.ocpsoft.rewrite.cdi.CdiExpressionLanguageProvider<10>]
    INFO:   Loaded [2] org.ocpsoft.rewrite.spi.InvocationResultHandler [org.ocpsoft.rewrite.faces.NavigatingInvocationResultHandler<100>, org.ocpsoft.rewrite.faces.NavigatingInvocationResultHandler<100>]
    INFO:   Loaded [5] org.ocpsoft.common.spi.ServiceEnricher [org.ocpsoft.rewrite.cdi.CdiServiceEnricher, org.ocpsoft.rewrite.cdi.CdiServiceEnricher, org.ocpsoft.rewrite.cdi.CdiServiceEnricher, org.ocpsoft.rewrite.cdi.CdiServiceEnricher, org.ocpsoft.rewrite.cdi.CdiServiceEnricher]
    INFO:   Loaded [3] org.ocpsoft.rewrite.spi.ConfigurationCacheProvider [org.ocpsoft.rewrite.servlet.impl.ServletContextConfigurationCacheProvider<0>, org.ocpsoft.rewrite.servlet.impl.ServletContextConfigurationCacheProvider<0>, org.ocpsoft.rewrite.servlet.impl.ServletContextConfigurationCacheProvider<0>]
    INFO:   Loaded [3] org.ocpsoft.rewrite.config.ConfigurationProvider [org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>, org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>, org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>]
    INFO:   Loaded [0] org.ocpsoft.rewrite.spi.RuleCacheProvider []
    INFO:   Loaded [0] org.ocpsoft.rewrite.spi.RuleCacheProvider []
    INFO:   Loaded [0] org.ocpsoft.rewrite.spi.RuleCacheProvider []
    INFO:   RewriteFilter initialized.
    INFO:   Loading application [resht] at [/resht]
    INFO:   resht was successfully deployed in 78,600 milliseconds.
    • This reply was modified 2 years, 5 months ago by  naska.om. Reason: Added detail
    • This reply was modified 2 years, 5 months ago by  naska.om.
    • This reply was modified 2 years, 5 months ago by  naska.om.
    #25883

    Looks like some of the internal Rewrite classes are more than once on the classpath:

    INFO:   Loaded [3] org.ocpsoft.rewrite.config.ConfigurationProvider [org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>, org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>, org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>]
    

    May be this is causing the issues?

    #25884

    naska.om
    Participant

    Strange. How could this happen @Christian? I have uploaded my library list, which libraries do you think duplicate that class?

    #25885

    I’ve no idea why this happens in your case. Your libraries look good.

    However, I’m not sure if this really causes the problem. Could you please post your Rewrite configuration and the exact URL you entered into your browser that is not working?

    #25886

    naska.om
    Participant

    My configuration:

    .addRule(Join.path("/{lang}/{path}").to("/{path}.xhtml"))             
     .where("path").transposedBy(LocaleTransposition.bundle("com.gesht.bundles.text", "lang"))

    My application opens in localhost:8080/resht/, or localhostL8080/resht/Home.xhtml I want it to open in localhost:8080/en/resht/Home
    I used to reach my application with the later URL with glassfish 3.1.2 and previous configuration which I have already posted. In glassfish 4.0 it doesn’t work with either configuration.

Viewing 15 posts - 1 through 15 (of 29 total)

You must be logged in to reply to this topic.

Comments are closed.