If GAE library containers cannot be initialized it leads to error
When Eclipse launches and tries to read the persisted container information to initialize the GAE library containers (AE API, Endpoints API, Objectify), but the container information cannot be read from the disk, then it will give a build error since the container is unresolved.
This happens when com.google.cloud.tools.eclipse.appengine.libraries.persistence.LibraryClasspathContainerSerializer.loadContainer(IJavaProject, IPath) returns null and the container is not resolved in com.google.cloud.tools.eclipse.appengine.libraries.AppEngineLibraryContainerInitializer.initialize(IPath, IJavaProject).
To fix this, if a container information cannot be read from disk, we should trigger the same resolution process as we do e.g. when we initially resolve the containers when creating the project.
What's the root cause here? Does this happen when the user has deleted/moved some files outside the project from their local filesystem?
The way I noticed this was due to an error I made while working on the async source downloading and accidentally truncated the container state files. But yes, it can also happen if the user deletes/moves these state files, or due to us making a mistake and change the name of the plugin (which results in a different folder to be used to the files) or making some changes to the deserialization process that leads to error when reading older state files. I won't consider this issue critical due to hopefully small chance of it happening, but if it happens, fixing it is rather tedious.
I just installed Eclipse (version 2022-12/4.26.0) and tried to create a new "standard" AppEngine project. I got this same error: this.serializer is null
Also here: https://issueantenna.com/repo/googlecloudplatform/google-cloud-eclipse/issues/3667
The project was created but shows 65 errors, all of which appear to be missing symbols from the libraries (e.g. Cookie, HttpServlet, ObjectifyFilter, etc).
!project.creation.failed!: Cannot invoke "com.google.cloud.tools.eclipse.appengine.libraries.persistence.LibraryClasspathContainerSerializer.loadContainer(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IPath)" because "this.serializer" is null
Cannot invoke "com.google.cloud.tools.eclipse.appengine.libraries.persistence.LibraryClasspathContainerSerializer.loadContainer(org.eclipse.jdt.core.IJavaProject, org.eclipse.core.runtime.IPath)" because "this.serializer" is null