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 97132 - Cannot create ws from WSDL/wsclient in project on GlassFish
Summary: Cannot create ws from WSDL/wsclient in project on GlassFish
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 5.x
Hardware: All Linux
: P1 blocker (vote)
Assignee: Roderico Cruz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-02 21:06 UTC by Lukas Jungmann
Modified: 2007-04-17 20:32 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff of changes to GeneratedFilesHelper class (2.08 KB, text/plain)
2007-03-21 08:09 UTC, Roderico Cruz
Details
Diff of changes to the web project's build-impl.xsl (16.58 KB, text/plain)
2007-03-21 08:11 UTC, Roderico Cruz
Details
Diff of changes to the ejb project's build-impl.xsl (7.57 KB, text/plain)
2007-03-21 08:12 UTC, Roderico Cruz
Details
Diff of changes to the app client project's build-impl.xsl (4.25 KB, text/plain)
2007-03-21 08:14 UTC, Roderico Cruz
Details
This supersedes the earlier GeneratedFilesHelper.diff (1.74 KB, text/plain)
2007-03-22 06:18 UTC, Roderico Cruz
Details
WSUtils.diff--contains the improvements suggested by Vince K. (1.24 KB, text/plain)
2007-03-22 06:23 UTC, Roderico Cruz
Details
SPI implementation in the web project. (1.06 KB, text/plain)
2007-03-22 06:31 UTC, Roderico Cruz
Details
Complete WebProjectJAXWSVersion.java file (1.70 KB, text/plain)
2007-03-22 16:37 UTC, Roderico Cruz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2007-03-02 21:06:07 UTC
hudson - trunk - #2299, GF-v2-b38/2nd-march, jdk 1.6.0_01-b03

-start IDE w/ new userdir
-create new Java EE 5 web app for GF
-create new websvc from WSDL or wsclient

=>following exception is thrown:

java.io.IOException
        at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:562)
        at
org.netbeans.modules.websvc.core.JaxWsUtils.generateJaxWsImplClass(JaxWsUtils.java:302)
        at
org.netbeans.modules.websvc.core.JaxWsUtils.generateJaxWsImplementationClass(JaxWsUtils.java:114)
[catch] at
org.netbeans.modules.websvc.core.dev.wizard.JaxWsServiceCreator$4.modelCreated(JaxWsServiceCreator.java:406)
        at
org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler.fireModelCreated(WsdlModeler.java:199)
        at
org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler.access$300(WsdlModeler.java:48)
        at
org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler$1.run(WsdlModeler.java:74)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:541)
        at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:963)
Caused by: java.lang.IllegalArgumentException: Type
mywebservice.wsdl.MyWebServiceSEI cannot be found
        at
org.netbeans.modules.j2ee.common.source.GenerationUtils.createQualIdent(GenerationUtils.java:737)
        at
org.netbeans.modules.j2ee.common.source.GenerationUtils.addImplementsClause(GenerationUtils.java:709)
        at org.netbeans.modules.websvc.core.JaxWsUtils$1.run(JaxWsUtils.java:213)
        at org.netbeans.modules.websvc.core.JaxWsUtils$1.run(JaxWsUtils.java:299)
        at
org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:557)
        ... 8 more


and an output from ant is:
...
wsimport-client-CityStateByZip2:
Consider using <depends>/<produces> so that wsimport won't do unnecessary
compilation
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/ws/WsImport
Command invoked: wsimport /space/java/sdk/jdk1.6.0_01/jre/bin/java
-Djava.endorsed.dirs=/space/test/trunk/ide8/modules/ext/jaxws21/api
com.sun.tools.ws.WsImport -d
/home/lukas/NetBeansProjects/WebApplication1/build/generated/wsimport/binaries
-extension -keep -s
/home/lukas/NetBeansProjects/WebApplication1/build/generated/wsimport/client
-catalog /home/lukas/NetBeansProjects/WebApplication1/catalog.xml
/home/lukas/NetBeansProjects/WebApplication1/src/conf/xml-resources/web-service-references/CityStateByZip2/wsdl/ws.strikeiron.com/InnerGears/CityStateByZip2.wsdl
-p ee.rr.tt -wsdllocation http://ws.strikeiron.com/InnerGears/CityStateByZip2?WSDL
/home/lukas/NetBeansProjects/WebApplication1/nbproject/build-impl.xml:323:
wsimport failed
...
Comment 1 Lukas Jungmann 2007-03-02 23:13:08 UTC
The problem seems to be in wsimport from GlassFish - if I take our (=from NB)
jaxws-tools.jar and copy its content to $GF_HOME/lib/webservices-tools.jar then
all works like a charm. Can we somehow get the build number of the JAX-WS 2.1
library in GF? Is it FCS version?
Comment 2 Milan Kuchtiak 2007-03-05 11:17:36 UTC
Seems this is problem of latest GlassFish builds.
Tested with the latest milestone build (V2 b33) and it works.

Rico can find out what version of jax-ws is used in lates GlassFish nightly build.
Comment 3 Roderico Cruz 2007-03-06 06:35:12 UTC
Still waiting for reply from the jaxws and jsr 109 folks, but looking at the
manifest of the jars in GF v2 b38, the jars are from jaxws 2.1.1 (i.e., post
jaxws2.1 FCS).
Also if I comment out the jvmargs (for the endorsed dir) or turn off the fork in
the wsimport task invocation, the wsimport succeeds. Are you getting the same
result?
Comment 4 Milan Kuchtiak 2007-03-06 08:52:55 UTC
I played also with wsgen, using the latest glassfish libraries (build 38).
Unlike for wsimport, specifying the fork="true" and jvmargs for endorsed
mechanism is necessary (the wsgen fails in compilation phase).
Comment 5 Roderico Cruz 2007-03-07 05:25:46 UTC
It turns out this is a known issue in Glassfish:
http://monaco.sfbay/detail.jsf?cr=6527842
There is a fix that was integrated from jaxws and we are waiting for the GF
build that will have this fix, probably late this week.
Comment 6 Pavel Flaska 2007-03-12 09:28:31 UTC
It does not seem to be in 5.5.1, perhaps this has occurred in trunk build.
Comment 7 Lukas Jungmann 2007-03-12 12:34:36 UTC
Re Rico: "Also if I comment out the jvmargs (for the endorsed dir) or turn off
the fork in
the wsimport task invocation, the wsimport succeeds. Are you getting the same
result?"

Yes, my result is the same.

Re pflaska: It happens in NB 5.5.1 if you run IDE and latest GF (b37-38) on
JDK6, at least on linux platform
Comment 8 Roderico Cruz 2007-03-12 20:23:00 UTC
Glassfish has released a new version that has the jaxws 2.1 jars with some
fixes. With this, we need to take out the jvmargs for the endorsed dir in our
wsimport target, including the forking. In its place , we need to add a new
attribute to the wsimport invocation: xendorsed="true".

Lukas, as discussed kindly test this new GF--it will be b39 onwards.
Thanks.
Rico
Comment 9 Lukas Jungmann 2007-03-13 00:07:29 UTC
the solution with xendorsed="true" works fine in gf-v2-b39-nightly-12_mar_2007;
feel free to implement the proposed fix for this, so we can get it into r551 ASAP

Thanks
Comment 10 Roderico Cruz 2007-03-15 02:11:36 UTC
I am working on the "xendorsed=true" solution and realized this will work with
GF V2 but not with GF V1 because this wsimport option is new in GF V2. I heard
that NB 5.5.1 should be able to support GF V1/SA 9.0 
Comment 11 Lukas Jungmann 2007-03-15 02:31:34 UTC
AFAIK in 5.5.1 we should support only AS 8.2 (for J2EE 1.4) and AS 9.1 (for Java
EE 1.5), so if our solution works fine for these versions of AS, then it is OK.
Petre or Petre, am I right? 

OTOH: Other question is whether we (NetBeans) can bundle the FCS version of
JAX-WS 2.1, if we know that this version of JAX-WS contain an important bug (I'm
afraid that the following is similar situation as with toplink...):

"The JAX-WS 2.1 final specification  uses and references the W3C WSDL Binding
specification which was being defined in the WS-Addressing Working Group. The
Binding  spec was in the Candidate Recommendation stage ( and expected to go to
Final Recommendation)  when we did the final release of the JAX-WS specification
and RI few weeks back. Since then it has come to our attention that the Binding
spec is not going to be made a Final Recommendation  and will instead be
replaced with an alternative specification. We believe we need to take
corrective action to address this issue.

Hence, we have temporarily removed access to the JAXWS 2.1 RI to prevent any use
of these until the specification issue is resolved. We apologize for any
inconvenience caused. We will have some more updates on it in approximately two
weeks.

In the meantime, continue using JAXWS 2.1 nightly.
"
Comment 12 Lukas Jungmann 2007-03-15 02:38:09 UTC
The quotation is from "https://jax-ws.dev.java.net/2.1/" page as it was on 15th
March 2007 (just for a reference...)
Comment 13 Petr Jiricka 2007-03-15 10:21:23 UTC
> in 5.5.1 we should support only AS 8.2 (for J2EE 1.4) and AS 9.1

Well, this needs to change. Appserver 9.1 will not be released in time for NB
5.5.1 FCS, so we need to support the latest FCS version, which is 9.0. Also,
"supported" refers to the fact that it is certified by QE, but even for servers
that are not QE certified, we need to make sure it works. We should not
knowingly break features in recent versions such as AS 9.0, whether it is
supported or not.

So, Rico, do you think you can find a solution that would work for both 9.0 and
9.1? If necessary, you may need have two different build scripts for 9.0 and 9.1.
Comment 14 Roderico Cruz 2007-03-15 18:59:33 UTC
Petr, Yes I think so. We have to determine if the target server is GFv1 or GFv2.
From Vince, there is a way in 5.5.1 to definitively determine that. He's working
on the same for 6.0. Having said that, I'll give it a try and hopefully it will
work.
Comment 15 Roderico Cruz 2007-03-21 08:09:29 UTC
Created attachment 39736 [details]
Diff of changes to GeneratedFilesHelper class
Comment 16 Roderico Cruz 2007-03-21 08:11:11 UTC
Created attachment 39737 [details]
Diff of changes to the web project's build-impl.xsl
Comment 17 Roderico Cruz 2007-03-21 08:12:39 UTC
Created attachment 39738 [details]
Diff of changes to the ejb project's build-impl.xsl
Comment 18 Roderico Cruz 2007-03-21 08:14:01 UTC
Created attachment 39739 [details]
Diff of changes to the app client project's build-impl.xsl
Comment 19 Roderico Cruz 2007-03-21 08:16:48 UTC
The "xendorsed" attribute was introduced in wsimport in the newer versions of
the jaxws jars. The fix is to determine the target server and add the xendorsed
attribute to the wsimport invocation only if the target server is AS 9.1.
Diffs are included
Comment 20 Milan Kuchtiak 2007-03-21 16:03:48 UTC
The fix looks fine for me.

I'd just simplify the line :
<xsl:when test="not($isJSR109 = 'false')">
to
<xsl:when test="$isJSR109 = 'true'">


Comment 21 Vince Kraemer 2007-03-21 16:36:24 UTC
GeneratedFilesHelper:

Should check if roots isn't null before checking the length?

What about the situation where we have AS 9.2 and that AS has sun-domain_1_3.dtd
and sun-domain_1_4.dtd in the lib directory?

You may want to recode the test to check for AS 9.0, by doing the following...
see if there is a sun-domain_1_2.dtd AND there is not a sun-domain_1_3.dtd in
the lib/dtds directory.  I guess that would mean that the name of the test would
be isJAXWS20....

I guess you could apply the same basic pattern to preserve the isJAXWS21
'semantics'.. test to see if there is a sun-domain_1_3.dtd and there isn't a
sun-domain_1_4.dtd
Comment 22 Roderico Cruz 2007-03-22 05:23:39 UTC
Merged the fix to the 551 code line
Comment 23 Vince Kraemer 2007-03-22 05:52:41 UTC
I just looked at the changes merged into release551....

They are not even close to the changes submitted for review.  

Oh, well.
Comment 24 Vince Kraemer 2007-03-22 06:00:30 UTC
BTW: what was all the code that actually got integrated into release551 to
resolve this issue? 
Comment 25 Roderico Cruz 2007-03-22 06:04:21 UTC
OK Will update the diffs. I made some changes after submitting this diff cuz of
some dependency problem which resulted in a build failure. That is, a class in
the ide8 cluster depended on a class in the enterprise4 cluster and enterprise4
is built after ide8. So I had to implement an SPI. But the basic logic is still
the same, including the improvements suggested by Vince K.
Comment 26 Roderico Cruz 2007-03-22 06:18:37 UTC
Created attachment 39790 [details]
This supersedes the earlier GeneratedFilesHelper.diff
Comment 27 Roderico Cruz 2007-03-22 06:23:45 UTC
Created attachment 39791 [details]
WSUtils.diff--contains the improvements suggested by Vince K.
Comment 28 Roderico Cruz 2007-03-22 06:31:54 UTC
Created attachment 39792 [details]
SPI implementation in the web project.
Comment 29 Vince Kraemer 2007-03-22 16:12:42 UTC
Aren't there also changes in the various project modules like web/project and
j2ee/ejbjarproject that need to be called out?
Comment 30 Roderico Cruz 2007-03-22 16:25:39 UTC
Yes the following line was added to the WebProject (and similarly to the
EJBProject) to include it in the project lookup:

Index: WebProject.java
===================================================================
RCS file: /cvs/web/project/src/org/netbeans/modules/web/project/WebProject.java,v
retrieving revision 1.106
retrieving revision 1.107
diff -w -r1.106 -r1.107
100a101
> import org.netbeans.modules.web.project.jaxws.WebProjectJAXWSVersionProvider;
353a355
>             new WebProjectJAXWSVersionProvider(helper),
Comment 31 Vince Kraemer 2007-03-22 16:31:41 UTC
and the implementation of those classes was added, too. Right?

org.netbeans.modules.web.project.jaxws.WebProjectJAXWSVersionProvider is in the
web/project project.... right?
Comment 32 Roderico Cruz 2007-03-22 16:36:37 UTC
Yes that would be in the WebProjectJAXWSVersionProvider.diff attachment. 
Comment 33 Roderico Cruz 2007-03-22 16:37:56 UTC
Created attachment 39828 [details]
Complete WebProjectJAXWSVersion.java file
Comment 34 Vince Kraemer 2007-03-23 03:17:40 UTC
did the appclient-buildimp.diff turn out to be unnecessary?
Comment 35 Roderico Cruz 2007-03-23 15:03:25 UTC
Yes it is unnecessary in release551 because the app client was getting its
wsimport class from the internal IDE jars. This has been changed in NB 6.0 to
get the jars from Glassfish. Thus appclient-buildimp.diff is necessary in NB
6.0. When I fixed NB 6.0( following the release551 high resistance process) it
was not yet apparent to me that this was the case so I attached this file to
Issuezilla.

In summary, no this is not necessary in release551, and yes it is necessary in
NB 6.0
Comment 36 Lukas Jungmann 2007-03-23 15:15:56 UTC
Note: appclient part is necessary for 6.0 because of the fix of issue 97754.
Since this issue is P3 I didn't port the fix back to 5.5.1 (this is the
difference in appclient between trunk and release551 branch)
Comment 37 Vince Kraemer 2007-03-23 16:15:09 UTC
I feel that the issues that I raised in earlier comments are resolved.
Comment 38 Milan Kuchtiak 2007-03-26 15:36:21 UTC
The changes made in build-inpl.xsl (Web project and EJB Project) as well as
changes in GeneratedFilesHelper class looks fine for me.
Comment 39 Lukas Jungmann 2007-04-17 20:32:01 UTC
v.