Weblogic prettyfaces deployment problem

Splash Forums PrettyFaces Users Weblogic prettyfaces deployment problem

This topic contains 54 replies, has 9 voices, and was last updated by  Christian Kaltepoth 2 years, 12 months ago.

Viewing 15 posts - 1 through 15 (of 55 total)
  • Author
    Posts
  • #18122

    smooth4me
    Participant

    Hi,

    I am using JSF2, PF3 and PrettyFaces latest. I was trying to deploy my app into weblogic server 12c I am getting the following exception

    Code:
    An error occurred during activation of changes, please see the log for details.
    [HTTP:101371]There was a failure when processing annotations for application C:beaapplicationWLTest. Ensure that the annotations are valid. The error is com.ocpsoft.pretty.PrettyFilter
    com.ocpsoft.pretty.PrettyFilter

    Web.xml

    Code:
    <?xml version=”1.0″ encoding=”UTF-8″?>
    <web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221;
    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
    id=”WebApp_ID” version=”2.5″>
    <display-name>WLTest</display-name>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
    </servlet-mapping>
    <context-param>
    <description>State saving method: ‘client’ or ‘server’ (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
    </context-param>
    <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>

    <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>
    <context-param>
    <param-name>com.ocpsoft.pretty.BASE_PACKAGES</param-name>
    <param-value>none</param-value>
    </context-param>
    </web-app>

    Thanks for your help in advance.

    #21887

    Hi,

    This is very strange, because you have already disabled annotation scanning using:

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

    Christian, do you have any ideas about this?

    #21888

    The error message

    An error occurred during activation of changes, please see the log for details.
    [HTTP:101371]There was a failure when processing annotations for application C:beaapplicationWLTest. Ensure that the annotations are valid. The error is com.ocpsoft.pretty.PrettyFilter

    is not created by PrettyFaces. I don’t think that it has something to do with the annotation scanning of PrettyFaces. Could you have a look at the logs like the error message suggests?

    #21889

    smooth4me
    Participant

    Hi,

    Sorry for the late reply. Surprisingly I don’t have too many files in the project not even java files just two files index.jsp which is entry for my project it redirects to home.xhtml which has one primefaces calendar field.

    Thanks

    #21890

    Did you find anything in the logs? The error messages suggests to do that. Perhaps you will find details there.

    #21891

    smooth4me
    Participant

    Hi,

    I checked my log files there is no information regarding this except the above error message.

    Please provide email where I can send my code for your test.

    Thanks,

    #21892

    Just send it to: christian {at} kaltepoth {dot} de

    #21893

    Thanks for sending the WAR file. I’ll have a look at the WAR file as

    soon as I find some time. But this may take some days.

    In the meantime I really recommend to check if there are any log files

    which contain more details about the deployment problem. There must be

    more than this small message you posted.

    #21894

    It’s possible that you need to increase the logging level in your application server.

    It would also be great if you could post the full stack trace. Thanks!

    #21895

    I tried to deploy the application to WebLogic Server 12c (12.1.1) and got the following exception printed to the console:

    21.12.2011 10:26:59 org.primefaces.webapp.PostConstructApplicationEventListener processEvent
    INFO: Running on PrimeFaces 3.0.M4-SNAPSHOT
    21.12.2011 10:26:59 com.ocpsoft.pretty.PrettyFilter init
    INFO: PrettyFilter starting up...
    <21.12.2011 10:26 Uhr MEZ> <Error> <HTTP> <BEA-101388> <The ServletContext was passed to the ServletContextListener.contextInitialized method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with javax.servlet.annotation.WebListener.>
    <21.12.2011 10:26 Uhr MEZ> <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:576)
    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: com.ocpsoft.pretty.PrettyException: Could not retrieve DynaViewId.
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.getFacesDynaViewId(PrettyConfigurator.java:103)
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:67)
    at com.ocpsoft.pretty.PrettyFilter.init(PrettyFilter.java:316)
    at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:576)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    Truncated. see log file for complete stacktrace
    Caused By: java.lang.UnsupportedOperationException: [HTTP:101388]The ServletContext was passed to the ServletContextListener.contextInitialized method of a ServletContextListener that was neither declared in web.xml or web-fragment.xml, nor annotated with javax.servlet.annotation.WebListener.
    at weblogic.servlet.internal.WebAppServletContext.checkNotifyDynamicContext(WebAppServletContext.java:3834)
    at weblogic.servlet.internal.WebAppServletContext.getServletRegistrations(WebAppServletContext.java:3727)
    at com.ocpsoft.pretty.faces.config.servlet.WebXmlParser.parse(WebXmlParser.java:54)
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.getFacesDynaViewId(PrettyConfigurator.java:98)
    at com.ocpsoft.pretty.faces.config.PrettyConfigurator.configure(PrettyConfigurator.java:67)
    Truncated. see log file for complete stacktrace

    #21896

    I saw this stacktrace on the console after I deployed your WAR using the web interface.

    To be honest, I’ve no idea what this exception is caused by. It happens while PrettyFaces calls ServletContext.getServletRegistrations(). The ServletContext PrettyFaces is using is obtained from the init() method of the PrettyFilter class. So there is no ServletContextListener involved here.

    I saw your web.xml contains version="2.5". You could try to update this to 3.0. Perhaps this helps.

    Another thing I saw in your WAR file is that it seems to contain multiple versions of jsf-impl.jar and jsf-api.jar. This may lead to all sorts of problems, so you should really use only one version or use the version provided by WebLogic.

    I hope this helps a bit to find the root cause of this.

    Christian

    #21897

    This gives me an idea. It’s possible that even if this is caused by some other issue, it might be a good idea to be able to specify the DynaView path to avoid or work around problems like this. That way calculating would not be necessary.

    ~Lincoln

    #21898

    chris-pro
    Participant

    Hi

    I have same issue with “Weblogic 12.1.1” and “JSF1.2”. It seems that Weblogic 12 is not support the Servlet 3.0 Methode “ServletContext.getServletRegistrations();” in “com.ocpsoft.pretty.faces.config.servlet.WebXmlParser”.

    After comment out the “if (context.getMajorVersion() >= 3)” block, everythings works. The “context.getMajorVersion()” returns always 3, also if in web.xml the “web-app version 2.5” is declared.

    Maybe you have to introduce a new property-flag for “Weblogic 12” in web.xml or elsewhere.

    You will find the working files (source and class) attached.

    #21899

    Sounds like a bug in WebLogic.

    Have you tried contacting them for support? What do they say?

    ~Lincoln

    #21900

    rfsonge22
    Member

    To come around this problem on WebLogic 12c I had to change the way pretty parses the web.xml. In the method parse(ServletContext ) in class com.ocpsoft.pretty.faces.config.servlet.WebXmlParser.java, I commented out the code witch uses context.getServletRegistrations(), and used the digester parsing instead.


    public void parse(final ServletContext context) throws IOException, SAXException
    {
    // if (context.getMajorVersion() >= 3)
    // {
    // Map<String, ? extends ServletRegistration> servlets = context.getServletRegistrations();
    // if (servlets != null)
    // {
    // for (ServletRegistration s : servlets.values())
    // {
    // if (s.getClassName().equalsIgnoreCase(FACES_SERVLET))
    // {
    // Collection<String> mappings = s.getMappings();
    // if (!mappings.isEmpty())
    // {
    // facesMapping = mappings.iterator().next();
    // break;
    // }
    // }
    // }
    // }
    //
    // if (facesMapping == null)
    // {
    // log.warn("Faces Servlet (javax.faces.webapp.FacesServlet) not found in web context - cannot configure PrettyFaces DynaView");
    // }
    // }
    // else
    // {
    InputStream in = context.getResourceAsStream(WEB_XML_PATH);
    if (in == null)
    {
    log.warn("No " + WEB_XML_PATH + " found - cannot configure PrettyFaces DynaView");
    }

    WebXml webXml = new WebXml();
    if (in != null)
    {
    Digester digester = getConfiguredDigester();
    digester.push(webXml);
    digester.parse(in);
    processConfig(webXml);
    }
    //}

    log.trace("Completed parsing web.xml");
    }

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

You must be logged in to reply to this topic.

Comments are closed.