dkuspawono / google-plugin-for-eclipse

Automatically exported from code.google.com/p/google-plugin-for-eclipse
Eclipse Public License 1.0
0 stars 0 forks source link

Endpoints Broken in SDK 1.8.2 #225

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I switched from 1.8.1 to 1.8.2 and my Eclipse starting throwing an error.
2. The error thrown is:

java.lang.reflect.InvocationTargetException
    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:601)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createSwarmApi(SwarmApiCreator.java:186)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:475)
    at com.google.gdt.eclipse.appengine.swarm.wizards.HandleGaeProjectChange.gaeProjectRebuilt(HandleGaeProjectChange.java:75)
    at com.google.appengine.eclipse.core.properties.ui.CloudEndpointsBuilder.build(CloudEndpointsBuilder.java:98)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.NullPointerException
    at com.google.appengine.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:193)
    at com.google.api.server.spi.config.ResourcePropertySchema.of(ResourcePropertySchema.java:38)
    at com.google.api.server.spi.tools.JacksonResourceSchemaProvider.getResourceSchema(JacksonResourceSchemaProvider.java:40)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanProperties(AnnotationApiConfigGenerator.java:633)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanTypeToSchema(AnnotationApiConfigGenerator.java:619)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToSchema(AnnotationApiConfigGenerator.java:604)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToNode(AnnotationApiConfigGenerator.java:683)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponseType(AnnotationApiConfigGenerator.java:493)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponse(AnnotationApiConfigGenerator.java:479)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethod(AnnotationApiConfigGenerator.java:349)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:320)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:307)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfigObjects(AnnotationApiConfigGenerator.java:168)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfig(AnnotationApiConfigGenerator.java:102)
    ... 20 more
Root exception:
java.lang.NullPointerException
    at com.google.appengine.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:193)
    at com.google.api.server.spi.config.ResourcePropertySchema.of(ResourcePropertySchema.java:38)
    at com.google.api.server.spi.tools.JacksonResourceSchemaProvider.getResourceSchema(JacksonResourceSchemaProvider.java:40)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanProperties(AnnotationApiConfigGenerator.java:633)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanTypeToSchema(AnnotationApiConfigGenerator.java:619)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToSchema(AnnotationApiConfigGenerator.java:604)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToNode(AnnotationApiConfigGenerator.java:683)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponseType(AnnotationApiConfigGenerator.java:493)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponse(AnnotationApiConfigGenerator.java:479)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethod(AnnotationApiConfigGenerator.java:349)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:320)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:307)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfigObjects(AnnotationApiConfigGenerator.java:168)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfig(AnnotationApiConfigGenerator.java:102)
    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:601)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createSwarmApi(SwarmApiCreator.java:186)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:475)
    at com.google.gdt.eclipse.appengine.swarm.wizards.HandleGaeProjectChange.gaeProjectRebuilt(HandleGaeProjectChange.java:75)
    at com.google.appengine.eclipse.core.properties.ui.CloudEndpointsBuilder.build(CloudEndpointsBuilder.java:98)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:726)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What is the expected output? What do you see instead?

I expect it create the apis as normal. It throws the exception.

What version of the product are you using? On what operating system?

1.8.1 SDK and 1.8.2 SDK on Mac OS and Eclipse Keplar

Original issue reported on code.google.com by shaunc...@gmail.com on 17 Jul 2013 at 7:49

GoogleCodeExporter commented 8 years ago
are you still seeing this problem?

Original comment by rdayal@google.com on 18 Jul 2013 at 6:44

GoogleCodeExporter commented 8 years ago

Original comment by rdayal@google.com on 18 Jul 2013 at 6:45

GoogleCodeExporter commented 8 years ago
shaunc869, could you please detail the steps you performed (after installing 
1.8.2 and restarting Eclipse) that triggered this exception?

Original comment by nhcohen@google.com on 18 Jul 2013 at 6:55

GoogleCodeExporter commented 8 years ago
I literally just switched the app engine version in my project preferences and 
it re-built it automatically as always and that was it. It still ran of course, 
I also tried to run the project and checked the discovery paths with no success.

In addition I tried to right click and generate, but this also failed.

Original comment by shaunc...@gmail.com on 18 Jul 2013 at 8:09

GoogleCodeExporter commented 8 years ago
So far, I am unable to reproduce this. What version of Eclipse and what version 
of GPE are you using?

Original comment by nhcohen@google.com on 19 Jul 2013 at 8:36

GoogleCodeExporter commented 8 years ago
Here you go, thanks for trying to help!

Original comment by shaunc...@gmail.com on 20 Jul 2013 at 12:20

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm experiencing same problem, but on other platform: Windows 7 64bit + Eclipse 
Indigo SR2 with JDK 1.7.0_17 later updated to JDK 1.7.0_25

This problem occurs only with appengine-java-sdk-1.8.2. When I switch back to 
appengine-java-sdk-1.8.1.1 everything is running as it should and my endpoint 
API works.

Here is entry from Eclipse error log:
java.lang.reflect.InvocationTargetException
    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:601)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createSwarmApi(SwarmApiCreator.java:186)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:475)
    at com.google.gdt.eclipse.appengine.swarm.wizards.HandleGaeProjectChange.gaeProjectRebuilt(HandleGaeProjectChange.java:75)
    at com.google.appengine.eclipse.core.properties.ui.CloudEndpointsBuilder.build(CloudEndpointsBuilder.java:98)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
    at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)
    at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.NullPointerException
    at com.google.appengine.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:193)
    at com.google.api.server.spi.config.ResourcePropertySchema.of(ResourcePropertySchema.java:38)
    at com.google.api.server.spi.tools.JacksonResourceSchemaProvider.getResourceSchema(JacksonResourceSchemaProvider.java:40)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanProperties(AnnotationApiConfigGenerator.java:633)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanTypeToSchema(AnnotationApiConfigGenerator.java:619)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToSchema(AnnotationApiConfigGenerator.java:604)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToNode(AnnotationApiConfigGenerator.java:683)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponseType(AnnotationApiConfigGenerator.java:493)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponse(AnnotationApiConfigGenerator.java:479)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethod(AnnotationApiConfigGenerator.java:349)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:320)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:307)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfigObjects(AnnotationApiConfigGenerator.java:168)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfig(AnnotationApiConfigGenerator.java:102)
    ... 22 more
Root exception:
java.lang.NullPointerException
    at com.google.appengine.repackaged.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:193)
    at com.google.api.server.spi.config.ResourcePropertySchema.of(ResourcePropertySchema.java:38)
    at com.google.api.server.spi.tools.JacksonResourceSchemaProvider.getResourceSchema(JacksonResourceSchemaProvider.java:40)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanProperties(AnnotationApiConfigGenerator.java:633)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addBeanTypeToSchema(AnnotationApiConfigGenerator.java:619)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToSchema(AnnotationApiConfigGenerator.java:604)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.addTypeToNode(AnnotationApiConfigGenerator.java:683)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponseType(AnnotationApiConfigGenerator.java:493)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertMethodResponse(AnnotationApiConfigGenerator.java:479)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethod(AnnotationApiConfigGenerator.java:349)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:320)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.convertApiMethods(AnnotationApiConfigGenerator.java:307)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfigObjects(AnnotationApiConfigGenerator.java:168)
    at com.google.api.server.spi.tools.AnnotationApiConfigGenerator.generateConfig(AnnotationApiConfigGenerator.java:102)
    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:601)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmApiCreator.createSwarmApi(SwarmApiCreator.java:186)
    at com.google.gdt.eclipse.appengine.swarm.wizards.helpers.SwarmServiceCreator.create(SwarmServiceCreator.java:475)
    at com.google.gdt.eclipse.appengine.swarm.wizards.HandleGaeProjectChange.gaeProjectRebuilt(HandleGaeProjectChange.java:75)
    at com.google.appengine.eclipse.core.properties.ui.CloudEndpointsBuilder.build(CloudEndpointsBuilder.java:98)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:513)
    at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:432)
    at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:305)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Original comment by jskie...@gmail.com on 23 Jul 2013 at 10:01

GoogleCodeExporter commented 8 years ago
Do you have a field marked with @JsonProperty that does not have a 
correspondingly named getter method? Please let me know whether this is the 
case, and whether adding the getter fixes the problem.

Original comment by nhcohen@google.com on 24 Jul 2013 at 8:56

GoogleCodeExporter commented 8 years ago
Okay this is it, I have written very simple endpoint with inner class as 
entity, when only field in this class (String name) has getter method, it works 
perfectly. When I comment out getter, beforementioned error occurs. Here is my 
code:

package com.example.endpoints;

import com.google.api.server.spi.config.Api;

@Api (name = "sample_endpoint")
public class SampleEndpoint
{
    public Entity get()
    {
        return new Entity();
    }

    public class Entity
    {
        public String message = "Validated ok.";
        public String getMessage() { return message; } // Comment this line to trigger exception
    }
}

Original comment by jskie...@gmail.com on 24 Jul 2013 at 10:00

GoogleCodeExporter commented 8 years ago
This happened to me too after upgrading to 1.8.2. I'm using maven and I also 
got ClassNotFoundException. I've resolved it by adding this to configuration. 
It's probably because I use different <outputDirectory /> in my <build />

<classes>${build.outputDirectory}</classes>

Then I got the NullPointerException which went away when I've added the missing 
getter for one of my return classes, it stopped. This didn't occur in 1.8.1. 
Better error message would be great.

Original comment by tadeas.k...@gmail.com on 25 Jul 2013 at 2:09

GoogleCodeExporter commented 8 years ago
This was a bug that was introduced in 1.8.2 and will be fixed in 1.8.3. In the 
meantime, adding the missing getter method (or removing the @JsonProperty 
annotation) should eliminate the NullPointerException.

Original comment by nhcohen@google.com on 25 Jul 2013 at 8:14