You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above works fine when used in jersey server application, however, in client application it runs into error with following error:
java.lang.IllegalAccessException: class org.glassfish.jersey.client.proxy.RequestParameters cannot access a member of class org.glassfish.jersey.client.proxy.MyBeanParamWithPrivateField with modifiers "private"
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:394)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:714)
at java.base/java.lang.reflect.Field.checkAccess(Field.java:1156)
at java.base/java.lang.reflect.Field.get(Field.java:441)
at org.glassfish.jersey.client.proxy.RequestParameters.addBeanParameter(RequestParameters.java:160)
at org.glassfish.jersey.client.proxy.RequestParameters.addParameter(RequestParameters.java:139)
at org.glassfish.jersey.client.proxy.WebResourceFactory.invoke(WebResourceFactory.java:203)
... 5 more
Expectation
The API models and service interfaces should be compatible with both the jersey based server application and jersey based client proxy so as to enable sharing of common codebase among different projects using the same API.
The text was updated successfully, but these errors were encountered:
Getting IllegalAccessException in jersey-client-proxy when
@BeanParam
annotated class contains private fields.Consider the following example where,
Given that I have a POJO for employees as below:
Given a POJO representing an employee:
We can use the above class as @BeanParam in our service interface as below
The above works fine when used in jersey server application, however, in client application it runs into error with following error:
Expectation
The API models and service interfaces should be compatible with both the jersey based server application and jersey based client proxy so as to enable sharing of common codebase among different projects using the same API.
The text was updated successfully, but these errors were encountered: