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

App Engine Java 8 Runtime and Objenesis #51

Closed
ifigotin opened this issue May 24, 2017 · 12 comments
Closed

App Engine Java 8 Runtime and Objenesis #51

ifigotin opened this issue May 24, 2017 · 12 comments
Assignees
Milestone

Comments

@ifigotin
Copy link

I'm part of Google Cloud engineering team, and I'm looking into making sure that libraries relying on SpringBoot and Objenesis could run seamlessly on Google App Engine Java 8 runtime - our new runtime which is in Alpha at the moment.

We noticed that the reason that GAE is only partially supported by Objenesis is due to security restrictions.
In Java8 runtime the security restrictions are lifted off. Thus, it should be possible for Objenesis do what needs to be done when running within this new runtime.

As an example, we recently noticed that Springboot relies on ability to create Proxy objects for classes with no default constructor via Objenesis. However, Objenesis will detect GAE environment, and will use an instantiator that expects a default constructor. In GAE Java8 the use of this instantiator should no longer be necessary.

@henri-tremblay
Copy link
Contributor

Those are really good news. I need to tweak the strategy to be able to look for a working instantiator if the expected one fails. That would make Objenesis more robust on new platform.

How can I know that I'm on GAE 8? com.google.appengine.runtime.version == 8?

Also, I am willing to test it and officially validate the platform. But I will probably need Google Cloud Platform credits to do so.

@ifigotin
Copy link
Author

ifigotin commented May 24, 2017

You could simply check now if the SecurityManager is installed. I.e. check if "System.getSecurityManager()" returns null.

The other property you included will just contain the runtime version (e.g. 1.9.48), so it should not be used for this purpose.

Thank you for willing to test on the platform. Simply request to join the alpha program (as described here), and you should be able to deploy and test with this new runtime.

@henri-tremblay
Copy link
Contributor

Make sense. Will do that as soon as I can. Will also read Guillaume wisdom to sign for alpha :-)

@ludoch
Copy link

ludoch commented May 24, 2017

Salut Henri!
Yep, it is now an important bug for us (App Engine Standard Java8!) It's coming, and we now need to detect 2 different App Engine environments: the one you know targetting Java7 with restrictions, and the new Java8 without restrictions, so this new one should be treated as a normal standard JVM process...

@henri-tremblay
Copy link
Contributor

Bien le bonjour. Cool. I just did my request for alpha.

@ludoch
Copy link

ludoch commented May 24, 2017

Cool!
Whitelisted now.

@henri-tremblay
Copy link
Contributor

Thanks!

@henri-tremblay henri-tremblay self-assigned this May 24, 2017
@henri-tremblay henri-tremblay added this to the 2.6 milestone May 24, 2017
@ifigotin
Copy link
Author

Henri, you could also check for System.getProperty("java.specification.version"). For java8 runtime it should be "1.8" in production. My colleague pointed out that checking for SecurityManager may not be the best, since a java8 application could install its own SecurityManager now.
Thanks again.

@ludoch
Copy link

ludoch commented May 26, 2017 via email

@henri-tremblay
Copy link
Contributor

No problem. By the way, if needed there is a sub-module named gae in the objenesis source code. It is a simple webapp that can be deployed on GAE and runs the TCK when accessing the home page.

@saturnism
Copy link

thnx! what's the target release date for 2.6? and/or if there will be a 2.5.x minor release prior? (trying to figure out how to file an issue for Spring Framework to upgrade)

@henri-tremblay
Copy link
Contributor

No. Next version is 2.6. Should be out in 2-3 weeks. I'm on something else right now and I want to fix #52 as well. BTW, if someone from Google can help ;-) (cc @ludoch @ifigotin)

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

No branches or pull requests

4 participants