0

I am using tomcat and maven at my project. I updated one jar in maven successfully. The development was very successfull as I can see the new method that I updated in the jar file without any problem. But when it comes to execution, unfortunately tomcat sees the jars inside its folder tomcat/shared/lib not the maven jar. There is a way to make tomcat see the new jar instead of jars inside tomcat/shared/lib or is there a way to make tomcat see maven jars ?

I hope I was clear about my question. If not , I can provide more examples.

Tonyukuk
  • 5,745
  • 7
  • 35
  • 63
  • Is the jar that you are creating using maven part of your WAR i.e. inside WEB-INF/lib folder ? – piy26 Apr 12 '18 at 10:19
  • yes it's inside WEB-INF/lib folder. But it reads jar under tomcat/shared/lib. – Tonyukuk Apr 12 '18 at 10:19
  • am i correct in my understanding that the same jar is part of WEB-INF/lib and also shared tomcat/shared/lib ? If yes, any specific reason behind doing so ? – piy26 Apr 12 '18 at 10:47
  • dont know the reason why idiot developers of the application made it like that :) – Tonyukuk Apr 12 '18 at 11:12

1 Answers1

1

If you are replacing classes already implemented in the tomcat and trying to load them using the tomcat class loader then the tomcat will always return the classes added to its lib folder according to tomcat class loading order.

Maybe custom class loader can help you to load your version of the classes. Check this for more information.

Akhadra
  • 419
  • 3
  • 10