3

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?

Arnaud
  • 7,259
  • 10
  • 50
  • 71
Sam
  • 2,707
  • 1
  • 23
  • 32

4 Answers4

8

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

Pablo Chvx
  • 1,809
  • 18
  • 31
1

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>
Eurig Jones
  • 8,226
  • 7
  • 52
  • 74
0

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

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
  • Thanks, and how can i do that? – Sam May 20 '12 at 12:24
  • I'd personally just read the docs for the software concerned http://www.datanucleus.org/products/accessplatform_3_1/enhancer.html – DataNucleus May 20 '12 at 13:01
  • You asked how to run the Enhancer from the command line. That link tells you how to invoke the Enhancer from the command line. If you mean something else then personally it would be better to add it to your question, otherwise people can't really answer you – DataNucleus May 21 '12 at 13:12
  • I'm sorry, I thought you mean how to use the persitence.xml is on that site too. I see the example for command line, thank you. – Sam May 21 '12 at 13:28
  • Yes I meant how to invoke the enhancer passing in the name of the persistence-unit. That way your command line is much shorter (rather than it passing in the names of all of your classes too). If you are using the DataNucleus Eclipse plugin then you could specify the persistence-unit "name" in the config there instead. A persistence-unit is defined in http://www.datanucleus.org/products/accessplatform_3_1/jdo/persistence_unit.html – DataNucleus May 21 '12 at 13:40
  • Thanks a lot, this looks very helpfull. I gonne test it as soon as possible and give you the feedback. – Sam May 21 '12 at 13:48
0

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.

DavidB
  • 2,064
  • 3
  • 17
  • 17