Exception starting filter Pretty Filter

Splash Forums PrettyFaces Users Exception starting filter Pretty Filter

This topic contains 6 replies, has 2 voices, and was last updated by  Christian Kaltepoth 6 years, 1 month ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17993

    hs
    Participant

    Hi guys,

    I’m new to PrettyFaces and I have problems to get it working. I have an EAR deployment running on JBoss AS 6 (6.0.0.Final). The EAR contains an EJB, an utility and two web modules. The Seam Faces libraries (3.0.2.Final) are part of the EAR module assembly.

    I have added the following XML snippets to the deployment descriptor of one of the web modules (the one in which I want to use PrettyFaces):

    ...
    <filter>
    <filter-name>Pretty Filter</filter-name>
    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
    <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
    <filter-name>Pretty Filter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ASYNC</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>
    ...
    <context-param>
    <param-name>com.ocpsoft.pretty.BASE_PACKAGES</param-name>
    <param-value>de.test.view</param-value>
    </context-param>
    ...
    <context-param>
    <param-name>com.ocpsoft.pretty.SCAN_LIB_DIRECTORY</param-name>
    <param-value>false</param-value>
    </context-param>
    ...

    Additionally I added a /WEB-INF/pretty-config.xml file with only a root element in it. The web module relies on JSF 2 (Mojarra 2.0.3) and ICEfaces 2.0.2. My configuration is annotation based.

    Finally here is the stack trace:

    11:56:24,559 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/Web]] Exception starting filter Pretty Filter: com.ocpsoft.pretty.PrettyException: Failed to load configuration.
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:90) [:]
    at com.ocpsoft.pretty.PrettyFilter.init(PrettyFilter.java:265) [:]
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [:6.0.0.Final]
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3246) [:6.0.0.Final]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3843) [:6.0.0.Final]
    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:294) [:6.0.0.Final]
    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146) [:6.0.0.Final]
    at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:477) [:6.0.0.Final]
    at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.Final]
    at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.Final]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_25]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_25]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_25]
    at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_25]
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]
    at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) [:2.2.0.GA]
    at $Proxy41.start(Unknown Source) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53) [:2.2.0.GA]
    at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41) [:2.2.0.GA]
    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301) [:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]
    at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]
    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]
    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]
    at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]
    at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:240) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
    at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
    at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
    at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [:1.6.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.6.0_25]
    at java.lang.Thread.run(Unknown Source) [:1.6.0_25]
    Caused by: java.lang.NullPointerException
    at org.jboss.seam.faces.util.BeanManagerUtils.getContextualInstance(BeanManagerUtils.java:103) [:3.0.2.Final]
    at org.jboss.seam.faces.rewrite.RewriteConfiguration.loadConfiguration(RewriteConfiguration.java:57) [:3.0.2.Final]
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63) [:]
    ... 60 more

    Could you please help me resolving this issue?

    With kind regards,

    Hendrik

    #21160

    Hey Hendrik,

    actually this looks more like a problem of Seam Faces. The NullPointerException is thrown from within the PrettyFaces integration code of Seam Faces. I just had a quick look at the Seam Faces source. The class BeanManagerUtils requires the BeanManager which is injected via @Inject. But for some reason this doesn’t seem to work. Therefore the manager property is null and the subsequent code will fail to execute correctly.

    See:

    https://github.com/seam/faces/blob/3.0.2.Final/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java#L103

    I’m note sure what the exact cause of this problem is. I see no reason why injection of the BeanManager could not work. You could try to bundle Seam Faces within the WAR file instead of inside the EAR. Perhaps this causes some issue?

    Christian

    #21161

    hs
    Participant

    Hi Christian,

    thanks for your quick reply and your explanation. I’ve already left the office so I will give it a try on Monday.

    Have a nice weekend!

    Hendrik

    #21162

    hs
    Participant

    Hello Christian,

    unfortunately I’m not able to get it working. I tried to move some of the JARs (seam-faces.jar, prettyfaces-jsf2.jar and ocpsoft-pretty-time.jar) from folder App.ear/EarContent/lib to folder App.ear/App.war/WEB-INF/lib but finally I ran into the same exceptions. I will move on to JBoss AS 7 within a short time and will deal with that issue in the new environment again.

    Regards,

    Hendrik

    #21163

    Hey Hendrik,

    thanks for sending us this update. This exception is really very weird! My guess is that it is caused by some Seam Faces + JBossAS6 integration issue. But its very strange that you are the first person reporting this. I think Seam Faces and AS6 are very widely used.

    I’ll try to find some time to dig into this issue. But unfortunately I’m very busy at the moment so it may take some time.

    Could you perhaps notify us how your tests with JBossAS7 work out? This would be really interesting!

    Thanks :)

    Christian

    #21164

    hs
    Participant

    Hi Christian,

    I moved on to JBoss AS 7.0.1 and the issue has gone. Thanks again for trying to help me.

    PrettyFaces generally works for me now. At the moment I’m struggling with some issues concerning the use of PrettyURLBuilder (especially when trying to build urls based on a Map<String, String> of parameters). I also face some problems when integrating with with JSF commandLink and commandButton and when using JSF standard components (h:link). I will further investigate these issues and start a new topic if necessary.

    Regards from Dortmund,

    Hendrik

    #21165

    I’m glad to hear you got it working on AS7.

    Feel free open a new topic if you have any questions!

    Regards from Duisburg :)

    Christian

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

You must be logged in to reply to this topic.

Comments are closed.