Hello,

    thank you for the advice. Yes it's by checking the web.xml that we stumbled upon the prettyfaces dependency which we now removed. I'm attaching the web.xml in case you maybe spot another oddity.     Compared to the lib/ folder from the tomee 7.0.3 distribution, we have added in our lib folder only the postgresql driver.

    In terms of the classpath, and apart from the prettyfaces dependency which was present when we hit the issue, but that we've removed now, all the dependencies which would be suspicious are listed as 'provided' or 'test' in the pom, so shouldn't affect anything.

    Regards,

Emmanuel


On 17/07/18 06:36, Romain Manni-Bucau wrote:
Hi

Maybe check your web.xml declaration of faces servlet, you classpath and
webapp lib folder (some jsf api or impl leaking?) and finally ensure when
you redeployed that you cleaned work/, conf/<instance> and other temporary
folders in your catalina.base folder.

Le mar. 17 juil. 2018 00:22, Jean-Louis Monteiro <jlmonte...@tomitribe.com>
a écrit :

Hi,

Thanks for the detailed email with context and useful information.

Is it random, or can you reproduce easily?
Are you using JDK 8?

Regards
Jean-Louis

--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com

On Mon, Jul 16, 2018 at 1:54 PM, Emmanuel Touzery <
emmanuel.touz...@lit-transit.com> wrote:

Hello,

     we have a TOMEE 7.0.3 application, which uses also JMS, which works
without issues. We've recently made a new version of the application (one
of the notable changes is a migration from using the JMS1.1 to the JMS2
API).

     With the new version, we have an issue, but only on our PROD
environment, where we get no errors in the catalina.out log file (but the
application doesn't work), but an error in the localhost log file, the
error being as in the title of the email, I put the info from the
localhost
log file at the end of this email.

     I can't put the source on github or something like that,
unfortunately. What is strange is that this error does not occur on our
staging or UAT environments, but it does occur every time (well, we tried
multiple times to restart the application and it failed consistently) on
the PROD environment. We copied the entire PROD tomee folder on another
machine and failed to reproduce the issue. We also tried to simulate
incoming traffic when restarting the application, and run it against a
backup of the PROD database... Somehow we can't reproduce the error. We
are
guessing that maybe the PROD traffic is higher than what we can simulate
and some incoming message comes at just the wrong time? But we don't know
for sure.

     Now, studying the issue, we realized that we used to have this in our
src/main/webapp/WEB-INF/faces-config.xml:

<?xml version="1.0" encoding="UTF-8"?><faces-config xmlns="
http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2
001/XMLSchema-instance" xsi:schemaLocation="http://jav
a.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/jav
aee/web-facesconfig_2_1.xsd" version="2.1"><managed-bean><m
anaged-bean-name>login</managed-bean-name><managed-bean-
class>com.lecip.tms.tms_core.application.Login</managed-
bean-class><managed-bean-scope>view</managed-bean-scope
</managed-bean></faces-config>
     We believe the JSF version is not correct for JEE7 anymore, in
addition the managed-bean annotation is not necessary, so we changed the
file to now contain:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd";
               version="2.2">
</faces-config>

     Could this be the cause for that error that we saw in our PROD
environment? Or you would think the root cause would be something else?
The
problem is that it's pretty difficult for us to experiment with changes
since any deployment on PROD must be first validated on staging and
UAT...
Any hints? Is there maybe some logging configuration flag we could
activate
to get more information about the error? Or any other place to look to
get
more information about the issue?

     The irony is that we use JSF only for the login screen and nowhere
else...

     Regards,

Emmanuel

12-Jul-2018 17:44:04.335 SEVERE [localhost-startStop-1]

org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods
For security constraints with URL pattern [/*] only the HTTP methods
[TRACE
HEAD DELETE POST GET OPTIONS PUT] are covered. All other methods are
uncovered.
12-Jul-2018 17:44:22.078 SEVERE [localhost-startStop-1]
org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
  java.lang.IllegalStateException: No Factories configured for this
Application. This happens if the faces-initialization does not work at
all
- make sure that you properly include all configuration settings
necessary
for a basic faces application and that all the necessary libs are
included.
Also check the logging output of your web application and your container
for any exceptions!
If you did that and find nothing, the mistake might be due to the fact
that you use some special web-containers which do not support registering
context-listeners via TLD files and a context listener is not setup in
your
web.xml.
A typical config looks like this;
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletCont
extListener</listener-class>
</listener>

         at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:305)
         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:225)
         at javax.faces.webapp.FacesServlet.init(FacesServlet.java:115)
         at org.apache.catalina.core.StandardWrapper.initServlet(Standar
dWrapper.java:1183)
         at org.apache.catalina.core.StandardWrapper.loadServlet(Standar
dWrapper.java:1099)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrappe
r.java:989)
         at org.apache.catalina.core.StandardContext.loadOnStartup(Stand
ardContext.java:4913)
         at org.apache.catalina.core.StandardContext.startInternal(Stand
ardContext.java:5223)
         at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.
java:150)
         at org.apache.catalina.core.ContainerBase.addChildInternal(Cont
ainerBase.java:752)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBas
e.java:728)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.
java:734)
         at org.apache.catalina.startup.HostConfig.deployDescriptor(Host
Config.java:596)
         at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(
HostConfig.java:1805)
         at java.util.concurrent.Executors$RunnableAdapter.call(
Executors.java:511)
         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
Executor.java:1149)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
lExecutor.java:624)
         at java.lang.Thread.run(Thread.java:748)

and later:

12-Jul-2018 17:44:23.083 SEVERE [http-nio-8080-exec-3]
org.apache.catalina.core.StandardHostValve.invoke Exception Processing
/tomee_tmsp/rest/transmitter/heartbeat
  java.lang.NullPointerException
         at org.apache.openejb.util.classloader.URLClassLoaderFirst.shou
ldSkipJsf(URLClassLoaderFirst.java:530)
         at org.apache.openejb.util.classloader.URLClassLoaderFirst.shou
ldDelegateToTheContainer(URLClassLoaderFirst.java:146)
         at org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(T
omEEWebappClassLoader.java:163)
         at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(W
ebappClassLoaderBase.java:1119)
         at org.apache.catalina.core.StandardWrapper.servletSecurityAnno
tationScan(StandardWrapper.java:1128)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(A
uthenticatorBase.java:458)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHo
stValve.java:140)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorRepo
rtValve.java:79)
         at org.apache.tomee.catalina.OpenEJBSecurityListener$RequestCap
turer.invoke(OpenEJBSecurityListener.java:97)
         at org.apache.catalina.valves.AbstractAccessLogValve.invoke(Abs
tractAccessLogValve.java:624)
         at org.apache.catalina.core.StandardEngineValve.invoke(Standard
EngineValve.java:87)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAd
apter.java:349)
         at org.apache.coyote.http11.Http11Processor.service(Http11Proce
ssor.java:783)
         at org.apache.coyote.AbstractProcessorLight.process(AbstractPro
cessorLight.java:66)
         at org.apache.coyote.AbstractProtocol$ConnectionHandler.
process(AbstractProtocol.java:798)
         at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun
(NioEndpoint.java:1434)
         at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketPro
cessorBase.java:49)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool
Executor.java:1149)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo
lExecutor.java:624)
         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.
run(TaskThread.java:61)
         at java.lang.Thread.run(Thread.java:748)



<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
    <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>*.xhtml</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>headersFilter</filter-name>
        <filter-class>com.lecip.tms.tms_core.application.HeadersFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>headersFilter</filter-name>
        <url-pattern>*</url-pattern>
    </filter-mapping>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
        <param-value>false</param-value>
    </context-param>

    <servlet>
        <servlet-name>javax.ws.rs.core.Application</servlet-name>
    </servlet>
    <servlet-mapping>
        <servlet-name>javax.ws.rs.core.Application</servlet-name>
        <url-pattern>/rest/*</url-pattern>
    </servlet-mapping>

    <!-- take index.xhtml as default page -->
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>non-restricted pages</web-resource-name>
            <url-pattern>/login.xhtml</url-pattern>
            <url-pattern>/errorpages/*</url-pattern>
            <url-pattern>/logincontact.html</url-pattern>
            <url-pattern>/css/*</url-pattern>
            <url-pattern>/fonts/*</url-pattern>
            <url-pattern>/img/*</url-pattern>
            <url-pattern>/rest/transmitter/*</url-pattern>
            <url-pattern>/rest/clear_caches</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <!--    uncommment this to turn on login/authentication-->
    <security-constraint>
        <display-name>SecurityConstraint</display-name>
        <web-resource-collection>
            <web-resource-name>securityconstraint</web-resource-name>
            <description/>
            <url-pattern>/*</url-pattern>
            <http-method>POST</http-method>
            <http-method>HEAD</http-method>
            <http-method>PUT</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>TRACE</http-method>
            <http-method>DELETE</http-method>
            <http-method>GET</http-method>
        </web-resource-collection>
        <auth-constraint>
            <description/>
            <role-name>authusr</role-name>
        </auth-constraint>
    </security-constraint>

    <!--    dummy role (to apply container authentication part only) -->
    <security-role>
        <role-name>authusr</role-name>
    </security-role>

    <login-config>
        <auth-method>FORM</auth-method>
        <!-- <realm-name>ltaJdbcRealm</realm-name> -->
        <form-login-config>
            <form-login-page>/login.xhtml?case=redirected</form-login-page>
            <form-error-page>/login.xhtml?case=error</form-error-page>
        </form-login-config>
    </login-config>

    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>

    <session-config>
        <!-- if changing session timeout, change 'login.xhtml' reload timeout accordingly -->
        <session-timeout>
            30
        </session-timeout>
        <!-- for some short info, see: https://blog.whitehatsec.com/session-cookie-httponly-flag-java/ -->
        <cookie-config>
            <http-only>true</http-only>
            <!-- ENABLE 'secure' SETTING FOR PRODUCTION -->
      <!--  <secure>true</secure> -->
        </cookie-config>
    </session-config>

    <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/login.xhtml?case=viewexpired</location>
    </error-page>

    <error-page>
        <error-code>500</error-code>
        <location>/errorpages/500.html</location>
    </error-page>

    <error-page>
        <error-code>404</error-code>
        <location>/errorpages/404.html</location>
    </error-page>

    <error-page>
        <error-code>403</error-code>
        <location>/errorpages/403.html</location>
    </error-page>

    <listener>
        <listener-class>com.lecip.tms.tms_core.application.ActiveSessionsTracker</listener-class>
    </listener>
</web-app>

Reply via email to