SerialInitContextFactory not found in glassfish naming

后端 未结 2 1993
南旧
南旧 2021-01-13 20:21

This one starts to drive me completely nuts ...

I want to create a Glassfish client application using Maven.

For that, I\'ve added the requried gf-client dep

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-13 20:37

    For a reason I not totally understand, there is a configured Context classloader when run in application. This classloader seems to use some kind of OSGi naming restriction.

    As a consequence, to avoid the bug, I reset the context class loader :

    Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
    

    And it worked !

提交回复
热议问题