Problem starting java.lang.ClassNotFoundException: com.ocpsoft.pretty.PrettyFilt

Splash Forums PrettyFaces Users Problem starting java.lang.ClassNotFoundException: com.ocpsoft.pretty.PrettyFilt

This topic contains 8 replies, has 3 voices, and was last updated by  junagel 1 year, 5 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #26909

    junagel
    Participant

    hello, before please pardon the language

    I followed the installation instructions in your main page, the plugin goes great, I have to change dynamically and running url parameters. all right

    But when starting the server, tomcat and glassfish throwing errors like this. Launched several times until it gets started.

    Eventually the application starts but this is under development.

    How I can fix this?

    use technologies that are:
    jsf, primefaces, omnifaces, hibernate

    my configuration:

    pom.xml

    <dependency>
                <groupId>org.ocpsoft.rewrite</groupId>
                <artifactId>rewrite-servlet</artifactId>
                <version>2.0.12.Final</version>
            </dependency>
            <dependency>
                <groupId>org.ocpsoft.rewrite</groupId>
                <artifactId>rewrite-config-prettyfaces</artifactId>
                <version>2.0.12.Final</version>
            </dependency>

    only… because I deleted the filter in web.xml and application works the same but gives the same errors.

    after my settings pretty-config is correct because it works when application online

    24-Feb-2015 00:35:03.750 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.filterStart Excepción arrancando filtro Pretty Filter
    java.lang.ClassNotFoundException: com.ocpsoft.pretty.PrettyFilter
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:550)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:531)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4594)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1686)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

    #26934

    You got the wrong filter name. The name of the filter changed since PrettyFaces is part of Rewrite. Have a look here:

    http://www.ocpsoft.org/rewrite/docs/configuration/install

    Just add this to your web.xml:

    <listener>
       <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
    </listener>
    
    <listener>
       <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
    </listener>
    
    <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>
    
    #26943

    junagel
    Participant

    Hi, thanks for your help, I’m testing the change in web.xml happens the same error. 1 time out error, then the application starts fine, but throws exceptions. as above

    Información:   RewritePhaseListener starting up.
    Información:   Monitoring jndi:/server/NullWare_Carro-1.0-SNAPSHOT/WEB-INF/faces-config.xml for modifications
    Información:   Running on PrimeFaces 5.1
    Información:   Using OmniFaces version 1.11-M1
    Grave:   WebModule[/NullWare_Carro-1.0-SNAPSHOT]Exception starting filter Pretty Filter
    java.lang.InstantiationException
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:135)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5329)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5943)
    	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:2286)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1932)
    	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:500)
    	at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
    	at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:243)
    	at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)
    	at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)
    	at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461)
    	at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:227)
    	at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:84)
    	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258)
    	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
    	at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
    	at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)
    	at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:744)
    Caused by: java.lang.ClassNotFoundException: com.ocpsoft.pretty.PrettyFilter
    	at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1783)
    	at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
    	at org.apache.catalina.core.ApplicationFilterConfig.loadFilterClass(ApplicationFilterConfig.java:291)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:261)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:131)
    	... 28 more
    
    Información:   RewriteFilter starting up...
    Información:   Loaded [4] org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener [org.ocpsoft.rewrite.prettyfaces.PrettyFacesRewriteLifecycleListener<-100>, org.ocpsoft.rewrite.faces.FacesRewriteLifecycleListener<0>, org.ocpsoft.rewrite.servlet.config.lifecycle.JoinRewriteLifecycleListener<2147483647>, org.ocpsoft.rewrite.servlet.impl.DefaultRewriteLifecycleListener<2147483647>]
    Información:   Loaded [1] org.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper [org.ocpsoft.rewrite.servlet.impl.HttpRewriteRequestCycleWrapper<0>]
    Información:   Loaded [1] org.ocpsoft.rewrite.spi.RewriteProvider [org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider<0>]
    Información:   Loaded [1] org.ocpsoft.rewrite.servlet.spi.RewriteResultHandler [org.ocpsoft.rewrite.servlet.impl.HttpRewriteResultHandler<0>]
    Información:   Loaded [1] org.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpInboundRewriteProducer<0>]
    Información:   Loaded [1] org.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer [org.ocpsoft.rewrite.servlet.impl.HttpOutboundRewriteProducer<0>]
    Información:   Loaded [1] org.ocpsoft.rewrite.servlet.spi.ContextListener [org.ocpsoft.rewrite.prettyfaces.PrettyConfigContextListener<0>]
    Información:   Loaded [0] org.ocpsoft.rewrite.servlet.spi.RequestListener []
    Información:   Loaded [1] org.ocpsoft.rewrite.servlet.spi.RequestParameterProvider [org.ocpsoft.rewrite.prettyfaces.PrettyFacesRequestParameterProvider<0>]
    Información:   Loaded [1] org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider [org.ocpsoft.rewrite.faces.FacesExpressionLanguageProvider<30>]
    Información:   Loaded [1] org.ocpsoft.rewrite.spi.InvocationResultHandler [org.ocpsoft.rewrite.faces.NavigatingInvocationResultHandler<100>]
    Información:   Loaded [0] org.ocpsoft.common.spi.ServiceEnricher []
    Información:   Loaded [1] org.ocpsoft.rewrite.spi.ConfigurationCacheProvider [org.ocpsoft.rewrite.servlet.impl.ServletContextConfigurationCacheProvider<0>]
    Información:   Loaded [3] org.ocpsoft.rewrite.config.ConfigurationProvider [org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>, org.ocpsoft.rewrite.prettyfaces.PrettyFacesRewriteConfigurationProvider<1>, org.ocpsoft.rewrite.annotation.config.AnnotationConfigProvider<100>]
    Información:   Loaded [0] org.ocpsoft.rewrite.spi.RuleCacheProvider []
    Información:   Loaded [1] org.ocpsoft.rewrite.spi.GlobalParameterProvider [org.ocpsoft.rewrite.instance.WildcardParameterProvider<0>]
    Información:   Rewrite 2.0.12.Final initialized.
    
    #26944

    junagel
    Participant

    with tomcat:

    24-Feb-2015 22:17:00.564 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.filterStart Excepción arrancando filtro Pretty Filter
     java.lang.ClassNotFoundException: com.ocpsoft.pretty.PrettyFilter
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1320)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1173)
    	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:550)
    	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:531)
    	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4594)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5201)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
    	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
    	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1686)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:744)
    
    24-Feb-2015 22:17:01.832 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
    24-Feb-2015 22:17:01.832 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
    
    #26945

    RewriteFilters seems to have started up for you correctly once, but then you posted a completely unrelated stack trace having to do with PrettyFilter being missing.

    It looks like you may not have cleaned the app fully after making your changes (or you have some obsolete configuration remaining in your project or web.xml.) Try removing any unnecessary dependencies and configuration on PrettyFilter or other libraries.

    #26946

    junagel
    Participant

    hello, this is all my settings

    #26950

    junagel
    Participant

    and pretty

    Attachments:
    1. pretty-config.xml
    #26955

    Please double check that you don’t have com.ocpsoft.pretty.PrettyFilter in the web.xml any more. And make sure to clean the project and do a full build. And do a clean deployment. Rewrite isn’t referencing com.ocpsoft.pretty.PrettyFilter anywhere, so it must be your project that is causing this.

    #26956

    junagel
    Participant

    I think I’ll mourn, seems to work 🙂

    thank you very much.
    The problem was clean undeploy project from server

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Comments are closed.