GAE Flexible Environment Service error in memcache - google-app-engine

I use jetty9-compat + java8 configuration and receive the following exception. Probably because of this I am not able to store objects in session, so in the end I cannot log in to my service.
[INFO] cze 28, 2016 11:17:56 AM com.google.apphosting.vmruntime.VmMetadataCache getMetadata
[INFO]
[INFO] INFO: Meta-data 'attributes/gae_affinity' path retrieval error: metadata
[INFO]
[INFO] cze 28, 2016 11:17:56 AM com.google.apphosting.vmruntime.VmApiProxyDelegate runSyncCall
[INFO]
[INFO] INFO: HTTP ApiProxy I/O error for memcache.Get: The target server failed to respond
[INFO]
[INFO] cze 28, 2016 11:17:56 AM com.google.appengine.api.memcache.LogAndContinueErrorHandler handleServiceError
[INFO]
[INFO] INFO: Service error in memcache
[INFO]
[INFO] com.google.appengine.api.memcache.MemcacheServiceException: RCP Failure for API call: memcache Get
[INFO]
[INFO] at com.google.apphosting.vmruntime.VmApiProxyDelegate.constructApiException(VmApiProxyDelegate.java:232)
[INFO]
[INFO] at com.google.apphosting.vmruntime.VmApiProxyDelegate.runSyncCall(VmApiProxyDelegate.java:195)
[INFO]
[INFO] at com.google.apphosting.vmruntime.VmApiProxyDelegate.makeApiCall(VmApiProxyDelegate.java:154)
[INFO]
[INFO] at com.google.apphosting.vmruntime.VmApiProxyDelegate.access$000(VmApiProxyDelegate.java:60)
[INFO]
[INFO] at com.google.apphosting.vmruntime.VmApiProxyDelegate$MakeSyncCall.call(VmApiProxyDelegate.java:436)
[INFO]
[INFO] at com.google.apphosting.vmruntime.VmApiProxyDelegate$MakeSyncCall.call(VmApiProxyDelegate.java:412)
[INFO]
[INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO]
[INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[INFO]
[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[INFO]
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO]
[INFO]
[INFO]
[INFO] DEBUG 2016-06-28 11:17:56,493 api_server.py:277] Handled datastore_v3.Get in 0.0000
[INFO] cze 28, 2016 11:17:59 AM com.mysql.jdbc.log.Slf4JLogger logInfo

This issue is reproduced only locally, I face it too. I assume that it is caused by incorrect configuration of local memcached which is run by dev server.
I'll try to explain my point. In my case first request is always successful.
Because in case of first request Apache HttpClient opens a new connection and puts it into the pool.
There is source code https://github.com/GoogleCloudPlatform/appengine-java-vm-runtime/blob/master/appengine-managed-runtime/src/main/java/com/google/apphosting/vmruntime/VmApiProxyDelegate.java
All further requests are successful too, if they are executed with interval up to 10 seconds. But if there were no request within 10 seconds, next request fails.
It happens because memcached service closes connection from its side, but HttpClient doesn't know about it.
In VmApiProxyDelegate HttpClient is configured to close idle connections after 60 seconds. So, if I wait more than 1 minute instead of 10 seconds, my next request doesn't fail. Because in this case HttpClient opens new connection which is not closed yet.
To avoid this issue it would be correct to configure connection timeout from memcached stub side. But the documentation says that your requests to memcached can fail and you must handle these errors. So, I offer you to add error handler and some retry mechanism.
Of course all of the above fits your case, if everything is ok in your configuration. Taking into account that you did not provide examples of configuration and code, I assume that there everything is ok.

Related

Akka Http read entity fails with Substream Source cannot be materialized more than once

When I am trying to consume the data on server into memory and later I want to create strict entity with it, but getting Substream Source cannot be materialized more than once error message.
As far as I know I am not consuming the data from the request more than once (from application layer not investigated akka-http library layer). Requests are successful with small chunk of data, failing with bigger (around 10 KB) chunk of data
First try:
if (!entity.isChunked()) {
entity.dataBytes.runFold(ByteString.empty)(_ ++ _).flatMap { encryptedBody =>
decrypt(encryptedBody).map { decrypted =>
HttpEntity(decrypted)
}
}
}
also tried following (suggestion in Akka http -ERROR :Substream Source cannot be materialized more than once If Payload size increased) but no luck
Second try (with strict):
entity.toStrict(4.seconds).flatMap { strictEntity =>
decrypt(strictEntity.data).map { decrypted =>
HttpEntity(decrypted)
}
}
AkkaHttp Version: 10.0.13 ( We are in the process of migrating to latest version, we are kind of stuck with older version)
Akka Version : 2.4.20
Any kind of help would be great.
Stack trace is:
[info] java.lang.IllegalStateException: Substream Source cannot be materialized more than once
[info] at akka.stream.impl.fusing.SubSource$$anon$4.setCB(StreamOfStreams.scala:725)
[info] at akka.stream.impl.fusing.SubSource$$anon$4.preStart(StreamOfStreams.scala:735)
[info] at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:520)
[info] at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:380)
[info] at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:538)
[info] at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:586)
[info] at akka.actor.Actor$class.aroundPreStart(Actor.scala:510)
[info] at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:529)
[info] at akka.actor.ActorCell.create(ActorCell.scala:590)
[info] at akka.actor.ActorCell.invokeAll$1_aroundBody2(ActorCell.scala:461)
[info] at akka.actor.ActorCell$AjcClosure3.run(ActorCell.scala:1)
[info] at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
[info] at akka.kamon.instrumentation.ActorSystemMessageInstrumentation$$anonfun$aroundSystemMessageInvoke$1.apply(ActorSystemMessageInstrumentation.scala:34)
[info] at kamon.trace.Tracer$.withContext(TracerModule.scala:58)
[info] at akka.kamon.instrumentation.ActorSystemMessageInstrumentation.aroundSystemMessageInvoke(ActorSystemMessageInstrumentation.scala:34)
[info] at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:1)
[info] at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
[info] at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
[info] at akka.dispatch.Mailbox.run(Mailbox.scala:223)
[info] at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
[info] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[info] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
[info] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
[info] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Failing because the entity was read more than once.
In the beginning, I could not figure it out because the reading was happening at the time validation, and it is deeply buried in the validations. (one of the validation depends on body content)
I tried strict entity conversion after the validations, so it did not work out.

gcloud-java authentication datastore (upgrade to v1beta3 in 0.1.7/0.2.0)

I had a java GAE application running using gcloud-java 0.1.4 for some time and wanted to upgrade to gcloud-java 0.1.7/0.2.0, as we are experiences several 404s etc. (another problem). We are using gcloud as we connect to a datastore instance in another GAE application.
But after upgrading the package, our authentication fails. From what I read in release notes, we had to re-enable the datastore-api on the "host" application, so we did but without any results. When "downgrading" again, the application works as intended but still with some stability issues.
Are there other undocumented fixes/methods to get it to work?
My connection code/function looks like (stripped):
fis = new FileInputStream(Constants.PATH_TO_JSON_KEY);
sac = AuthCredentials.createForJson(fis);
DatastoreOptions.Builder builder = DatastoreOptions.builder();
builder.projectId(Constants.DATASTORE_PROJECT_ID);
builder.authCredentials(sac);
DatastoreOptions options = builder.build();
return options.service();
EDIT:
Here are the some of the stack traces that I get.
[INFO] apr 17, 2016 6:19:33 PM com.google.datastore.v1beta3.client.DatastoreFactory makeClient
[INFO] com.google.cloud.datastore.DatastoreException: Not authorized.
[INFO] at com.google.cloud.datastore.spi.DefaultDatastoreRpc.translate(DefaultDatastoreRpc.java:102)
[INFO] at com.google.cloud.datastore.spi.DefaultDatastoreRpc.runQuery(DefaultDatastoreRpc.java:157)
[INFO] at com.google.cloud.datastore.DatastoreImpl$1.call(DatastoreImpl.java:92)
[INFO] at com.google.cloud.datastore.DatastoreImpl$1.call(DatastoreImpl.java:89)
[INFO] at com.google.cloud.RetryHelper.doRetry(RetryHelper.java:181)
[INFO] at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:247)
[INFO] at com.google.cloud.RetryHelper.runWithRetries(RetryHelper.java:237)
[INFO] at com.google.cloud.datastore.DatastoreImpl.runQuery(DatastoreImpl.java:88)
[INFO] at com.google.cloud.datastore.QueryResultsImpl.sendRequest(QueryResultsImpl.java:73)
[INFO] at com.google.cloud.datastore.QueryResultsImpl.<init>(QueryResultsImpl.java:57)
[INFO] at com.google.cloud.datastore.DatastoreImpl.run(DatastoreImpl.java:82)
[INFO] at com.google.cloud.datastore.DatastoreImpl.run(DatastoreImpl.java:73)
.....
[INFO] Caused by: com.google.datastore.v1beta3.client.DatastoreException: Not authorized., code=PERMISSION_DENIED
[INFO] at com.google.datastore.v1beta3.client.RemoteRpc.makeException(RemoteRpc.java:126)
[INFO] at com.google.datastore.v1beta3.client.RemoteRpc.makeException(RemoteRpc.java:169)
[INFO] at com.google.datastore.v1beta3.client.RemoteRpc.call(RemoteRpc.java:89)
[INFO] at com.google.datastore.v1beta3.client.Datastore.runQuery(Datastore.java:108)
[INFO] at com.google.cloud.datastore.spi.DefaultDatastoreRpc.runQuery(DefaultDatastoreRpc.java:155)
[INFO] ... 56 more
Thanks for reporting this issue. I have a couple of follow up questions so that we can get to the bottom of this:
Does the project ID you set (Constants.DATASTORE_PROJECT_ID) contain any prefixes with a tilde, perhaps "s~" or "e~"? Datastore v1beta3 no longer accepts those prefixes; instead you should provide everything after the tilde as your project ID. For example, if your project ID is s~my-project-id-123, you should use just my-project-id-123. This might be the issue if you see an error message similar to:
com.google.datastore.v1beta3.client.DatastoreFactory makeClient: Not using any credentials
com.google.cloud.datastore.DatastoreException: The project s~my-project-id-123 does not exist.
If that isn't the issue, do you mind providing a stack trace and a copy of the exception text (removing confidential information as necessary). Thanks!
The service account we were using wasnt set setup with the appropriate permissions in the destination application. So we had (from advice from google) re-add the service account as a viewer here: https://console.cloud.google.com/permissions/projectpermissions
I hope this can help others in the future!

Permission denied error in app engine code

I am getting the below error in the line 5 while executing the app engine code in localhost and in cloud.
1 HttpClient client = new HttpClient();
2 GetMethod getMethod =new GetMethod(url);
3 client.getHttpConnectionManager().getParams()
4 .setConnectionTimeout(1000);
5 int response = client.executeMethod(getMethod);
I am seeing this error while running the job in localhost and in app engine.
Please find the error logs below:
INFO] 2016-03-07 11:04:03 DEBUG HttpConnection:1215 - enter HttpConnection.closeSockedAndStreams()
[INFO] 2016-03-07 11:04:03 INFO HttpMethodDirector:439 - I/O exception (java.net.SocketException) caught when processing request: Permission denied: Not allowe
d to issue a socket bind: permission denied.
[INFO] 2016-03-07 11:04:03 DEBUG HttpMethodDirector:443 - Permission denied: Not allowed to issue a socket bind: permission denied.
[INFO] java.net.SocketException: Permission denied: Not allowed to issue a socket bind: permission denied.
[INFO] at com.google.appengine.api.socket.SocketApiHelper.translateError(SocketApiHelper.java:95)
[INFO] at com.google.appengine.api.socket.SocketApiHelper.translateError(SocketApiHelper.java:106)
[INFO] at com.google.appengine.api.socket.SocketApiHelper.makeSyncCall(SocketApiHelper.java:74)
[INFO] at com.google.appengine.api.socket.AppEngineSocketImpl.createSocket(AppEngineSocketImpl.java:470)
[INFO] at com.google.appengine.api.socket.AppEngineSocketImpl.bind(AppEngineSocketImpl.java:486)
[INFO] at java.net.Socket.bind(Socket.java:631)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:606)
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:130)
[INFO] at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:139)
[INFO] at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125)
[INFO] at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
[INFO] at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
[INFO] at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
[INFO] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
[INFO] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
[INFO] at com.disney.unityads.UnityAdsStats.downloadZip(UnityAdsStats.java:169)
[INFO] at com.disney.unityads.UnityAdsStats.run(UnityAdsStats.java:72)
[INFO] at com.disney.unityads.UnityAdsChannelJobWorker.doPost(UnityAdsChannelJobWorker.java:46)
[INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
[INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[INFO] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
[INFO] at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
Check the documentation for how to make HTTP requests. AppEngine is a very limited environment, for example if you try to use an alternative HTTP client your app gets the same treatment as one that tries to use sockets directly.
https://cloud.google.com/appengine/docs/java/urlfetch/

Javascript build fails

I tried to do a javascript build with an existing working project but it gives me a build error like below, any idea ?
The project is working for Android and IOS, I did the build without any changes of settings or whatever
Full stack Trace :
Executing: /home/ec2-user/jdk1.8.0_45/bin/java -Dretrolambda.inputDir=/tmp/build4395325875721494407xxx/tmpClasses -Dretrolambda.classpath=/tmp/build4395325875721494407xxx/tmpClasses:/tmp/temp6791530583283105825.jar -Dretrolambda.outputDir=/tmp/build4395325875721494407xxx/tmpClasses_retrolamda -Dretrolambda.bytecodeVersion=49 -jar /tmp/temp3309944789126593083.jar Retrolambda 2.0.3
Bytecode version: 49 (Java 5)
Default methods: false
Input directory: /tmp/build4395325875721494407xxx/tmpClasses
Output directory: /tmp/build4395325875721494407xxx/tmpClasses_retrolamda
Classpath: /tmp/build4395325875721494407xxx/tmpClasses:/tmp/temp6791530583283105825.jar
Executing: /home/ec2-user/javascript/apache-maven-3.2.5/bin/mvn -e clean package [INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for nl.aalease.apps:Main:war:1.0
[WARNING] 'dependencies.dependency.systemPath' for ca.weblite:codename1-core:jar should not point at files within the project directory, ${basedir}/lib/CodenameOne.jar will be unresolvable by dependent projects # line 24, column 25
[WARNING] 'dependencies.dependency.systemPath' for ca.weblite:codename1-factory:jar should not point at files within the project directory, ${basedir}/lib/Factory.jar will be unresolvable by dependent projects # line 32, column 25
[WARNING] 'dependencies.dependency.systemPath' for ca.weblite:codename1-core-hello:jar should not point at files within the project directory, ${basedir}/lib/app.jar will be unresolvable by dependent projects # line 40, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Main 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # Main ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # Main ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # Main ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 50 source files to /tmp/build4395325875721494407xxx/target/classes
[WARNING] /tmp/build4395325875721494407xxx/src/main/java/com/codename1/impl/html5/Stub.java: /tmp/build4395325875721494407xxx/src/main/java/com/codename1/impl/html5/Stub.java uses or overrides a deprecated API.
[WARNING] /tmp/build4395325875721494407xxx/src/main/java/com/codename1/impl/html5/Stub.java: Recompile with -Xlint:deprecation for details.
[WARNING] /tmp/build4395325875721494407xxx/src/main/java/com/codename1/teavm/ext/localforage/LocalForage.java: Some input files use unchecked or unsafe operations.
[WARNING] /tmp/build4395325875721494407xxx/src/main/java/com/codename1/teavm/ext/localforage/LocalForage.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # Main ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/build4395325875721494407xxx/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # Main ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # Main ---
[INFO] No tests to run.
[INFO]
[INFO] --- teavm-maven-plugin:0.3.0-cn1-039:build-javascript (web-client) # Main ---
[INFO] Preparing classpath for JavaScript generation
[INFO] Using the following classpath for JavaScript generation: /tmp/build4395325875721494407xxx/lib/CodenameOne.jar:/tmp/build4395325875721494407xxx/lib/Factory.jar:/tmp/build4395325875721494407xxx/lib/app.jar:/home/ec2-user/.m2/repository/org/teavm/teavm-classlib/0.3.0-cn1-039/teavm-classlib-0.3.0-cn1-039.jar:/home/ec2-user/.m2/repository/org/teavm/teavm-platform/0.3.0-cn1-039/teavm-platform-0.3.0-cn1-039.jar:/home/ec2-user/.m2/repository/org/teavm/teavm-core/0.3.0-cn1-039/teavm-core-0.3.0-cn1-039.jar:/home/ec2-user/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/ec2-user/.m2/repository/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.jar:/home/ec2-user/.m2/repository/com/carrotsearch/hppc/0.6.1/hppc-0.6.1.jar:/home/ec2-user/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar:/home/ec2-user/.m2/repository/com/jcraft/jzlib/1.1.3/jzlib-1.1.3.jar:/home/ec2-user/.m2/repository/joda-time/joda-time/2.7/joda-time-2.7.jar:/home/ec2-user/.m2/repository/org/teavm/teavm-jso/0.3.0-cn1-039/teavm-jso-0.3.0-cn1-039.jar:/home/ec2-user/.m2/repository/org/teavm/teavm-dom/0.3.0-cn1-039/teavm-dom-0.3.0-cn1-039.jar:/home/ec2-user/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar:/home/ec2-user/.m2/repository/org/mitre/dsmiley/httpproxy/smiley-http-proxy-servlet/1.6/smiley-http-proxy-servlet-1.6.jar:/home/ec2-user/.m2/repository/org/apache/httpcomponents/httpclient/4.3.4/httpclient-4.3.4.jar:/home/ec2-user/.m2/repository/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar:/home/ec2-user/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/home/ec2-user/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar:/tmp/build4395325875721494407xxx/target/classes
[INFO] Building JavaScript file
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:16 min
[INFO] Finished at: 2016-02-09T05:28:02-05:00
[INFO] Final Memory: 17M/839M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.teavm:teavm-maven-plugin:0.3.0-cn1-039:build-javascript (web-client) on project Main: Unexpected error occured: -1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.teavm:teavm-maven-plugin:0.3.0-cn1-039:build-javascript (web-client) on project Main: Unexpected error occured
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unexpected error occured
at org.teavm.maven.BuildJavascriptMojo.execute(BuildJavascriptMojo.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(ArrayList.java:400)
at java.util.ArrayList.get(ArrayList.java:413)
at org.teavm.javascript.Renderer.visitStatements(Renderer.java:2035)
at org.teavm.javascript.Renderer.visit(Renderer.java:931)
at org.teavm.javascript.ast.ConditionalStatement.acceptVisitor(ConditionalStatement.java:48)
at org.teavm.javascript.Renderer.visitStatements(Renderer.java:2035)
at org.teavm.javascript.Renderer.visit(Renderer.java:1059)
at org.teavm.javascript.ast.BlockStatement.acceptVisitor(BlockStatement.java:34)
at org.teavm.javascript.Renderer.visitStatements(Renderer.java:2032)
at org.teavm.javascript.Renderer.visit(Renderer.java:1059)
at org.teavm.javascript.ast.BlockStatement.acceptVisitor(BlockStatement.java:34)
at org.teavm.javascript.Renderer.visitStatements(Renderer.java:2032)
at org.teavm.javascript.Renderer.visit(Renderer.java:910)
at org.teavm.javascript.ast.SequentialStatement.acceptVisitor(SequentialStatement.java:34)
at org.teavm.javascript.Renderer$MethodBodyRenderer.visit(Renderer.java:752)
at org.teavm.javascript.ast.AsyncMethodNode.acceptVisitor(AsyncMethodNode.java:51)
at org.teavm.javascript.Renderer.renderBody(Renderer.java:604)
at org.teavm.javascript.Renderer.renderMethodBodies(Renderer.java:404)
at org.teavm.javascript.Renderer.render(Renderer.java:302)
at org.teavm.vm.TeaVM.build(TeaVM.java:441)
at org.teavm.tooling.TeaVMTool.generate(TeaVMTool.java:299)
at org.teavm.maven.BuildJavascriptMojo.execute(BuildJavascriptMojo.java:256)
... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
That seems to be an issue with the current implementation of TeaVM that we are using for the JavaScript port.
We are in the process of updating the VM to the latest version which will hopefully resolve that issue.
I've added an issue to our issue tracker to track the status more effectively.

GAE : javax.security.auth.Subject.getSubject() cannot be invoked on local dev server

If I start my local google app engine dev server by using the App Engine maven plugin :
mvn appengine:devserver
and I try to launch a mapreduce job (using the appengine-mapreduce library), I get a java.security.AccessControlException: access denied ("javax.security.auth.AuthPermission" "getSubject") because the code try to invoke javax.security.auth.Subject.getSubject() method (see below for the full stack trace)
It's very weird because :
1) the javax.security.auth.Subject.getSubject() is in the white list of gae and can be invoked
2) If I start the server from intellij, I don't get this exception and the map reduce job is launched successfully
I tried with GAE 1.8.1, 1.8.2 and the latest 1.8.3 and respectively the same version for the maven google appengine plugin.
What is going wrong ?
The full stack trace :
[INFO] java.security.AccessControlException: access denied ("javax.security.auth.AuthPermission" "getSubject")
[INFO] at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
[INFO] at java.security.AccessController.checkPermission(AccessController.java:560)
[INFO] at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
[INFO] at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:383)
[INFO] at javax.security.auth.Subject.getSubject(Subject.java:287)
[INFO] at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:467)
[INFO] at org.apache.hadoop.mapreduce.JobContext.(JobContext.java:80)
[INFO] at com.google.appengine.tools.mapreduce.AppEngineJobContext.(AppEngineJobContext.java:123)
[INFO] at com.google.appengine.tools.mapreduce.AppEngineJobContext.createContextForNewJob(AppEngineJobContext.java:132)
[INFO] at com.google.appengine.tools.mapreduce.v2.impl.handlers.Controller.handleStart(Controller.java:85)
[INFO] at com.google.appengine.tools.mapreduce.v2.impl.handlers.Status.handleStartJob(Status.java:81)
[INFO] at com.google.appengine.tools.mapreduce.v2.impl.handlers.Status.handleCommand(Status.java:182)
[INFO] at com.google.appengine.tools.mapreduce.MapReduceServlet.doPost(MapReduceServlet.java:203)
[INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
[INFO] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[INFO] at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)

Resources