3

For some time I am struggling to get an arquillian test case running. This test involves classes rooted in JSF classes and it ran into an ClassFormatError: Absent Code as the implementation for the javax.faces.model.DataModel could not be found.

My assumption was that I need to provide my test with a JSF implementation, but the implementations I found (for example the one bundled with JBoss) do not have the javax.faces package, only com.sun, and I could find no trace of the DataModel class.

Where am I misunderstanding the way it works here? Why doesn't the impl actually implement the api?

Community
  • 1
  • 1
kostja
  • 60,521
  • 48
  • 179
  • 224
  • This error can't be caused by having only a jsf-api.jar. Aren't you actually using javaee.jar? (which in turn indeed doesn't contain any method bodies). – BalusC Oct 24 '12 at 13:09
  • @BalusC I am almost definitely not using javaee.jar. I started with the `kitchensink` example from JBoss quickstarts as project template. All JEE dependencies I am using are defined by the `jboss-javaee-6.0-with-tools` BOM. I only started to investigate into the jsf-impls because I have read about the javaee.jar stubs. There is more info in the linked question, and I would love to read your input :) – kostja Oct 24 '12 at 15:33

1 Answers1

1

The API:

  • the public types to which consumers can write code to

The implementation:

  • private types consumers should not rely on
  • implementation details including things like markup (e.g. HTML) and container (e.g. servlet)

This separation isn't as clean as it should be, but this is largely the intent. Separation into these two jars are how the developers chose to organise the code but you'll need both to utilize the library in most contexts.

McDowell
  • 107,573
  • 31
  • 204
  • 267
  • Seems I have misunderstood the purpose and scope of the separation. Thanks for the clarification – kostja Oct 24 '12 at 15:35