1

Edit: This Question was marked duplicate of how-do-i-fix-a-nosuchmethoderror but its not duplicate one, here i am asking about does this problem happening because of icu4j jar and WebSphere.

I am running application on WebSphere 7 and i am using STS for development at one point i am calling UCharacter.offsetByCodePoints from icu4j 58.2 jar that i have added my application's web-inf/lib folder. when i click on method STS is able find this method but at run time i am getting below error.

java.lang.NoSuchMethodError: com/ibm/icu/lang/UCharacter.offsetByCodePoints(Ljava/lang/CharSequence;II)I

I have added this jar at every required place like in WEB-INF/lib folder.

Is it due to WebSphere is getting confused between sun.text.normalizer.UCharcter and com.ibm.icu.lang.UCharacter or does webSphere has older version of icu4j or what ?

What could be possible solution for it.

Community
  • 1
  • 1
Keval
  • 1,857
  • 16
  • 26
  • I dont think this question is a dup. @K M PATEL -- have yuo tried changing the jar loading policy in WebSphere to Parent-Last? – mazaneicha Mar 30 '17 at 15:11
  • @mazaneicha thanks for your suggestion let me try it – Keval Mar 30 '17 at 17:54
  • 1
    Note that if you go PARENT_LAST, you'll need to be careful that you don't have stuff in your app that's incompatible with server APIs (for example, you can't have the Servlet API in a PARENT_LAST app). If ICU4J is the only thing you need to load your own copy in preference to the server's copy, you may want to use an isolated shared library instead, which limits the PARENT_LAST to just the stuff in that shared library. – Jarid Mar 30 '17 at 18:08
  • @mazaneicha i tried with Parent-Last but it doesnot solved my issue. – Keval Apr 03 '17 at 05:56

0 Answers0