DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Marco Schulze
Reporter: Michael Bauschert
Votes: 2
Watchers: 2

If you were logged in you would be able to see more operations.
DataNucleus Tools : Eclipse plugin

Exception (Error 87 - commandline too long) during the enhancer is called within eclipse (plugin version 3.0.1)

Created: 21/Mar/12 05:47 PM   Updated: 01/Apr/14 10:37 AM   Resolved: 25/Mar/14 03:51 PM
Component/s: None
Affects Version/s: 3.0.1
Fix Version/s: 4.0.0.m1

Environment: WinXP SP3, Eclipse 3.7

Datastore: MySQL
Severity: Proof of Concept

 Description  « Hide
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 in my workspace
   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)

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 06/Apr/13 04:47 PM - edited
So you're using Windows and that O/S has crap limitations.

Workaround : Use persistence.xml, ... or a proper O/S ;-)

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.

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

Marco Schulze added a comment - 25/Mar/14 03:51 PM

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
For the other issue mentioned here (launch history), I opened NUCACCECLIPSE-17