Datanucleus 增强器无法与 GAE 一起使用 +斯卡拉蚀
我正在尝试评估使用 GAE + Scala 进行一个小项目,但我似乎无法解决 Datanucleus 增强器的问题。
我的项目是基本的 GuestBook 示例应用程序,我添加了 Scala 性质,然后添加了一个 Scala 对象,该对象的方法接受字符串,向其中添加一些内容,然后返回修改后的字符串。然后,我修改了正在运行的 GuestBook 示例以添加对此 Scala 方法的调用。这都是“Hello World”级别的内容。
我的问题是,我从增强器中得到了以下异常,
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(DelegatingMethodAccessorImpl.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
我对此进行了研究,并看到了一个将 Scala jar 添加到增强器的类路径中的参考,但没有指示如何执行此操作Google 的 GAE 版本。 Datanucleus 提供的说明参考了 GAE 版本中不存在的首选项。
我现在有点不知所措,作为这个工具组合的新手,我一定缺少一些简单的东西,但我不知道它可能是什么。
作为参考,我正在运行 Scala 2.9.0.1、GAE 1.5.2 和 Eclipse Indigo Build id:20110615-0604。
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(DelegatingMethodAccessorImpl.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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最新的 Scala 插件(2.0.0 beta 12)添加了一个类路径验证器,这似乎使问题变得复杂。看来 datanucleus 无法再找到 sclala-library.jar 或 scala 类。 Indigo 和之前的插件曾经可以工作,但现在您不能将 scala-library.jar 放入您的类路径中,因为“改进的”scala 插件会自动将其放入您的路径中,并且不允许您将其放入您的项目中。不幸的是我找不到旧的插件,所以我认为现在是我放弃 Scala 以及我在它上面浪费的所有时间的时候了。希望 Java 8 能够包含一些像 C# 一样的现代功能,这样我们就不必依赖这么多半成品的解决方案。我们不应该包含 groovy、scala、过于复杂的 Web 框架和 100 个具有大量重叠功能的开源 jar 文件来制作 Web 应用程序!也许这就是Java的终结?
抱歉发泄...又一个星期六浪费在升级某些东西后让基于java的项目正常工作。
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 增强器是一个简单的 java 进程,如果您将“guestbook.server.Slave$”的输入作为类名传递给它,那么它会尝试找到它,但会失败。找出你的输入(对增强器)错误的地方
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