{"action":"created","issue":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/564","labels_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/564/labels{/name}","comments_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/564/comments","events_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/564/events","html_url":"https://github.com/chrsmith/google-api-java-client/issues/564","id":59406741,"number":564,"title":"Using batch with google-calendar api causes NullPointerException","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Milestone-Version1.11.0","name":"Milestone-Version1.11.0","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-01T17:15:15Z","updated_at":"2015-03-01T17:15:16Z","closed_at":"2015-03-01T17:15:15Z","body":"```\nVersion of google-api-java-client: \ngoogle-api-client-1.10.3-beta\n\n\nJava environment: JEE6\n\n\nDescribe the problem.\nUsing batch with google-calendar api causes NullPointerException :\n\npublic class Constants {\n\t\n\t /** Global instance of the HTTP transport. */\n\t  public static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();\n\n\t  /** Global instance of the JSON factory. */\n\t  public static final JsonFactory JSON_FACTORY = new JacksonFactory();\n\t//...\n}\n@Stateless\npublic class GetCalendarList {\n\t\n\t\n\tpublic List<CalendarListEntry> getCalendarList() {  \n\t//...\n\t\ncom.google.api.services.calendar.Calendar calendarService = \ncom.google.api.services.calendar.Calendar\n\t\t\t\t\t\t.builder(Constants.HTTP_TRANSPORT, Constants.JSON_FACTORY).setHttpRequestInitializer(credential).build();\n\t\t\t\t\n\t\t\t\tCalendarList feed = null;\n\t\t\t\tEvents events = null;\n\t\t\t\t\n\t\t\tfeed = calendarService.calendarList().list().execute();\t\n\t\t\t\t\n\t\t\tList<CalendarListEntry> calendarList = feed.getItems();\t\n\t\t\tfinal List<Events> eventsList = new LinkedList<Events>();\t\n\n\t\t\tBatchRequest batch = calendarService.batch();\n\t\t\t\n\t\t\tJsonBatchCallback<Events> callback = new JsonBatchCallback<Events>() {\n\n\t\t        public void onSuccess(Events content, GoogleHeaders responseHeaders) {\n\t\t            System.out.println(\"Success\");\n\t\t            eventsList.add(content);\n\t\t        }\n\n\t\t        public void onFailure(GoogleJsonError e, GoogleHeaders responseHeaders) {\n\t\t        System.out.println(e.getMessage());\n\t\t        }\n\t\t    };\n\t\t\t\t\t \n\t\t\tfor(CalendarListEntry e : calendarList){\n\t\t\t\t\tSystem.out.println(e.getSummary()+\" id:\"+e.getId());\n\t\t\t\t\tcalendarService.events().list(e.getId()).queue(batch, callback);\n\t\t\t}\n\t\t\t\n\t\t\tbatch.execute(); //(GetCalendarList.java:123)\n\t\t\t\n\t\t//...\n\t\t}\n\t}\n\nEverything is working fine except \"batch.execute(); \n//(GetCalendarList.java:123)\" causing:\n\njava.lang.NullPointerException\n\tat com.google.api.client.googleapis.batch.BatchUnparsedResponse.getParsedDataClass(BatchUnparsedResponse.java:202)\n\tat com.google.api.client.googleapis.batch.BatchUnparsedResponse.parseAndCallback(BatchUnparsedResponse.java:186)\n\tat com.google.api.client.googleapis.batch.BatchUnparsedResponse.parseNextResponse(BatchUnparsedResponse.java:136)\n\tat com.google.api.client.googleapis.batch.BatchRequest.execute(BatchRequest.java:222)\n\tat ba.test.calendercommunication.GetCalendarList.getCalendarList(GetCalendarList.java:123)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n\tat java.lang.reflect.Method.invoke(Method.java:597)\n\tat org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1052)\n\tat org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1124)\n\tat com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5388)\n\tat com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:619)\n\tat com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:800)\n\tat com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:571)\n\tat com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doAround(SystemInterceptorProxy.java:162)\n\tat com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:144)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n\n...\n\nHow would you expect it to be fixed?\n\nPerhaps error in this class? Anything wrong with using this code in JEE? I have \nno idea...\n\nhttp://code.google.com/p/google-api-java-client/source/browse/google-api-client/\nsrc/main/java/com/google/api/client/googleapis/batch/BatchUnparsedResponse.java?\nr=e5756266c20aa39b5ac8623e0f36685b09486cd4\n```\n\nOriginal issue reported on code.google.com by `Marian.F...@googlemail.com` on 18 Jul 2012 at 2:16"},"comment":{"url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/comments/76615202","html_url":"https://github.com/chrsmith/google-api-java-client/issues/564#issuecomment-76615202","issue_url":"https://api.github.com/repos/chrsmith/google-api-java-client/issues/564","id":76615202,"user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"created_at":"2015-03-01T17:15:16Z","updated_at":"2015-03-01T17:15:16Z","body":"```\nWontFix is probably more appropriate here.\n```\n\nOriginal comment by `rmis...@google.com` on 31 Jul 2012 at 2:09\n* Changed state: **WontFix**"}}