4

I have simple question. I'm working on JAVA application which runs on Glassfish 4.1, I wrote code that needs > Guava 18.0 libs, when i run my code in my local IDE it works well, but when i try to run this code as part of the application on Glassfish I'm getting error caused by the fact that the application contains Guava libs in version 13 and i need version 18+. So, my question is:

Can i somehow add Guava 18.0 libs to the Glassfish and tell it to prefer this new library in my application?

Thanks for answers.

user1827257
  • 1,600
  • 4
  • 17
  • 24
  • Have you configured it in maven? Make Guava 18.0 libs as runtime dependency. If using IDE than you need to add Guava 18.0 libs to the classpath. Like add Guava 18.0 libs jar to `/WEB-INF/libs/` if its using `war` packaging. Simply replace Guava 13.0 libs with Guava 18.0 libs. – abcdef12 Feb 17 '16 at 10:43
  • Which IDE are you using? – abcdef12 Feb 17 '16 at 11:09
  • Thanks for you answer. But my situation is a bit complicated. I'm not able to change libs dependencies of the application and my code is involved in to the application from UI of the application as .jar file and its classes are used in some case of processing. I try to add Guava 18.0 lib into \WEB-INF\lib but without success. – user1827257 Feb 17 '16 at 11:15

1 Answers1

2

Try this:

  • Download The new library files you're interested in (or pull them from your local repository considering you already have them there).
  • The outdated files in Glassfish should be inside of the glassfish module somewhere near: \glassfish4\glassfish\modules
  • Replace the old library file with the newly downloaded fresh files.

I had to do the same once before with a jboss logger when getting a debugF error and I got this answer from SO here. Good luck!

Old Schooled
  • 1,222
  • 11
  • 22