1

I'm using apache-tomee-jaxrs-1.7.1 and I'm trying to deploy with maven 3 getting this error:

Unable to load servlet listener class: com.sun.faces.config.ConfigureListener:

These are my dependencies in pom.xml:

  ...
  <dependencies>
    <dependency>
      <groupId>javax</groupId>
      <artifactId>javaee-api</artifactId>
      <version>6.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp.jstl</groupId>
      <artifactId>jstl-api</artifactId>
      <version>1.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.openjpa</groupId>
      <artifactId>openjpa</artifactId>
      <version>2.3.0</version>
    </dependency>
  </dependencies>
  ...

Any ideas? Thanks in advance.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
emiliano.bovetti
  • 190
  • 2
  • 11

1 Answers1

4

Simply get rid of the in the exception mentioned <listener> entry in webapp's web.xml.

TomEE ships with MyFaces, not Mojarra. That Mojarra-specific <listener> entry in web.xml is usually auto-included by some IDEs trying to be smarter than they are and/or left behind in poor quality open source projects. Be careful on them. That explicit registration is unnecessary on decent containers. See also a.o. Configuration of com.sun.faces.config.ConfigureListener.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • You are completely right. I added `org.apache.myfaces.webapp.StartupServletContextListener` in *web.xml* and now works! Sorry for this dummy question, thanks a lot. – emiliano.bovetti Jun 17 '15 at 12:53
  • 1
    That one should also not have been necessary. Those listeners are supposed to be auto-registered without any additional configuration. This would only fail in buggy containers (as mentioned in that link), but as far as I experienced, a regular TomEE container doesn't have this problem. – BalusC Jun 17 '15 at 12:53