简体   繁体   中英

'DataNucleus Enhancer' Error 206

I have a problem. I always get an Error 206 from Java DataNucleus Enhancer, since 2 days ago... days before, it worked without errors.

Cannot run program "D:\\Program Files\\Java\\jre6\\bin\\javaw.exe" (in directory "C:\\Users\\schmisa2\\workspace\\AMS0"): CreateProcess error=206, The filename or extension is too long Cannot run program "D:\\Program Files\\Java\\jre6\\bin\\javaw.exe" (in directory "C:\\Users\\schmisa2\\workspace\\AMS0"): CreateProcess error=206, The filename or extension is too long

I searched a lot at Google and Stackoverflow but could not solve the problem.

My longest path is:

C:\\Users\\schmisa2\\workspace\\AMS0\\src\\ch\\zhaw\\ams\\module\\football\\sfv\\news\\server\\NewsElement.java

https://groups.google.com/group/google-appengine-java/browse_thread/thread/6cde7d1695b3eff3

Does somebody know how I can fix it?

I installed a Linux Ubuntu to test it there. There it was no problem... but it doesn't work on Windows 7. I have GWT 2.4, App engine 1.6.5. SDK and Eclipse 3.7

Or can someone explain me how to run it on command line?

This worked for me.

"If you're using eclipse plugin go to Project | Properties, choose Google \\ App Engine \\ ORM and only include directories that you have classes that you want enhanced. By default it does the entire project so that includes a lot of needless files."

Source here

I have a project which I was using DataNucleus, JDO and Annotations. I ran into the same issue on Windows with Eclipse (It was fine on my Mac). To fix, I did the following:

  • Created a .jdo file for each @PersistenceCapable class (see example JDO file below) and kept them alongside the class files.
  • Right-click project -> Preferences -> DataNucleus -> Enhancer -> Input File Extensions. Remove the "class" entry here.
  • Do the same as above for the SchemaTool configuration if this is also required for your project.

This should now work.

JDO file example:

<?xml version="1.0" encoding="UTF-8"?>
<jdo>
    <package name="my.package">
        <class name="MyPersistenceCapableClass"/>
    </package>
</jdo>

So you hit Windows antiquated limits on command line length. Change the invocation of the enhancer to use a persistence.xml for example.

Another way you can fix this issue or workaround it I should say in Eclipse is to create a new run configuration in eclipse copying the parameters from the datanucleus one which is created by the plugin Run Configurations -> Java Application -> DataNucleus Enhancer. Copy Main tab, Arguments, and you might need to add the Datanucleus jars to the classpath tab.

In the arguments tab, remove all the classes you don't need enhanced. Next I'll shut off the plugin by removing the classes extension under the projects Properties -> DataNucleus -> Enhancer -> Input File Extensions.

You'll just need to manually run this enhancer after each time you build now. If I need to add new classes to enhance, I'll just add it to my manual one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM