Jersey/REST--NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.getContextClassLoaderPA()Ljava/security/PrivilegedAction;

前端 未结 2 901
醉话见心
醉话见心 2021-01-15 07:07

I get the NoSuchMethodError when trying build the REST service using jersey. Any help would be much appreciated.

My POM.xml :

             


        
相关标签:
2条回答
  • 2021-01-15 07:34

    I faced the issue too recently. Check if class with name com.sun.jersey.core.reflection.ReflectionHelper is present in any other jar.

    For me I had caliper.jar also, and it was being loaded from there instead. That class did not have getContextClassLoaderPA.

    Do a grep -ir com.sun.jersey.core.reflection.ReflectionHelper * to see if any other jar shows up the same class.

    0 讨论(0)
  • 2021-01-15 07:41
    • Bea Weblogic 12.1.3.0.0
    • jdk 1.7.0_75
    • jersey dependencies 1.19

    I had the following exception: java.lang.IllegalAccessError: tried to access method com.sun.jersey.core.spi.factory.ResponseImpl.<init etc.

    • Tried to use "provided" scope for the jersey dependencies, but it didn't work.
    • The error seems to appear randomly, with similar packages working or not.
    • I created another weblogic managed server and deployed the same war that was not working on the initial managed server. The error doesn't appear.

    This may suggest that there is an internal Weblogic issue. I was updating the same deployment with newer wars. After a period, it looks like the update process is not unloading the old war dependencies. I removed manually from the weblogic directories the deployed war files. I wasn't able to remove two wars: the current one and the replaced one, while the managed server was running. Directories of interest: 12.1.3\user_projects\domains\wl_server\servers\managed_1\stage, 12.1.3\user_projects\domains\wl_server\servers\managed_1\tmp_WL_user, 12.1.3\user_projects\domains\wl_server\servers\AdminServer\upload.

    After stopping the managed server, I could remove the old war, leaving only the latest war. On managed_1 start, the latest war is working without the weird exception.

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