How to change the version of Jetty in my Google App Engine - google-app-engine

Within IntelliJ I have a Google App Engine Standard Local Server running. I'm in the process of updating to Java 17 and also all of my 3rd party libraries and have moved to Jetty 11.0.11 in all of my project's pom files. However, when I start up the server I see:
INFO:oejs.Server:main: jetty-9.4.46.v20220331
and I'm getting failures that seem to confirm the above, that an older version of Jetty is being used.
Where can I update the Jetty version that the app engine uses?
Also, I'm using Google appengine 2.0.5
Here's the stack trace. The latest versions should be using jakarta.ws.rs.Path instead of javax.
java.lang.TypeNotPresentException: Type javax.ws.rs.Path not present
at
java.base/sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:47)
at
java.base/sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:89)
at jdk.proxy2/jdk.proxy2.$Proxy2.value(Unknown Source) at
org.eclipse.jetty.annotations.AnnotationConfiguration.createServletContainerInitializerAnnotationHandlers(AnnotationConfiguration.java:579)
at
org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:343)
at
org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:498)
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:916)
at
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
at
org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:423) at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.server.Server.doStart(Server.java:387) at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
at
com.google.appengine.tools.development.jetty9.JettyContainerService.startContainer(JettyContainerService.java:366)

To update the Jetty version to the latest one, I would suggest updating the Cloud SDK to the latest version. Based on the documentation, the most recent release of Cloud SDK is version 395.0.0 (2022-07-26) and according to the release notes, the latest Java SDK version is 1.9.98 and latest Jetty version is 11.0.11
I would recommend trying to upgrade the Cloud SDK by following this documentation so the Jetty version is updated to the latest one.
EDIT: If you think it’s a valid feature request you may raise here with a clear description why you are thinking it’s a feature request. Good feature requests will solve common problems or enable new use cases.

Related

How to push the latest version of your web app using gcloud to make it live

I am currently working on a app that I am hosting on Google Cloud. I tried everything in the documentation but may have had the command 'default_expiration: "30d"' in the app.yaml file. I got rid of it but it won't let me push the latest version of my app to make it live. I tried everything I could think of such as 'gcloud app deploy --promote --stop-previous-version' but to no avail. How can I get the latest version of my code live using Google Cloud App Engine.
Cheers,
EDIT:
If I go to the latest version as 'www.version.app-name.appspot.com' it shows the latest version; however, in the App Engine Versions panel, it shows that version with 100% of traffic allocated to it even though when I go to 'www.app-name.appspot.com' it displays a very old version.
I tried deleting all the old versions on the App Engine Versions panel, including the version that is being displayed, and it still shows the old version when going to 'www.app-name.appspot.com' but going to the exact version number displays the correct version. The newest version shows 100% of traffic is being sent there.
Cheers,
It now magically works so I will post the steps I did. I managed to debug it and find out that the version with all the traffic according to the App Engine Version panel wasn't the version being displayed, so, I deleted all the old versions on the Version panel and then it still wasn't working. It was still the same error, that the newest version was not being displayed when visiting 'www.app-name.appspot.com' so I waited around half an hour and now it is displaying the correct version at the main address. See the question for more debugging information.
Cheers,

how do I delete multiple versions in an app on google cloud?

When I deploy a project I get this error
INVALID_ARGUMENT: Your app may not have more than 15 versions. Please delete one of the existing versions before trying to create a new version.
I also went to versions on google cloud and tried to delete it manually but it says you can not delete a version with traffic shares.
Please help, any advice are greatly appreciated
You'll need to keep one version (latest maybe?) and then migrate all traffic to it with the "Split Traffic" link here, away from all the other versions you want to delete.
Then you will be able to select and delete those versions since they no longer handle traffic.
Finally you deploy the new version (in fact you could do that as soon as you deleted enough versions to no longer see that error) and, if needed, migrate traffic to it.
Also see gcloud app deploy for options related to versioning and traffic migration right at deployment time which could help you prevent such situation in the future:
--promote
Promote the deployed version to receive all traffic.
True by default. To change the default behavior for your current
environment, run:
$ gcloud config set app/promote_by_default false
Overrides the default promote_by_default property value for this
command invocation. Use --no-promote to disable.
--stop-previous-version
Stop the previously running version when deploying a new version
that receives all traffic. Overrides the default
stop_previous_version property value for this command invocation.
Use --no-stop-previous-version to disable.
--version=VERSION, -v VERSION
The version of the app that will be created or replaced by this
deployment. If you do not specify a version, one will be generated for
you.

Is Salesforce endpoint version the same globally?

Salesforce offers an endpoint to know which version is available but doesn't mention if the latest version is available globally or locally, on the requested instance.
For example, the latest version on eu6 is 37 but is it the same globally and can I use the version 37 by hard coding it in my code or everytime a new customer create an account, I need to store the latest version available for his instance region ?
The version endpoint is not global it only applies to the one instance you asked on (eu6 in your example). You should build an integration against a specific version. Worst case latest version -1 is available everywhere, so you could build an integration once today against v36 and it will work for all users of salesforce.

google app engine: how to run different version

Suppose I uploaded another version (say, "version: 2" in file app.yaml ) of my Google App Engine application. Version 1 is still the default and version 2 is for testing. How do I run it then?
Once you upload a version on Appengine, you can switch between them easily.
Say that your app name is myapp, currently running version 1. You also have uploaded a version called 2-testing. Your default app (with version 1) can be reached by accessing myapp.appspot.com
If you wanted to access your versions explicitly, you joust need to access <version_name>-dot-myapp.appspot.com. Following the example it would be:
1-dot-myapp.appspot.com or 2-testing-dot-myapp.appspot.com
The -dot- is equivalent to <version>.<appname> but allows you to correctly serve a secure application with SSL
You can mark any version you want as default (serving myapp.appspot.com) using the admin console
edit: this is the official documentation page talking about domains and subdomains in Appengine
Under versions in your admin console you can find the live uri of a version, if you select the version.
And you can use traffic splitting, where you can use your own client ip or a cookie to test a version.
Docs: https://developers.google.com/appengine/docs/adminconsole/trafficsplitting

IOException: Changed index specification

I am developing a GWT 2.5.1 and GAE/J 1.7.6 web app using Eclipse Juno/Google Plugin for Eclipse, and I am experimenting with the Search API. After an upgrade to the 1.7.6 GAE SDK the following started happening:
When the app is running in GAE Dev Mode and my index is populated,
it's subsequently programmatically accessible.
If the Dev Mode is
terminated and started again, programmatic access attempts fail (no results returned) as
follows:
SEVERE: Failed to access index
java.io.IOException: Changed index specification for description_index
at com.google.appengine.api.search.dev.LuceneDirectoryMap.getDirectory(LuceneDirectoryMap.java:198)
at com.google.appengine.api.search.dev.LuceneDirectoryMap$FileBased.getDirectory(LuceneDirectoryMap.java:64)
at com.google.appengine.api.search.dev.LocalSearchService.search(LocalSearchService.java:438)
Since the Search API is in development I would much rather use the SDK with the latest bugfixes and improvements. Does anyone have any suggestions regarding the cause of the exception?
Update
Fixed in App Engine SDK for Java release 1.7.7.1, available from the App Engine Downloads page.
Fix released in 1.7.7.1 SDK for Java. See here
Today, we found the same problem, our only possible fix on this moment was to change the appengine sdk for version 1.7.5 / 1.7.4.
I suppose there are significant changes coming, but until they're stable, we should not use or depend on it.
An issue has been opened for this in Google Code:
https://code.google.com/p/googleappengine/issues/detail?id=9088
If you believe this problem is important for you, and the workaround is not sufficient, then make sure to star the issue so that it gets escalated for repair.

Resources