开发者

Datanucleus Enhancer not working with GAE + Scala + Eclipse

开发者 https://www.devze.com 2023-04-01 20:38 出处:网络
I am trying to evaluate using GAE + Scala for a little side project but I cannot seem to get past a problem with the Datanucleus enhancer.

I am trying to evaluate using GAE + Scala for a little side project but I cannot seem to get past a problem with the Datanucleus enhancer.

My project is the basic GuestBook example application that I have added a Scala nature to, I then have added a Scala Object with a method that takes a string, adds some stuff to it, and then returns the modified string. I then modified the working GuestBook example to add a call to this Scala method. This is all "Hello World" level stuff.

My problem is that I get the following exception from the enhancer

DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
Aug 31, 2011 9:38:35 PM org.datanucleus.metadata.MetaDataManager loadClasses
SEVERE: Class "guestbook.server.Slave$" was not found in the CLASSPATH. Please check your         specification and your CLASSPATH.
org.datanucleus.exceptions.ClassNotResolvedException: Class "guestbook.server.Slave$" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
    at     org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:250)
    at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:415)
    at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:379)
    at     org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:743)
    at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:545)
    at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1252)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm开发者_运维知识库pl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:57    )
at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:60)
    at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41)

DataNucleus Enhancer completed with success for 0 classes. Timings : input=237 ms,     enhance=0 ms, total=237 ms. Consult the log for full details
DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full     details

I have looked into this and have seen one reference to adding the Scala jar to the enhancer's classpath, but there is not indication of how to do this with Google's version for GAE. The directions provided by Datanucleus refer to preferences that are not present in the GAE version.

I am at a bit of a loss at the moment, it must be something easy that I am missing as a newbie to this combination of tools but I don't know what it might be.

For Reference I am running Scala 2.9.0.1, GAE 1.5.2, and Eclipse Indigo Build id: 20110615-0604.


The latest Scala plugin (2.0.0 beta 12) added a classpath validator which seems to complicate the issue. It appears datanucleus can no longer find sclala-library.jar or scala classes. Indigo and the prior plugin used to work but now you can't put scala-library.jar in your classpath since the "improved" scala plugin automatically puts one in your path and won't let you put one in your project. Unfortunately I cannot find the old plugin so I think it is really really time for me to abandon Scala and all the time I have wasted with it. Hopefully Java 8 will include some modern feature like in C# so we don't have to depend on so many half baked solutions. We shouldn't have to include groovy, scala, overly complicated web frameworks, and 100 open source jar files with tons of overlapping functionality to make a web application! Maybe this is the end of Java?

Sorry for venting... another Saturday wasted on getting java based projects to work after upgrading something.


DataNucleus enhancer is a simple java process and if you pass input of "guestbook.server.Slave$" into it as a class name then it will try to find it, and fails. Work out where your input (to the enhancer) is wrong

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号