This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 75016 - Cannot get exclusive access to jax-ws.xml
Summary: Cannot get exclusive access to jax-ws.xml
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
: 73503 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-13 15:27 UTC by Lukas Jungmann
Modified: 2006-09-28 13:00 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thrown exception (1.24 KB, text/plain)
2006-04-13 15:29 UTC, Lukas Jungmann
Details
log from above problem with b84 (16.15 KB, text/plain)
2006-05-25 00:22 UTC, coldrick
Details
patch diff. (2.33 KB, text/plain)
2006-07-22 02:16 UTC, _ pcw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2006-04-13 15:27:36 UTC
I don't have exact steps to reproduce, but usually happens when creating new
webservice (if someone is behind me)...
Comment 1 Lukas Jungmann 2006-04-13 15:29:05 UTC
Created attachment 29843 [details]
thrown exception
Comment 2 Marek Fukala 2006-04-13 16:10:53 UTC
I have tried to fix it. Since it is not easy to reproduce I cannot be sure that
the fix will really help, so if you'll see it again feel free to reopen.

Checking in JAXWSNNListener.java;
/cvs/websvc/jaxwsmodel/src/org/netbeans/modules/websvc/jaxwsmodel/project/metadata/Attic/JAXWSNNListener.java,v
 <--  JAXWSNNListener.java
new revision: 1.1.2.7; previous revision: 1.1.2.6
done
Comment 3 Lukas Jungmann 2006-04-20 13:01:33 UTC
I saw it again, now while deleting webproject with ws in "Favorites" tab. IDE
was started w/ clean userdir and deleted project wasn't opened in the IDE.
Comment 4 Marek Fukala 2006-04-20 15:06:31 UTC
We agreed with Jungi, that if the issue happens only in such situation, it is
not P2 anymore => downgrading. If anyone will see it in the original scenario,
please upgrade it back to P2 + attach the exception stacktrace if it is
different than the original one.
Comment 5 Lukas Jungmann 2006-04-27 13:24:11 UTC
just correcting priority...
Comment 6 Jaroslav Pospisil 2006-05-02 09:49:26 UTC
Now it's 100% reproducible in NB55Beta 200605020200.
Just create web module on bundled tomcat, web service in it and deploy it.Create
another web module and there web service client.Choose previously deployed
service  and enter package name. Client is correctly generated,but "Cannot get
exclusive access to C:\Documents and
Settings\jp154641\WebApplication6\nbproject\jax-ws.xml" message is always
thrown. Also in Output window
"WebApplication6-impl(wsimport-client-clear-MyWS,wsimport-client-MyWS)" is message 

Target `wsimport-client-clean-MyWS' does not exist in this project. 
BUILD FAILED (total time: 0 seconds)
Comment 7 Milan Kuchtiak 2006-05-02 11:34:46 UTC
The exception describet here is the same as exception in 75727.

The problem was that jax-ws.xml input stream was not closed in GeneratedFilesHelper.

This is the fix:
http://websvc.netbeans.org/source/browse/websvc/jaxwsmodel/src/org/netbeans/modules/websvc/api/jaxws/project/GeneratedFilesHelper.java?r1=1.1.2.4.2.1&r2=1.1.2.4.2.2
Comment 8 Lukas Jungmann 2006-05-24 14:13:22 UTC
Same issue (exclusive access) is now with webservices.xml
Comment 9 coldrick 2006-05-25 00:09:51 UTC
mustang b84, nb5, as8.2 bundle on Ubuntu Linux

Create web app, add web service, go to add operation in editor, and get
RTE "Cannot get exclusive access to
{mumble}/WebApplication11/web/WEB-INF/webservices.xml"

This problem does not appear with jdk5_06 
Comment 10 coldrick 2006-05-25 00:22:22 UTC
Created attachment 30594 [details]
log from above problem with b84
Comment 11 coldrick 2006-05-25 00:24:05 UTC
Note also reported as http://www.netbeans.org/issues/show_bug.cgi?id=73503

This problem is totally reproducible for me with the steps provided.
Comment 12 Lukas Jungmann 2006-05-25 00:52:39 UTC
*** Issue 73503 has been marked as a duplicate of this issue. ***
Comment 13 _ pcw 2006-07-22 01:52:27 UTC
I just receieved this exception as well.  Running latest dev build of nb55 on
Solaris 10, JDK 1.6, b90.  J2EE 1.4 web application against Glassfish ur1 b03.

"Cannot get exclusive access to /space/tmp/WSWeb/web/WEB-INF/webservices.xml"
Comment 14 _ pcw 2006-07-22 02:01:46 UTC
I should add - I was attempting to create a web service in a newly created web
application.  My webservices.xml exists but is blank.  Might be a
synchronization problem with another thread attempting to access this file at
the same time.

I looked at the code in WebServiceGenerator.addWebServiceEntry and it uses
FileUtil.copyFile() to create the initial webservices.xml file.

copyFile() does not use AtomicAction which is a real problem for creating XML
files because the create event is sent before the XML root nodes and/or DOCTYPE
are written to the file allowing correct identification by the loader.  It also
wouldn't surprise me if the source of this exception is a conflict with the XML
data loader reading the file while trying to identify it.

Comment 15 _ pcw 2006-07-22 02:15:39 UTC
Martin or Rico or whomever wants to review this, try the attached patch that
uses an atomic action to create the initial version of webservices.xml.
Comment 16 _ pcw 2006-07-22 02:16:40 UTC
Created attachment 32110 [details]
patch diff.
Comment 17 Milan Kuchtiak 2006-07-24 07:13:30 UTC
The patch looks fine.
Nevertheless, this is another problem as the original one, isn't it ?
Comment 18 _ pcw 2006-07-24 08:14:46 UTC
Thanks for the review.

I think that patch could address this issue, or one possible cause at least.

The thread that runs the dataloaders will grab a file as soon as the event is
sent that it was created on disk and it has to open that file and sniff for the
XML signature and what type of XML file it is.

I suspect that if the thread that is writing webservices.xml (without the
benefit of atomic action) does not manage to open the file it just created
before the dataloader does (rare, but possible), then you would get the "Cannot
get exclusive access" exception because the file is already open for read by
another thread.
Comment 20 Lukas Jungmann 2006-09-28 13:00:56 UTC
Haven't saw this for a long time, so marking as verified.