PrettyException: Failed to load configuration

Splash Forums PrettyFaces Users PrettyException: Failed to load configuration

This topic contains 4 replies, has 2 voices, and was last updated by  Arun Kumar 5 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18305

    Arun Kumar
    Participant

    I looked at the couple of other posts with similar errors. One post I found talked about commons-digester 2.1 dependency which I found pretty-faces hadn’t automatically pulled in. So I added another dependency in my pom for that, but that still didn’t help.

    The few google results for “Unable to build relative path” error below shows source code files for pretty-faces.

    One last thing I tried was use 3.3.0 in pretty-config for xmlns and xsd, as well as the 3.3.3 as shown. I also noticed the website docs mentioned 3.3.2 as the latest version (whereas I got 3.3.3 from Eclipse). I tried 3.3.2 as well with appropriate pretty-config xmlns and xsd, with no luck.

    Environment is prettyfaces-jsf2 3.3.3, Servlet 2.5, JSF 2.0. Weblogic 10.3.6,

    web.xml:

    (Not sure what bits might be relevant or not, so I’m including all of it)

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <web-app version=”2.5″ xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221; xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd“>

    <display-name>loanapp</display-name>

    <session-config>

    <session-timeout>

    30

    </session-timeout>

    </session-config>

    <servlet>

    <servlet-name>FacesServlet</servlet-name>

    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

    <load-on-startup>1</load-on-startup>

    </servlet>

    <servlet-mapping>

    <servlet-name>FacesServlet</servlet-name>

    <url-pattern>*.jsf</url-pattern>

    </servlet-mapping>

    <servlet-mapping>

    <servlet-name>FacesServlet</servlet-name>

    <url-pattern>*.faces</url-pattern>

    </servlet-mapping>

    <servlet-mapping>

    <servlet-name>FacesServlet</servlet-name>

    <url-pattern>*.xhtml</url-pattern>

    </servlet-mapping>

    <welcome-file-list>

    <welcome-file>/login.jsf</welcome-file>

    </welcome-file-list>

    <context-param>

    <param-name>primefaces.THEME</param-name>

    <param-value>home</param-value>

    </context-param>

    <context-param>

    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

    <param-value>server</param-value>

    </context-param>

    <context-param>

    <param-name>com.sun.faces.expressionFactory</param-name>

    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>

    </context-param>

    <context-param>

    <param-name>com.ocpsoft.pretty.CONFIG_FILES</param-name>

    <param-value>/WEB-INF/pretty-config.xml</param-value>

    </context-param>

    <filter>

    <filter-name>Pretty Filter</filter-name>

    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>Pretty Filter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <listener>

    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

    </listener>

    <!– Shiro authentication –>

    <listener>

    <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>

    </listener>

    <filter>

    <filter-name>ShiroFilter</filter-name>

    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>ShiroFilter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>INCLUDE</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <filter>

    <filter-name>AuthorizationFilter</filter-name>

    <filter-class>com.saggezza.mmfsl.loanapp.shiro.filter.AuthorizationFilter</filter-class>

    <init-param>

    <param-name>map-file</param-name>

    <param-value>/properties/urltoprogramid.properties</param-value>

    </init-param>

    </filter>

    <filter-mapping>

    <filter-name>AuthorizationFilter</filter-name>

    <url-pattern>/forms/*</url-pattern>

    </filter-mapping>

    <!– Error handling –>

    <error-page>

    <error-code>404</error-code>

    <location>/error.jsf</location>

    </error-page>

    <error-page>

    <error-code>500</error-code>

    <location>/error500.jsf</location>

    </error-page>

    <!– Mime mappings –>

    <mime-mapping>

    <extension>css</extension>

    <mime-type>text/css</mime-type>

    </mime-mapping>

    <mime-mapping>

    <extension>png</extension>

    <mime-type>image/png</mime-type>

    </mime-mapping>

    </web-app>

    pretty-config.xml:

    <?xml version=”1.0″ encoding=”UTF-8″?>

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

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

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

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

    <url-mapping id=”login”>

    <pattern value=”/login” />

    <view-id value=”/login.jsf” />

    </url-mapping>

    <url-mapping id=”forms”>

    <pattern value=”/” />

    <view-id value=”#{forms.getViewPath}” />

    </url-mapping>

    </pretty-config>

    And finally the stack trace from the server logs:

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

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

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

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

    at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:96)

    at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)

    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)

    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3154)

    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518)

    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)

    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)

    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)

    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)

    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)

    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)

    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:671)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)

    at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:44)

    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)

    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)

    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)

    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)

    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)

    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)

    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)

    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)

    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)

    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)

    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)

    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

    Caused By: java.lang.IllegalArgumentException: Unable to build path relative to ‘/WEB-INF/classes/’ from: /home/arun/Oracle/Middleware-wl1036/user_projects/domains/mmfsl/servers/AdminServer/tmp/_WL_user/loanapp/kwp9v4/war/WEB-INF/lib/_wl_cls_gen.jar!/META-INF/

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.getPathRelativeToClassesFolder(WebClassesFinder.java:233)

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

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

    at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.findClasses(WebClassesFinder.java:75)

    at com.ocpsoft.pretty.faces.config.spi.AnnotationConfigurationProvider.loadConfiguration(AnnotationConfigurationProvider.java:82)

    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:63)

    at com.ocpsoft.pretty.PrettyFilter.init(PrettyFilter.java:337)

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

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

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

    at weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:96)

    at weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:57)

    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)

    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3154)

    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1518)

    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:484)

    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)

    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)

    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)

    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)

    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)

    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:671)

    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)

    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)

    at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:44)

    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)

    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)

    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)

    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)

    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)

    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)

    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)

    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)

    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)

    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)

    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)

    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)

    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)

    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

    >

    #22433

    It looks some very weird problem with the annotation scanning. But actually I don’t know what exactly is going wrong here.

    It looks like your are using the PrettyFaces XML configuration. Do you want to use annotations at all? If not, you could just disable the annotation scanning:

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

    I hope this helps.

    Christian

    #22434

    One more thing. Could you perhaps increase the logging level for com.ocpsoft.pretty.faces.config.annotation to TRACE and post the logs up to the point at which the exception occurs. That would be really helpful for fixing this.

    #22435

    Arun Kumar
    Participant

    Christian, quick update. Thanks for your response, disabling context scanning appears to have helped but now I’m getting other errors. I am heading in for a meeting, and it will be a couple of hours before I can look at this. I will post the detailed TRACE logs then.

    Thanks,

    arun

    #22436

    Arun Kumar
    Participant

    Just an update on this. Disabling annotation scanning appears to have fixed this issue. But I am running into other problems. I will create a separate thread for that. Thanks for all your help.

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

You must be logged in to reply to this topic.

Comments are closed.