gfyhser
gfyhser

Reputation: 174

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

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?

Upvotes: 14

Views: 18793

Answers (4)

fourgablesguy
fourgablesguy

Reputation: 469

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.

Upvotes: 10

JeffeDev
JeffeDev

Reputation: 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>

Upvotes: -1

Izaias Dantas
Izaias Dantas

Reputation: 79

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.

Upvotes: 3

Javier Larios
Javier Larios

Reputation: 312

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>

Upvotes: 13

Related Questions