Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccessControlException is thrown on Google AppEngine while serializing object #326

Open
davseitsev opened this issue Jun 2, 2017 · 3 comments

Comments

@davseitsev
Copy link

There are some restrictions on Google AppEngine for using reflection.

com.fasterxml.jackson.module.scala.introspect.BeanIntrospector uses reflection to look up for constructor parameter names. Since v2.5.0 this operation is not wrapped into try/catch. Here is commit: 5b36c6b#commitcomment-22367246

It causes an exception in runtime. Full stack trace is here: jackson-app-engine-stack-trace.txt

Now we use v2.4.5 and it works fine for us.

@dsilvasc
Copy link

Is there a workaround other than registering a jackson module similar to DefaultScalaModule but without ScalaAnnotationIntrospectorModule? Something like this?

// avoid DefaultScalaModule (and ScalaAnnotationIntrospectorModule) per this bug:
// https://github.com/FasterXML/jackson-module-scala/issues/326
class AppengineScalaJacksonModule
    extends JacksonModule
    with IteratorModule
    with EnumerationModule
    with OptionModule
    with SeqModule
    with IterableModule
    with TupleModule
    with MapModule
    with SetModule
    // this one is private to package com.fasterxml.jackson.module.scala
    // with ScalaNumberDeserializersModule
    //
    // this one fails on appengine with:
    //  java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "getClassLoader")
    // https://github.com/FasterXML/jackson-module-scala/issues/326
    // with ScalaAnnotationIntrospectorModule
    with UntypedObjectDeserializerModule
    with EitherModule {
  override def getModuleName = "AppengineScalaJacksonModule"
}

What do we lose without ScalaAnnotationIntrospectorModule?

@pjfanning
Copy link
Member

the issue is with our dependency on paranamer - I had removed the the paranamer dependency in jackson-module-scala v2.12.0 but had to bring it back due to https://github.com/FasterXML/jackson-module-scala/pull/510/files -- these are possibly edge cases - it might be possible to make the paranamer dependency optional again so that Google AppEngine users can use jackson-module-scala without paranamer

@pjfanning
Copy link
Member

ScalaNumberDeserializersModule is now public (since v2.10.0, it seems)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants