SerialInitContextFactory not found in glassfish naming

后端 未结 2 1964
南旧
南旧 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 !

    0 讨论(0)
  • 2021-01-13 20:50

    Have you tried using the ACC? Your solution seems contrived.

    0 讨论(0)
提交回复
热议问题