users@glassfish.java.net

serialization problems with Security manager ON

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Wed, 16 Dec 2009 21:15:40 +0100

After enabling the Security Manager, any framework that tries to
serialize classes with private fields throw the exception below..

it happens with JSF, DWR and Jersey -- different applications and the
same error. With Security Manager OFF, all applications work fine..


[#|2009-12-16T21:13:02.983+0100|WARNING|glassfishv3.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=34;_ThreadName=Thread-1;|StandardWrapperValve[Arena
RESTful Web Service]: PWC1406: Servlet.service() for servlet Arena
RESTful Web Service threw exception
java.lang.IllegalAccessError: Class
com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection can not
access a member of class
com.kenai.puj.arena.model.entity.PujAdvertisementEntity with modifiers
"private"
        at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.get(Accessor.java:237)
        at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.print(TransducedAccessor.java:235)
        at com.sun.xml.bind.v2.runtime.property.AttributeProperty.serializeAttributes(AttributeProperty.java:97)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeAttributes(ClassBeanInfoImpl.java:353)
        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:591)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:324)
        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
        at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:315)
        at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:244)
        at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:74)
        at com.sun.jersey.json.impl.JSONMarshallerImpl.marshal(JSONMarshallerImpl.java:73)
        at com.sun.jersey.core.impl.provider.entity.XMLListElementProvider.writeList(XMLListElementProvider.java:130)
        at com.sun.jersey.core.provider.jaxb.AbstractListElementProvider.writeTo(AbstractListElementProvider.java:162)
        at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:266)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:814)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:740)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:731)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:372)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:452)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:633)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)