Eclipse Google -App -Engine “Will NOT Enhance”

2019-06-17 01:59发布

First Eclipse:

Cannot get rid of this error... Have tried every suggested fix on google..

Persistent class "Class com.blahb.blahblah.master.UserToken does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.

List of 500 lines of exceptions...
*Caused by:
javax.jdo.JDOUserException: Persistent class "Class com.blahb.blahblah.master.UserToken does not seem to have been enhanced.  You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.
    at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:375)
    at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:230)
    at com.gulfnet.gulfstar.master.Master.getUserToken(Master.java:645)
    at org.apache.jsp.top_jsp._jspService(top_jsp.java:68)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at com.google.appengine.tools.development.PrivilegedJspServlet.access$101(PrivilegedJspServlet*

My co-worker has this same project on her windows PC and it runs fine...

I've tried three different PC's linux, mac, windows, 3 different eclipse versions, 20 different ways of importing, creating new project, ect....

Yes, the .classpath was corrected to reflect the correct location of all jar files. I've tried adding every-single class, java, jar as suggested on one of the google blogs to the class/buildpath (window -> pref -> google -> orm) nothing...

And where is this damn "Enhancer Console" that is suppose to be in Eclipse...? I am running the latest Eclipse, with ALL the Google-app-engine plugins..

Any ideas...? Anyone..?

Thank You!

7条回答
贼婆χ
2楼-- · 2019-06-17 02:35

We edited the [Project > properties > Google > App Engine > ORM] page to remove the src/ and only enhance a subset of our classes (src/com/vo/.java*, src/com/back/? and res/) as explained in: datanucleus enhancer & javaw: "the parameter is incorrect"

We also copied the Google|App Engine to a shorter path as explained below worked for us: http://code.google.com/p/google-web-toolkit/issues/detail?id=4395#c15

查看更多
手持菜刀,她持情操
3楼-- · 2019-06-17 02:38

Changing the SDK version worked for me.

Interestingly, I was already using latest version. Reverting to the previous version was the only way I could trigger the 'enhance' step. This was with a gradle build script.

查看更多
Fickle 薄情
4楼-- · 2019-06-17 02:38

I had the same error and in my case solution was just make class not persistent by commenting this line:

@PersistenceCapable(identityType = IdentityType.APPLICATION)

Then run my application and get an error about persistence, stop it, uncomment previous line and run app again.

查看更多
再贱就再见
5楼-- · 2019-06-17 02:47

This issue was solved for me by adding a primary key, like so:

@PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id;

查看更多
男人必须洒脱
6楼-- · 2019-06-17 02:50

Right click on the project, then Properties > Builders. Is there a point like "Missing Builder (org.datanucleus.ide.eclipse.enhancerbuilder)"?

If you create a new Web Application Project, making sure that "Use Google Web Toolkit" and "Use Google App Engine" are checked, and then look again in Properties > Builders, does it then say "Enhancer" there instead of "Missing builder"?

If yes, then a solution for sure is to create a new project from scratch and then manually transfer the content from the old project into the new one. Simply importing the old project into another Eclipse doesn't work, the enhancer will still not be there.

查看更多
Bombasti
7楼-- · 2019-06-17 02:57

The problem is that the Enhancer for DataNucleus gets removed from the list of Builders for the project. For me all the Project Clean, rebuilt, etc. did not help. What you need to do is to (1) Create new sample GAE project, open the ".project" file of that project in plain text editor, copy this text from there:

<buildCommand>
    <name>com.google.appengine.eclipse.core.enhancerbuilder</name>
    <arguments></arguments>
</buildCommand>

Now copy this to the bottom of the list of builders in your own .project file. Now DataNucleus should work fine. I have no idea why it sometimes deappears.

查看更多
登录 后发表回答