My Project contains round about 400 classes (3 of them are "jdoifyed") and 4600 clases from jars, so you can have a guess how long the call for the enhancer gets (in my project its 600.000 characters). Why are all classes of a project and the jars appended as argument?

I have the following settings:

DataNucleus General:
Persistence API: JDO
User Project classpath when running tools
Log Config point to a log4j.properties in my workspace
Enhancer
Input file Extension class and jdo (like in the tutorial) i also changed to bin\jdo\*.class but had the same problem
Running in verbose mode
No PersistenceUnit name defined
Schema Tool
Contains the default setting (Schema Tool is not used)

Description

I have enabled Auto-enhancement for my project and during the execution of the enhancement i get the exception:
Exception occurred executing command line.
Cannot run program "C:\Program Files\Java\jre6\bin\javaw.exe" (in directory "C:\workspace-test\TestProject"): CreateProcess error=87, The parameter is incorrect.
But the reason for that error is, that the runtime configuration "DataNucleus Enhancer" contains as arguments the following:
-api JDO -v "C:\workspace-test\TestProject\bin\TestClass.class" "file2" "file3" "archiev1.jar/Class1.cls" ....
My Project contains round about 400 classes (3 of them are "jdoifyed") and 4600 clases from jars, so you can have a guess how long the call for the enhancer gets (in my project its 600.000 characters). Why are all classes of a project and the jars appended as argument?
I have the following settings:
DataNucleus General:
Persistence API: JDO
User Project classpath when running tools
Log Config point to a log4j.properties in my workspace
Enhancer
Input file Extension class and jdo (like in the tutorial) i also changed to bin\jdo\*.class but had the same problem
Running in verbose mode
No PersistenceUnit name defined
Schema Tool
Contains the default setting (Schema Tool is not used)

In my opinion, this is more of a design problem. The plugin should not create an Eclipse run configuration for this kind of stuff, but rather use an Eclipse Builder. That would also prevent another issue: whenever the enhancer runs, it becomes the last run configuration. So when I run a test, modify some code (the enhancer runs) and hit Cmd-F11 (debug last build), it re-runs the enhancer instead of my test. Not a show stopper, but definitely annoying.

The eclipse builder would also avoid the cost of forking a process after each code modification.

Another potential solution would be to leverage the m2eclipse plugin and reuse the Maven plugin.

Thierry Monney added a comment - 11/Apr/13 03:52 PM I have the very same problem on OSX Mountain Lion.
In my opinion, this is more of a design problem. The plugin should not create an Eclipse run configuration for this kind of stuff, but rather use an Eclipse Builder. That would also prevent another issue: whenever the enhancer runs, it becomes the last run configuration. So when I run a test, modify some code (the enhancer runs) and hit Cmd-F11 (debug last build), it re-runs the enhancer instead of my test. Not a show stopper, but definitely annoying.
The eclipse builder would also avoid the cost of forking a process after each code modification.
Another potential solution would be to leverage the m2eclipse plugin and reuse the Maven plugin.

@Thierry, if you have experience with EclipseBuilder then why not just grab the code and develop an upgrade to do just that?

This was written by someone who disappeared off the project a long time ago, and I don't have the time to spend learning many new APIs just to cater for people using an operating system that I don't use, hence why it is open source so people can chip in with contributions that benefit their projects

Andy Jefferson added a comment - 12/Apr/13 08:52 AM @Thierry, if you have experience with EclipseBuilder then why not just grab the code and develop an upgrade to do just that?
This was written by someone who disappeared off the project a long time ago, and I don't have the time to spend learning many new APIs just to cater for people using an operating system that I don't use, hence why it is open source so people can chip in with contributions that benefit their projects

I extended the DataNucleus Enhancer to support the new program argument:

-flf <fileListFile>

This program argument allows for putting all files to be enhanced into a temporary file and pass this single file instead of all the individual files. The Enhancer deletes the temporary file to prevent garbage from adding up.

The DataNucleus Eclipse plug-in uses this new feature by default on Windows.

It is possible to control both in the preferences and the project properties whether this feature is used.

Marco Schulze added a comment - 25/Mar/14 03:51 PM Fixed.
I extended the DataNucleus Enhancer to support the new program argument:
-flf <fileListFile>
This program argument allows for putting all files to be enhanced into a temporary file and pass this single file instead of all the individual files. The Enhancer deletes the temporary file to prevent garbage from adding up.
The DataNucleus Eclipse plug-in uses this new feature by default on Windows.
It is possible to control both in the preferences and the project properties whether this feature is used.