Upgraded to 3.3.2 from 3.3.0; Failed to load configuration

Splash Forums PrettyFaces Users Upgraded to 3.3.2 from 3.3.0; Failed to load configuration

This topic contains 12 replies, has 3 voices, and was last updated by  clemmonsm 5 years, 10 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #18056

    clemmonsm
    Participant

    Hello, I received the following error after upgrading to 3.3.2.

    <Nov 14, 2011 3:23:08 PM EST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: com.ocpsoft.pretty.PrettyFilter.

    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:305)

    at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:332)

    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

    Truncated. see log file for complete stacktrace

    Caused By: java.lang.NullPointerException

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:110)

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:183)

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:183)

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:183)

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:183)

    Truncated. see log file for complete stacktrace

    >

    I changed the pretty-config.xml header to match the new version:

    <pretty-config xmlns=”http://ocpsoft.com/prettyfaces/3.3.2&#8243;

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/3.3.2

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.2.xsd“>

    And I am not using annotations.

    In an attempt to workaround this issue, I reverted back to 3.3.0, however the error persists. If anyone has insight it would be much appreciated…unfortunately I am at a development standstill until I can resolve this issue. Thanks.

    #21553

    it sounds like a build/tools issue, where the file is actually not getting published correctly. however, you could try disabling annotation scanning.

    http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html_single/#config.annotations.setup

    If that doesn’t help, try reproducing this problem in a sample project. if you can do that, please send it to us and we will take a look :) otherwise, post your config and we’ll try to work it out that way.

    #21554

    clemmonsm
    Participant

    Thanks Lincoln, adding the following to my web.xml escapes the issue:

    <context-param>
    <param-name>com.ocpsoft.pretty.BASE_PACKAGES</param-name>
    <param-value>none</param-value>
    </context-param>

    I am not certain what created this issue. In this link, I saw where you asked the OP “Do you have more than one PrettyFaces JAR file on your classpath?”: http://ocpsoft.com/support/topic/duplicated-mapping-id

    I believe I had the jars for v3.3.0 and v3.3.2 in my classpath on my initial build with v3.3.2. Could this have been the root cause?

    #21555

    Hey clemmonsm,

    the stacktrace you posted in your first post is definitely from 3.3.0 and not from 3.3.2. Of cause duplicated JAR files may cause all sorts of issues, but I’m unsure whether they may cause this NPE.

    Do you use the annotation support in PrettyFaces at all? If not, you can safely go with your current workaround (disabling the annotation scanning). But if you would like to use annotations, you could enable the scanning again and increase the logging level for “com.ocpsoft.pretty.faces.config.annotation” to TRACE. This could give us some insights on what is going wrong here.

    Christian

    #21556

    clemmonsm
    Participant

    I do not use annotation support (knowingly). I recently attempted to use a DynaView, which, based on other threads I read, prompted the upgrade to 3.3.2.

    I will research how to increase the logging level for “com.ocpsoft.pretty.faces.config.annotation” in weblogic and post the results here.

    Thanks again for the help.

    #21557

    clemmonsm
    Participant

    Ok, here’s my first attempt at configuring and sharing the log. Let me know if I did not do something correctly… Here is a link to the log: http://pastebin.com/e617sfYT

    Here is my java logging.properties file:

    ############################################################

    # Default Logging Configuration File

    #

    # You can use a different file by specifying a filename

    # with the java.util.logging.config.file system property.

    # For example java -Djava.util.logging.config.file=myfile

    ############################################################

    ############################################################

    # Global properties

    ############################################################

    # “handlers” specifies a comma separated list of log Handler

    # classes. These handlers will be installed during VM startup.

    # Note that these classes must be on the system classpath.

    # By default we only configure a ConsoleHandler, which will only

    # show messages at the INFO and above levels.

    handlers= java.util.logging.ConsoleHandler

    # To also add the FileHandler, use the following line instead.

    #handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

    # Default global logging level.

    # This specifies which kinds of events are logged across

    # all loggers. For any given facility this global level

    # can be overriden by a facility specific level

    # Note that the ConsoleHandler also has a separate level

    # setting to limit messages printed to the console.

    .level= INFO

    ############################################################

    # Handler specific properties.

    # Describes specific configuration info for Handlers.

    ############################################################

    # default file output is in user’s home directory.

    java.util.logging.FileHandler.pattern = %h/java%u.log

    java.util.logging.FileHandler.limit = 50000

    java.util.logging.FileHandler.count = 1

    java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

    # Limit the message that are printed on the console to INFO and above.

    #java.util.logging.ConsoleHandler.level = INFO

    java.util.logging.ConsoleHandler.level = ALL

    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

    ############################################################

    # Facility specific properties.

    # Provides extra control for each logger.

    ############################################################

    # For example, set the com.xyz.foo logger to only log SEVERE

    # messages:

    com.xyz.foo.level = SEVERE

    # Logging for PrettyFaces

    com.ocpsoft.pretty.faces.config.annotation = TRACE

    #21558

    Thank you very much. But it seems like the PrettyFaces log messages aren’t contained in this log file. There should be at least one log message from PrettyFaces with a message like “PrettyFilter starting up” or something like this. Is there any other logging configuration on the server? PrettyFaces uses commons-logging which delegates to the best logger implementation it finds.

    #21559

    clemmonsm
    Participant

    I performed the following grep in the log folder mentioned in the console during deployment (http://pastebin.com/a4LuRxeR) and I did not get any hits:

    grep -H -i “prettyfilter ” *.log*

    I am using the integrated WebLogic server that is delivered in JDeveloper and I have not configured any custom logging, so my assumption is that there is not another logging config set up.

    Adding com.ocpsoft.pretty.faces.config.annotation = TRACE to the logging.properties file found in Java_Home/lib is the correct method of triggering the trace, right? Are there any other changes I should make to logging.properties?

    #21560

    clemmonsm
    Participant

    Scratch the last post, I figured out how to set the logger for PrettyFaces to “FINEST” via the JDev UI for logger.xml.

    Here is the console output using v3.3.0: http://pastebin.com/hv4MWyC9

    Here is the console output using v3.3.2: http://pastebin.com/wuRkrcri

    #21561

    Thanks for sending the logs. I cannot find any reason my the NPE is suddenly thrown. The most interesting part of the log file is this:

    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/META-INF/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/model/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/gr/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/gr/dim/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/gr/dim/stas/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/gr/dim/stas/view/
    <WebClassesFinder> <processDirectory> Processing directory: file:/Users/clemmonsm/.jdeveloper/system11.1.1.5.37.60.13/o.j2ee/drs/dreeshomes/ViewControllerWebApp.war/WEB-INF/classes/gr/dim/stas/view/utils/
    <Nov 15, 2011 3:53:42 PM EST> <Error> <HTTP> <BEA-101165> <Could not load user defined filter in web.xml: com.ocpsoft.pretty.PrettyFilter.
    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:316)
    at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:332)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    Truncated. see log file for complete stacktrace
    Caused By: java.lang.NullPointerException
    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:117)
    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:193)
    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:193)
    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:193)
    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:193)
    Truncated. see log file for complete stacktrace
    >

    The problems seems to be that the following method call returns null:

    servletContext.getResourcePaths("/WEB-INF/classes/gr/dim/stas/view/utils/");

    This is really very strange. Anything special about that package?

    I committed a minor fix yesterday that will simply ignore directories for which getResourcePaths() returns null (to prevent the NPE). Could you perhaps give “3.3.2-SNAPSHOT” a try. Don’t be confused by the version numbers. The snapshot should actually be named “3.3.3-SNAPSHOT” but we didn’t update the version numbers till now. So simply use “3.3.2-SNAPSHOT” for the moment. You can find all details on how to use the snapshots here:

    https://github.com/ocpsoft/prettyfaces/wiki/Snapshots

    Looking forward to hear about your results.

    Christian

    #21562

    clemmonsm
    Participant

    You are right, that is strange. I am not familiar with the package “/WEB-INF/classes/gr/dim/stas/view/utils/” and it is not explicitly defined in my project tree. It must be some type of autogenerated package. I drilled down into that path in the referenced war path and there were no files in the “/WEB-INF/classes/gr/dim/stas/view/utils/” directory.

    All that said, using the 3.3.3 snapshot avoided the NPE: http://pastebin.com/NSVaAhfR

    Thank you for the help.

    #21563

    Hmm. This is really very strange. Perhaps it is some kind of virtual package that is created by the app server? I don’t know. However. It’s nice to hear that my patch fixed it.

    So you can either go with the snapshots for now or user the latest stable version and disable the annotation scanning. The next stable release will then contain the fix for this issue.

    Christian

    #21564

    clemmonsm
    Participant

    Since we’re not going to production for another couple of months, I will hang on to the snapshot in anticipation of the next stable release for now.

    Thanks for your help Christian. Now that this issue and an issue in another thread of mine are resolved, I can follow up with a question/issue about dynaviews that I have been working toward in a new thread. :-)

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

You must be logged in to reply to this topic.

Comments are closed.