Skip to main content

jaxws-maven-plugin 2.2.1 seems to leave a file /tmp/jm.txt

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
recerik
Offline
Joined: 2007-05-14

Release 2.2.1 of the jaxws-maven-plugin seems to create a file /tmp/jm.txt on each run without removing it afterwards.

This causes problems if multiple users on the same machine calls this plugin.

In AbstractJaxwsMojo.java the file refernence new File(System.getProperty("java.io.tmpdir", "jm.txt") is created in the method createPathFile. The methods first tries to remove the file, but if this fails, the fact is logged, but the method continues.

I do not see anything that tries to remove the file after its use in the exec() method.

If the wsimport goal of jaxws-maven-plugin is run with one WSDL by user 'a' and then afterwards by another user 'b' for another WSDL, the file for the first user is still used, typically causing something like

[WARNING] cannot remove obsolete classpath setting file: /tmp/jm.txt
28-May-2013 10:08:57 org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo createPathFile
SEVERE: null
java.io.FileNotFoundException: /tmp/jm.txt (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(FileOutputStream.java:179)
at java.io.FileOutputStream.(FileOutputStream.java:131)
at org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo.createPathFile(AbstractJaxwsMojo.java:476)
at org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo.exec(AbstractJaxwsMojo.java:363)
at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.processLocalWsdlFiles(WsImportMojo.java:307)

Depending on the actual contents of old contents of jm.txt now being used by the plugin, this may or may not cause compilation problems later.

Other errors may happen if several invocations of the plugin are run simultaneously, even if run by the same user.

I see two problems here:
1. using a fixed filename for several invocations may cause them to mix up.
2. the file should be deleted when no longer needed.

For now, I'm reverting to release 2.2.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jungicz
Offline
Joined: 2004-08-17

the best is to file any issues directly to JIRA: https://java.net/jira/browse/JAX_WS_COMMONS

I tried to fix it by https://java.net/projects/jax-ws-commons/sources/svn/revision/1107

recerik
Offline
Joined: 2007-05-14

I have not yet tried your fix, but at least the use of File.createTempFile seems to address the problem of reusing the same file repeatedly.

(And yes, I was considering filing a Jira issue directly, but as this is my first active entry into this community, I decided to query the forum first in case I had done something obviously stupid in the first place). Thank you for providing a fix anyway :-)

And finally -- as I'm not familiar with the jax-ws-commons release policies: is your commit included in any release og snapshot release that I can access to check out your fix ?

jungicz
Offline
Joined: 2004-08-17

recerik wrote:
(And yes, I was considering filing a Jira issue directly, but as this is my first active entry into this community, I decided to query the forum first in case I had done something obviously stupid in the first place). Thank you for providing a fix anyway :-)

no problem, we've spotted this in time ;-)

recerik wrote:
And finally -- as I'm not familiar with the jax-ws-commons release policies: is your commit included in any release og snapshot release that I can access to check out your fix ?

I did a respin of 2.3 which will be available publicly in maven central in next few days (I updated project homepage already earlier today just to be ready when the day D will come...)

to test the fix you can either wait for the 2.3 release to show up or you can try next snapshot which is 2.3.1-SNAPSHOT - see how to set it up

recerik
Offline
Joined: 2007-05-14

Ok, I'm not in a bad hurry.

I'll await 2.3 appearing in maven central and then test again.

Thanks for the update.