Bug 162326 - Java project cannot be selected as Client project when generating a WS client
Summary: Java project cannot be selected as Client project when generating a WS client
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: jst.ws (show other bugs)
Version: 1.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.3 M153   Edit
Assignee: Kathy Chan CLA
QA Contact: Chris Brealey CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-25 17:55 EDT by Sean Zhou CLA
Modified: 2007-02-22 14:24 EST (History)
3 users (show)

See Also:


Attachments
Patch for jst.consumption (1.94 KB, patch)
2007-01-24 10:25 EST, Kathy Chan CLA
no flags Details | Diff
Revised patch based on comment #6 (1.94 KB, patch)
2007-01-24 11:43 EST, Kathy Chan CLA
no flags Details | Diff
Revised patch (1.92 KB, patch)
2007-01-24 12:08 EST, Kathy Chan CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Zhou CLA 2006-10-25 17:55:53 EDT
I create a Java project in my workspace. And I launch the Web Service wizard to generate a client from a WSDL file.

On the first page of the wizard, if I click on Client project to specify client project settings, the created Java project is not in the pulldown list for me to choose. I defined an extension for org.eclipse.jst.ws.consumption.ui.clientRuntimes as below

    <extension point="org.eclipse.jst.ws.consumption.ui.clientRuntimes">
      <clientRuntime
        id="com.ibm.ast.ws.jaxws.java"
        clientImplementationTypeId="org.eclipse.jst.ws.client.type.java"
        runtimeId="com.ibm.ast.ws.jaxws.WasWebServiceRT"
        class="com.ibm.ast.ws.jaxws.creation.wsrt.JAXWSWebServiceRuntime">
        <required-facet-version facet="jst.java" version="5.0" allow-newer="true"/>
        <required-facet-version facet="jst.utility" version="1.0" allow-newer="true"/>
      </clientRuntime>
    </extension>

The Java project will appear in the pulldown list if I change the version of jst.java into 1.3, like the following

        <required-facet-version facet="jst.java" version="1.3" allow-newer="true"/>

However, I specifically need to change the version into 5.0 so please investigate why it doesn't work if the version equals to 5.0. Thanks.
Comment 1 Chris Brealey CLA 2006-10-26 08:28:28 EDT
Kathy, please investigate - Thanks, CB.

Sean, is the wizard able to create the project for you if you instead type in something that doesn't exist?
Comment 2 Kathy Chan CLA 2007-01-23 16:50:13 EST
This turns out to be a Eclipse JDT Java core problem where it returns the default compiler compliance setting as 1.4 even though it should be 1.5.  The workaround is to explicitely set project specific compiler compliance level rather than relying on checking the default compliance level.  I've opened Eclipse JDT bug 171465 for this problem, added Sean to the CC list and asked for it in Eclipse 3.2.2.  Please put it on your adopter hot bug request (don't know if you have one for Eclipse) if you need to ensure that it is addressed in Eclipse 3.2.2.

*** This bug has been marked as a duplicate of bug 171465 ***
Comment 3 Frederic Fusier CLA 2007-01-24 05:02:33 EST
Reopen as JavaCore options are working properly. The getDefaultOptions() method only returns a default value (constant) although getOptions() returns the values of  workspace preferences (may be modified). So, this is the latter method which must be used instead of the former...
Comment 4 Kathy Chan CLA 2007-01-24 10:25:20 EST
Created attachment 57432 [details]
Patch for jst.consumption

In FacetUtils.getFacetsForJavaProject, use JavaCore.getOption("org.eclipse.jdt.core.compiler.compliance") instead of JavaCore.getDefaultOption.
Comment 5 Kathy Chan CLA 2007-01-24 10:25:53 EST
Patch ready for review and commit.
Comment 6 Frederic Fusier CLA 2007-01-24 10:54:30 EST
(In reply to comment #5)
> Patch ready for review and commit.
> 
IMO, it would be better:
1) to use JavaCore.COMPILER_COMPLIANCE constant instead of a literal string
2) remove the unnecessary cast: JavaCore.getOption(String) already returns a String

Then your line would be:
jdkComplianceLevel = JavaCore.getOption(JavaCore.COMPILER_COMPLIANCE)

Comment 7 Kathy Chan CLA 2007-01-24 11:43:19 EST
Created attachment 57448 [details]
Revised patch based on comment #6
Comment 8 Kathy Chan CLA 2007-01-24 12:08:12 EST
Created attachment 57452 [details]
Revised patch
Comment 9 Peter Moogk CLA 2007-01-24 12:16:04 EST
I have reviewed the patch made in comment #8.  The change looks good.
Comment 10 Kathy Chan CLA 2007-01-24 12:50:17 EST
Released to R1_5_maintenance as v200701241747 and to HEAD as v200701241750.
Comment 11 Kathy Chan CLA 2007-01-24 12:51:45 EST
Fix committed and released.  Will be in this week's WTP 1.5.3 and WTP 2.0 integration build.
Comment 12 Sean Zhou CLA 2007-02-03 23:15:24 EST
verified the fix is working
Comment 13 Chris Brealey CLA 2007-02-22 14:24:24 EST
Closed.