"Unknow type constant pool at position X" in tomcat logs since java 8
Asked Answered
G

4

13

I have a Java JSF2 web based application deployed on a Tomcat server, and since we moved to Java 8 / Tomcat 8 this error appears a lot in the tomcat output:

déc. 05, 2016 10:51:07 AM com.sun.faces.config.JavaClassScanningAnnotationScanner$ConstantPoolInfo containsAnnotation
GRAVE: Unknow type constant pool 0 at position 178

I tried different stuff to fix this warning but it always comes back.

Is this log a symptom of any issue ? Is it just a normal output? Is there a way to fix this?

Gagne answered 5/12, 2016 at 10:2 Comment(1)
In English, error message is SEVERE (instead of GRAVE).Preconcerted
E
12

I was presenting the same problem

Today I updated my pom.xml file to jsf version: 2.2.15 and that ERROR log was gone.

<dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-api</artifactId>
   <version>${jsf.version}</version>
   <scope>provided</scope>
</dependency>

<dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-impl</artifactId>
   <version>${jsf.version}</version>
   <scope>provided</scope>
</dependency>
Exploiter answered 31/10, 2017 at 13:27 Comment(0)
G
9

From my research it appears that this was a bug in JSF implementation Mojarra and was fixed in Mojarra version 2.2.11 for JSF 2.2 and Mojarra version 2.3.0-m02 for JSF 2.3.

Reported Bugs:

So, in case you're using Mojarra 2.2, you just need to upgrade to the latest available version as below (after removing the both com.sun.faces dependencies):

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <version>2.2.20</version>
</dependency>

Or in case you're using Mojarra 2.3, below is the currently (July 2024) latest available version:

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>jakarta.faces</artifactId>
    <version>2.3.21</version>
</dependency>

Do note that JSF 2.3 is fully backwards compatible with JSF 2.2, you might as well skip Mojarra 2.2 altogether and directly move on to Mojarra 2.3.

Gracchus answered 8/2, 2017 at 18:35 Comment(0)
B
2

I had the same same problem. I solved after updating my pom.xml file to 2.2.11.

<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.11</version>

<artifactId>jsf-impl</artifactId>
<version>2.2.11</version>

The postConstruct wasn't been execute in some ManagedBean, without any error.

Bannerman answered 25/2, 2020 at 15:29 Comment(0)
U
-1

I hope I helped: I got a solution using jsf version 2.2.2

with java 8

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jetty.version>6.1.4</jetty.version>
    <jsf.version>2.2.2</jsf.version>
</properties>




    <!-- https://mvnrepository.com/artifact/com.sun.faces/jsf-api -->
    <dependency>
       <groupId>com.sun.faces</groupId>
       <artifactId>jsf-api</artifactId>
       <version>${jsf.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.sun.faces/jsf-impl -->
    <dependency>
       <groupId>com.sun.faces</groupId>
       <artifactId>jsf-impl</artifactId>
       <version>${jsf.version}</version>
    </dependency>
Unloosen answered 11/7 at 16:49 Comment(2)
Eu consegui uma solução usando a versão 2.2.2 do jsf / I got a solution using jsf version 2.2.2 -- Hello, and welcome to Stack Overflow. Thanks for posting this, but all posts to Stack Overflow are requested to be in English. See here for details. Please either translate, or delete this post.Myrmidon
It's not needed to repeat an already given answer upon agreement/confirmation like you'd do in an old fashioned discussion forum. Just upvote it.Secretin

© 2022 - 2024 — McMap. All rights reserved.