Java Web Start: unsigned cglib

I am using hibernate on the server side with a client application launched via Java Web Start. I cannot sign banks (I would like to, but I cannot). I am getting a permission exception when I get a POJO with lazy fields.

Caused by: java.security.AccessControlException: Access denied (java.util.PropertyPermission cglib.debug) at java.security.AccessControlContext.checkPermission (Unknown source) at java.security.AccessController.checkPermission (Unknown source) in javaManager. .checkPermission (Unknown Source) at java.lang.SecurityManager.checkPropertyAccess (Unknown Source) at java.lang.System.getProperty (Unknown Source) at net.sf.cglib.core.DebuggingClassWriter. (DebuggingClassWriter.java:35) ... 44 more

How can I avoid this? I was thinking about setting the collection to null before returning the pojo to the client, but I would like to find a better solution.

+2


source to share


2 answers


You have two options:

  • sign all banks in your application;
  • change the bytecode provider from cglib to javassist which doesn't have this behavior (i.e. you can only sign the jars you need).


See also issue news here .

+2


source


Since you cannot use Hibernate's unresolved lazy fields on the client side anyway (accessing them will cause the client to try to load the fields from the db), I would choose two options:



  • If you need client-side data, you must ensure that lazy fields are resolved by the server before returning the POJO to the client.

  • If you don't need the fields, I would set them to zero.

+1


source







All Articles