Sahana Patil
Sahana Patil

Reputation: 1

java.lang.NoClassDefFoundError: com/sun/jndi/toolkit/chars/CharacterEncoder

Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sterlingcommerce.woodstock.noapp.NoAppLoader.main(NoAppLoader.java:90)
Caused by: java.lang.NoClassDefFoundError: com/sun/jndi/toolkit/chars/CharacterEncoder
        at com.sun.jndi.fscontext.RefFSContextFactory.createContext(RefFSContextFactory.java:42)
        at com.sun.jndi.fscontext.RefFSContextFactory.createContextAux(RefFSContextFactory.java:47)
        at com.sun.jndi.fscontext.FSContextFactory.getInitialContext(FSContextFactory.java:49)

While trying to launch agent and App server used is Websphere Liberty providerUtil.jar and com.ibm.mq.allclient.jar are installed in the application. Still facing the issue`

Upvotes: 0

Views: 467

Answers (1)

chughts
chughts

Reputation: 4737

Looks like you are missing a jar that provides an implementation of com.sun.jndi.toolkit.chars.CharacterEncoder in your classpath.

It should have been specified as a dependency by one of the modules you are using, most likely the one that is invoking com.sun.jndi.fscontext.FSContextFactory.getInitialContext

The issue could be due to one or some of:

  • an erroneous classpath
  • the dependencies fetch not being run
  • a missing dependency
  • an erroneous dependency, ie the dependency is for one provider, but the code is looking for another.

Your error stack is looking for https://mvnrepository.com/artifact/com.sun.jndi/providerutil

Upvotes: 1

Related Questions