amanessinger / azzyzt_jee_tools

A collection of open source software tools helping software developers to create database-backed services using Java Enterprise Edition 6. It is designed to be integrated with popular Java IDEs.
http://www.azzyzt.org/
Other
3 stars 2 forks source link

Error trying to read tmp file when using Azzyzt> #28

Open gwhitty opened 12 years ago

gwhitty commented 12 years ago

Using Indigo Eclipse on Linux and the AZZYZT Eclipse package (the latest from http://azzyzt.manessinger.com/azzyzt_magwien), I get an error in Eclipse when I try using the "Azzyzt>Start code generator" menu item. The log reads ...

Caused by: java.lang.Error: Can't read from temp file /tmp/azzyzt7353198084514136565txt at org.azzyzt.jee.tools.common.Util.askExternalMainClass(Util.java:69) at org.azzyzt.jee.tools.mwe.projectgen.workers.MWEGeneratorWorker.callMWEGenerator(MWEGeneratorWorker.java:123) at org.azzyzt.jee.tools.mwe.projectgen.popup.actions.StartMWEGeneratorAction$1.run(StartMWEGeneratorAction.java:94) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

I've been trying running as root and the permissions seem fine. The azzyst...txt file is generated in the /tmp directory, but it doesn't have any contents.

amanessinger commented 12 years ago

OK, I see.

First, there is no reason to run it as root. Don't do that, never do that, it's a bad habit and completely unnecessary on Unix.

What happens here is, that I try to call a class that is not a direct part of the plugin. The plugin is made in a way that it contains only what is absolutely necessary, everything else is done in IDE-agnostic code that is dynamically loaded. The idea was, to make porting to Netbeans or IDEA as easy as possible, the drawback is the slightly awkward communication between the plugin and the code generator. Here, in this case, it is done via a file. The plugin creates a temp file and passes its name as a parameter to the class that it calls. I suppose the problem is not in the plugin but in the called code.

At the moment I can't debug it myself, but maybe you could give me slightly more information.

Did you follow the tutorial? If not so, can you try to do that strictly? If you don't get the error then, please tell me, and also tell me in which way you originally deviated from the path in the tutorial. If you still get the error, please tell me exactly in which step.

Thanks.

amanessinger commented 12 years ago

Got the same error when trying to use JDK 1.7 for the GlassFish runtime. In the error log you'll find another error telling you about an "UnsupportedClassVersionError: ... Unsupported major.minor version 51.0". This means that a class compiled with a newer version Java compiler (JDK 1.7 in our case) has been attempted to be run on an older version Java VM (the VM running Eclipse). Anyway, tests with Java 1.7 will really commence as soon as Eclipse officially supports Java 1.7.

For now, the fix is to use a JDK 1.6 for the GlassFish runtime. I hope that Indigo SR1 will have full support.

amanessinger commented 12 years ago

There's another case where I have stumbled over this error: I had created a new workspace for finding a bug that I suspected could have been due to a corrupt workspace. Therefore I created an azzyzted project with the same name as that in question in the original workspace. Then I copied only the entities over form the old workspace and tried to let Azzyzt generate. I got the InvocationTargetException and the "can't read" dialog, but the Eclipse log showed

org.azzyzt.jee.tools.mwe.exception.ToolError: No entities found in persistence.xml

as the root cause. I have to investigate this further, but obviously it is not necessarily a case of JDK major version mismatch.