This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How do I deal with Glassfish included libs crashing with application supplied libs?

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A CXF JAX-RS application I have uses the Jackson library to marshal POJOs to JSON. This works for the most part, but the other day it failed with a NPE when marshalling a deeply nested object into JSON.

After some investigation I found out that Jackson was included in Glassfish 3 (through Jersey) and after removing jackson-core-asl.jar, jackson-jaxrs.jar, jackson-mapper-asl.jar and jackson-xc.jar from the /modules directory of GF everything worked beautifully. I guess that Jackson 1.7.1 (included in GF3) had some bug that was fixed in the version shipped with my application (1.8).

Now the question is, why did I even have to do this in the first place? I would have thought libraries that are included in my war files should take presedence over any libraries in Glassfish's /modules directory.

Is there a cleaner way to do this than removing jars from the app server? Maybe there are other applications that depend on these jars ...

On a side note, the problem still exists with our GF2 container, but I cannot find any jackson libraries in the /lib folder (there is no /modules folder like in GF3). Any clues on where Jackson might be hiding in GF2 (if at all)?

(This has also been posted at SO, but I got very little response, so that is why I am reposting here)
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!