{"id":791,"date":"2015-03-04T10:25:04","date_gmt":"2015-03-04T15:25:04","guid":{"rendered":"http:\/\/shirishranjit.com\/blog1\/?page_id=791"},"modified":"2015-03-18T16:11:15","modified_gmt":"2015-03-18T20:11:15","slug":"google-appengine-and-datanucleus-enhance-java-lang-illegalargumentexception","status":"publish","type":"page","link":"https:\/\/shirishranjit.com\/blog1\/entertainment\/google-appengine-and-datanucleus-enhance-java-lang-illegalargumentexception","title":{"rendered":"Google AppEngine and DataNucleus Enhance &#8211; Encountered a problem: Unexpected exception"},"content":{"rendered":"<p>Google AppEngine and DataNucleus Enhance<\/p>\n<p>Problem:\u00a0\u00a0&#8211; Encountered a problem: Unexpected exception<\/p>\n<p>When developing in Google AppEngine with DataNucleus datastore, if you get following error when the DataNucleus is &#8220;Enhancing&#8221; the data access object (JDO, JPA), then your JDK compile version is not compatible with the DataNucleus. <strong>The DataNucleus is not supported for<em> JDK version 1.8 yet<\/em>. <\/strong>If you<strong> <em>change your compile JDK version to 1.7<\/em>, <\/strong>the problem is resolved.<\/p>\n<p><code><br \/>\nDataNucleus Enhancer (version 3.1.1) : Enhancement of classes<br \/>\nEncountered a problem: Unexpected exception<\/code><\/p>\n<p>java.lang.RuntimeException: Unexpected exception<br \/>\nat com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76)<br \/>\nat com.google.appengine.tools.enhancer.Enhance.(Enhance.java:71)<br \/>\nat com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:51)<br \/>\nCaused by: java.lang.reflect.InvocationTargetException<br \/>\nat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br \/>\nat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br \/>\nat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br \/>\nat java.lang.reflect.Method.invoke(Method.java:483)<br \/>\nat com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:74)<br \/>\n&#8230; 2 more<br \/>\nCaused by: java.lang.IllegalArgumentException<br \/>\nat org.objectweb.asm.ClassReader.(Unknown Source)<br \/>\nat org.objectweb.asm.ClassReader.(Unknown Source)<br \/>\nat org.objectweb.asm.ClassReader.(Unknown Source)<br \/>\nat org.datanucleus.enhancer.asm.ASMClassEnhancer.getClassNameForFileName(ASMClassEnhancer.java:272)<br \/>\nat org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:727)<br \/>\nat org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525)<br \/>\nat org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1258)<br \/>\n&#8230; 7 more<\/p>\n<div class=\"twttr_buttons\"><div class=\"twttr_twitter\">\n\t\t\t\t\t<a href=\"http:\/\/twitter.com\/share?text=Google+AppEngine+and+DataNucleus+Enhance+-+Encountered+a+problem%3A+Unexpected+exception\" class=\"twitter-share-button\" data-via=\"\" data-hashtags=\"\"  data-size=\"default\" data-url=\"https:\/\/shirishranjit.com\/blog1\/entertainment\/google-appengine-and-datanucleus-enhance-java-lang-illegalargumentexception\"  data-related=\"\" target=\"_blank\">Tweet<\/a>\n\t\t\t\t<\/div><div class=\"twttr_followme\">\n\t\t\t\t\t\t<a href=\"https:\/\/twitter.com\/shiranjit\" class=\"twitter-follow-button\" data-size=\"default\"  data-show-screen-name=\"false\"  target=\"_blank\">Follow me<\/a>\n\t\t\t\t\t<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Google AppEngine and DataNucleus Enhance Problem:\u00a0\u00a0&#8211; Encountered a problem: Unexpected exception When developing in Google AppEngine with DataNucleus datastore, if you get following error when the DataNucleus is &#8220;Enhancing&#8221; the data access object (JDO, JPA), then your JDK compile version &hellip; <a href=\"https:\/\/shirishranjit.com\/blog1\/entertainment\/google-appengine-and-datanucleus-enhance-java-lang-illegalargumentexception\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":51,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-791","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/791"}],"collection":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/comments?post=791"}],"version-history":[{"count":6,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/791\/revisions"}],"predecessor-version":[{"id":837,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/791\/revisions\/837"}],"up":[{"embeddable":true,"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/pages\/51"}],"wp:attachment":[{"href":"https:\/\/shirishranjit.com\/blog1\/wp-json\/wp\/v2\/media?parent=791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}