View | Details | Raw Unified | Return to bug 211962 | Differences between
and this patch

Collapse All | Expand All

(-)j2ee.clientproject/src/org/netbeans/modules/j2ee/clientproject/wsclient/AppClientProjectJAXWSClientSupport.java (-1 / +1 lines)
 Lines 71-77    Link Here 
71
     * Creates a new instance of AppClientProjectJAXWSClientSupport
71
     * Creates a new instance of AppClientProjectJAXWSClientSupport
72
     */
72
     */
73
    public AppClientProjectJAXWSClientSupport(AppClientProject project, AntProjectHelper antProjectHelper) {
73
    public AppClientProjectJAXWSClientSupport(AppClientProject project, AntProjectHelper antProjectHelper) {
74
        super(project);
74
        super(project, antProjectHelper);
75
        this.project=project;
75
        this.project=project;
76
    }
76
    }
77
77
(-)j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/EjbJarProject.java (-1 / +1 lines)
 Lines 303-309    Link Here 
303
        ejbJarWebServicesSupport = new EjbJarWebServicesSupport(this, helper, refHelper);
303
        ejbJarWebServicesSupport = new EjbJarWebServicesSupport(this, helper, refHelper);
304
        jaxwsSupport = new EjbProjectJAXWSSupport(this, helper);
304
        jaxwsSupport = new EjbProjectJAXWSSupport(this, helper);
305
        ejbJarWebServicesClientSupport = new EjbJarWebServicesClientSupport(this, helper, refHelper);
305
        ejbJarWebServicesClientSupport = new EjbJarWebServicesClientSupport(this, helper, refHelper);
306
        jaxWsClientSupport = new EjbProjectJAXWSClientSupport(this);
306
        jaxWsClientSupport = new EjbProjectJAXWSClientSupport(this,helper);
307
        apiWebServicesSupport = WebServicesSupportFactory.createWebServicesSupport(ejbJarWebServicesSupport);
307
        apiWebServicesSupport = WebServicesSupportFactory.createWebServicesSupport(ejbJarWebServicesSupport);
308
        apiJaxwsSupport = JAXWSSupportFactory.createJAXWSSupport(jaxwsSupport);
308
        apiJaxwsSupport = JAXWSSupportFactory.createJAXWSSupport(jaxwsSupport);
309
        apiWebServicesClientSupport = WebServicesClientSupportFactory.createWebServicesClientSupport(ejbJarWebServicesClientSupport);
309
        apiWebServicesClientSupport = WebServicesClientSupportFactory.createWebServicesClientSupport(ejbJarWebServicesClientSupport);
(-)j2ee.ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/jaxws/EjbProjectJAXWSClientSupport.java (-2 / +3 lines)
 Lines 54-59    Link Here 
54
import org.netbeans.modules.j2ee.ejbjarproject.EjbJarProject;
54
import org.netbeans.modules.j2ee.ejbjarproject.EjbJarProject;
55
import org.netbeans.modules.websvc.api.jaxws.project.WSUtils;
55
import org.netbeans.modules.websvc.api.jaxws.project.WSUtils;
56
import org.netbeans.modules.websvc.spi.jaxws.client.ProjectJAXWSClientSupport;
56
import org.netbeans.modules.websvc.spi.jaxws.client.ProjectJAXWSClientSupport;
57
import org.netbeans.spi.project.support.ant.AntProjectHelper;
57
import org.openide.filesystems.FileObject;
58
import org.openide.filesystems.FileObject;
58
59
59
60
 Lines 65-72    Link Here 
65
    private EjbJarProject project;
66
    private EjbJarProject project;
66
    
67
    
67
    /** Creates a new instance of WebProjectJAXWSClientSupport */
68
    /** Creates a new instance of WebProjectJAXWSClientSupport */
68
    public EjbProjectJAXWSClientSupport(EjbJarProject project) {
69
    public EjbProjectJAXWSClientSupport(EjbJarProject project,AntProjectHelper helper) {
69
        super(project);
70
        super(project,helper);
70
        this.project=project;    
71
        this.project=project;    
71
    }
72
    }
72
    
73
    
(-)web.project/src/org/netbeans/modules/web/project/WebProject.java (-1 / +1 lines)
 Lines 380-386    Link Here 
380
        apiEjbJar = EjbJarFactory.createEjbJar(webEjbJarProvider);
380
        apiEjbJar = EjbJarFactory.createEjbJar(webEjbJarProvider);
381
        WebProjectWebServicesSupport webProjectWebServicesSupport = new WebProjectWebServicesSupport(this, helper, refHelper);
381
        WebProjectWebServicesSupport webProjectWebServicesSupport = new WebProjectWebServicesSupport(this, helper, refHelper);
382
        WebProjectJAXWSSupport jaxwsSupport = new WebProjectJAXWSSupport(this, helper);
382
        WebProjectJAXWSSupport jaxwsSupport = new WebProjectJAXWSSupport(this, helper);
383
        WebProjectJAXWSClientSupport jaxWsClientSupport = new WebProjectJAXWSClientSupport(this);
383
        WebProjectJAXWSClientSupport jaxWsClientSupport = new WebProjectJAXWSClientSupport(this, helper);
384
        WebProjectWebServicesClientSupport webProjectWebServicesClientSupport = new WebProjectWebServicesClientSupport(this, helper, refHelper);
384
        WebProjectWebServicesClientSupport webProjectWebServicesClientSupport = new WebProjectWebServicesClientSupport(this, helper, refHelper);
385
        apiWebServicesSupport = WebServicesSupportFactory.createWebServicesSupport (webProjectWebServicesSupport);
385
        apiWebServicesSupport = WebServicesSupportFactory.createWebServicesSupport (webProjectWebServicesSupport);
386
        apiJaxwsSupport = JAXWSSupportFactory.createJAXWSSupport(jaxwsSupport);
386
        apiJaxwsSupport = JAXWSSupportFactory.createJAXWSSupport(jaxwsSupport);
(-)web.project/src/org/netbeans/modules/web/project/jaxws/WebProjectJAXWSClientSupport.java (-2 / +3 lines)
 Lines 59-64    Link Here 
59
import org.netbeans.modules.websvc.api.jaxws.project.WSUtils;
59
import org.netbeans.modules.websvc.api.jaxws.project.WSUtils;
60
import org.netbeans.modules.websvc.spi.jaxws.client.ProjectJAXWSClientSupport;
60
import org.netbeans.modules.websvc.spi.jaxws.client.ProjectJAXWSClientSupport;
61
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
61
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
62
import org.netbeans.spi.project.support.ant.AntProjectHelper;
62
import org.openide.filesystems.FileObject;
63
import org.openide.filesystems.FileObject;
63
64
64
/**
65
/**
 Lines 69-76    Link Here 
69
    WebProject project;
70
    WebProject project;
70
    
71
    
71
    /** Creates a new instance of WebProjectJAXWSClientSupport */
72
    /** Creates a new instance of WebProjectJAXWSClientSupport */
72
    public WebProjectJAXWSClientSupport(WebProject project) {
73
    public WebProjectJAXWSClientSupport(WebProject project,AntProjectHelper helper) {
73
        super(project);
74
        super(project,helper);
74
        this.project=project;    
75
        this.project=project;    
75
    }
76
    }
76
77
(-)websvc.clientapi/src/org/netbeans/modules/websvc/api/jaxws/client/JAXWSClientSupport.java (+5 lines)
 Lines 54-59    Link Here 
54
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileObject;
55
import org.openide.util.Lookup;
55
import org.openide.util.Lookup;
56
import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportProvider;
56
import org.netbeans.modules.websvc.spi.client.WebServicesClientSupportProvider;
57
import org.netbeans.spi.project.support.ant.AntProjectHelper;
57
import org.openide.nodes.Node;
58
import org.openide.nodes.Node;
58
59
59
/** JAXWSClientSupport should be used to manipulate representations
60
/** JAXWSClientSupport should be used to manipulate representations
 Lines 192-195    Link Here 
192
     public String getServiceRefName(Node clientNode){
193
     public String getServiceRefName(Node clientNode){
193
         return impl.getServiceRefName(clientNode);
194
         return impl.getServiceRefName(clientNode);
194
     }
195
     }
196
     
197
     public AntProjectHelper getAntProjectHelper(){
198
         return impl.getAntProjectHelper();
199
     }
195
}
200
}
(-)websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/JAXWSClientSupportImpl.java (+6 lines)
 Lines 47-52    Link Here 
47
import java.io.IOException;
47
import java.io.IOException;
48
import java.net.URL;
48
import java.net.URL;
49
import java.util.List;
49
import java.util.List;
50
import org.netbeans.spi.project.support.ant.AntProjectHelper;
50
51
51
import org.openide.filesystems.FileObject;
52
import org.openide.filesystems.FileObject;
52
import org.openide.nodes.Node;
53
import org.openide.nodes.Node;
 Lines 131-135    Link Here 
131
     *  (currently not used in projects)
132
     *  (currently not used in projects)
132
     */
133
     */
133
    public String getServiceRefName(Node clientNode);
134
    public String getServiceRefName(Node clientNode);
135
    
136
    /**
137
     * Get the AntProjectHelper from the project
138
     */
139
    public AntProjectHelper getAntProjectHelper();
134
140
135
}
141
}
(-)websvc.clientapi/src/org/netbeans/modules/websvc/spi/jaxws/client/ProjectJAXWSClientSupport.java (-2 / +11 lines)
 Lines 51-56    Link Here 
51
import java.net.UnknownHostException;
51
import java.net.UnknownHostException;
52
import java.util.ArrayList;
52
import java.util.ArrayList;
53
import java.util.List;
53
import java.util.List;
54
import java.util.Properties;
54
import java.util.logging.Level;
55
import java.util.logging.Level;
55
import java.util.logging.Logger;
56
import java.util.logging.Logger;
56
import javax.swing.SwingUtilities;
57
import javax.swing.SwingUtilities;
 Lines 70-75    Link Here 
70
import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler;
71
import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler;
71
import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModelerFactory;
72
import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModelerFactory;
72
import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlService;
73
import org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlService;
74
import org.netbeans.spi.project.support.ant.AntProjectHelper;
73
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
75
import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
74
import org.openide.DialogDisplayer;
76
import org.openide.DialogDisplayer;
75
import org.openide.ErrorManager;
77
import org.openide.ErrorManager;
 Lines 104-114    Link Here 
104
    protected static final String JAVA_EE_VERSION_16="java-ee-version-16"; //NOI18N
106
    protected static final String JAVA_EE_VERSION_16="java-ee-version-16"; //NOI18N
105
    
107
    
106
    Project project;
108
    Project project;
109
    private AntProjectHelper helper;
107
    private FileObject clientArtifactsFolder;
110
    private FileObject clientArtifactsFolder;
108
    
111
    
109
    /** Creates a new instance of WebProjectJAXWSClientSupport */
112
    /** Creates a new instance of WebProjectJAXWSClientSupport */
110
    public ProjectJAXWSClientSupport(Project project) {
113
    public ProjectJAXWSClientSupport(Project project, AntProjectHelper helper ) {
111
        this.project=project;
114
        this.project=project;
115
        this.helper = helper;
112
    }
116
    }
113
    
117
    
114
    public void removeServiceClient(String serviceName) {
118
    public void removeServiceClient(String serviceName) {
 Lines 118-123    Link Here 
118
        }
122
        }
119
    }
123
    }
120
    
124
    
125
    public AntProjectHelper getAntProjectHelper() {
126
        return helper;
127
    }
128
    
121
    public String getWsdlUrl(String serviceName) {
129
    public String getWsdlUrl(String serviceName) {
122
        JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);
130
        JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);
123
        if (jaxWsModel!=null) {
131
        if (jaxWsModel!=null) {
 Lines 326-333    Link Here 
326
        try {
334
        try {
327
            ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<Boolean>() {
335
            ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<Boolean>() {
328
                public Boolean run() throws IOException {
336
                public Boolean run() throws IOException {
337
                    Properties props = WSUtils.identifyWsimport(helper);
329
                    ExecutorTask wsimportTask =
338
                    ExecutorTask wsimportTask =
330
                            ActionUtils.runTarget(buildImplFo,new String[]{"wsimport-client-"+finalName},null); //NOI18N
339
                            ActionUtils.runTarget(buildImplFo,new String[]{"wsimport-client-"+finalName},props); //NOI18N
331
                    return Boolean.TRUE;
340
                    return Boolean.TRUE;
332
                }
341
                }
333
            }).booleanValue();
342
            }).booleanValue();
(-)websvc.core/src/org/netbeans/modules/websvc/core/jaxws/nodes/ClientHandlerButtonListener.java (-1 / +5 lines)
 Lines 64-69    Link Here 
64
import java.net.URI;
64
import java.net.URI;
65
import java.util.Collection;
65
import java.util.Collection;
66
import java.util.List;
66
import java.util.List;
67
import java.util.Properties;
67
import java.util.logging.Level;
68
import java.util.logging.Level;
68
69
69
import javax.lang.model.element.TypeElement;
70
import javax.lang.model.element.TypeElement;
 Lines 94-99    Link Here 
94
import org.netbeans.modules.websvc.api.jaxws.bindings.DefinitionsBindings;
95
import org.netbeans.modules.websvc.api.jaxws.bindings.DefinitionsBindings;
95
import org.netbeans.modules.websvc.api.jaxws.bindings.GlobalBindings;
96
import org.netbeans.modules.websvc.api.jaxws.bindings.GlobalBindings;
96
import org.netbeans.modules.websvc.spi.support.MessageHandlerPanel;
97
import org.netbeans.modules.websvc.spi.support.MessageHandlerPanel;
98
import org.netbeans.modules.websvc.api.jaxws.project.WSUtils;
97
import org.netbeans.modules.websvc.api.jaxws.project.config.Binding;
99
import org.netbeans.modules.websvc.api.jaxws.project.config.Binding;
98
import org.netbeans.modules.websvc.api.jaxws.project.config.Client;
100
import org.netbeans.modules.websvc.api.jaxws.project.config.Client;
99
import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
101
import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
 Lines 440-448    Link Here 
440
            FileObject buildImplFo = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
442
            FileObject buildImplFo = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
441
            try {
443
            try {
442
                String name = client.getName();
444
                String name = client.getName();
445
                JAXWSClientSupport support = JAXWSClientSupport.getJaxWsClientSupport(srcRoot);
446
                Properties props = WSUtils.identifyWsimport(support.getAntProjectHelper());
443
                ExecutorTask wsimportTask =
447
                ExecutorTask wsimportTask =
444
                        ActionUtils.runTarget(buildImplFo,
448
                        ActionUtils.runTarget(buildImplFo,
445
                        new String[]{"wsimport-client-clean-" + name, "wsimport-client-" + name}, null); //NOI18N
449
                        new String[]{"wsimport-client-clean-" + name, "wsimport-client-" + name}, props); //NOI18N
446
                wsimportTask.waitFinished();
450
                wsimportTask.waitFinished();
447
            } catch (IOException ex) {
451
            } catch (IOException ex) {
448
                ErrorManager.getDefault().log(ex.getLocalizedMessage());
452
                ErrorManager.getDefault().log(ex.getLocalizedMessage());
(-)websvc.core/src/org/netbeans/modules/websvc/core/jaxws/projects/J2SEProjectJAXWSClientSupport.java (-1 / +1 lines)
 Lines 100-106    Link Here 
100
    
100
    
101
    /** Creates a new instance of J2SEProjectJAXWSClientSupport */
101
    /** Creates a new instance of J2SEProjectJAXWSClientSupport */
102
    public J2SEProjectJAXWSClientSupport(Project project) {
102
    public J2SEProjectJAXWSClientSupport(Project project) {
103
        super(project);
103
        super(project, null);
104
        this.project=project;
104
        this.project=project;
105
    }
105
    }
106
106
(-)websvc.design/nbproject/project.xml (+9 lines)
 Lines 146-151    Link Here 
146
                    </run-dependency>
146
                    </run-dependency>
147
                </dependency>
147
                </dependency>
148
                <dependency>
148
                <dependency>
149
                    <code-name-base>org.netbeans.modules.project.ant</code-name-base>
150
                    <build-prerequisite/>
151
                    <compile-dependency/>
152
                    <run-dependency>
153
                        <release-version>1</release-version>
154
                        <specification-version>1.48</specification-version>
155
                    </run-dependency>
156
                </dependency>
157
                <dependency>
149
                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
158
                    <code-name-base>org.netbeans.modules.projectapi</code-name-base>
150
                    <build-prerequisite/>
159
                    <build-prerequisite/>
151
                    <compile-dependency/>
160
                    <compile-dependency/>
(-)websvc.design/src/org/netbeans/modules/websvc/design/javamodel/Utils.java (-2 / +9 lines)
 Lines 54-59    Link Here 
54
import java.util.Collection;
54
import java.util.Collection;
55
import java.util.List;
55
import java.util.List;
56
import java.util.Map;
56
import java.util.Map;
57
import java.util.Properties;
57
import java.util.concurrent.CancellationException;
58
import java.util.concurrent.CancellationException;
58
import java.util.concurrent.ExecutionException;
59
import java.util.concurrent.ExecutionException;
59
import java.util.concurrent.Future;
60
import java.util.concurrent.Future;
 Lines 102-107    Link Here 
102
import org.netbeans.api.project.FileOwnerQuery;
103
import org.netbeans.api.project.FileOwnerQuery;
103
import org.netbeans.api.project.Project;
104
import org.netbeans.api.project.Project;
104
import org.netbeans.api.project.ProjectManager;
105
import org.netbeans.api.project.ProjectManager;
106
import org.netbeans.modules.websvc.api.jaxws.project.WSUtils;
105
import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
107
import org.netbeans.modules.websvc.api.jaxws.project.config.JaxWsModel;
106
import org.netbeans.modules.websvc.api.jaxws.project.config.Service;
108
import org.netbeans.modules.websvc.api.jaxws.project.config.Service;
107
import org.netbeans.modules.websvc.api.support.java.SourceUtils;
109
import org.netbeans.modules.websvc.api.support.java.SourceUtils;
 Lines 911-917    Link Here 
911
        }
913
        }
912
    }
914
    }
913
    
915
    
914
    public  static void invokeWsImport(Project project, final String serviceName) {
916
    public  static void invokeWsImport(final Project project, final String serviceName) {
915
        if (project!=null) {
917
        if (project!=null) {
916
            JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);
918
            JaxWsModel jaxWsModel = project.getLookup().lookup(JaxWsModel.class);
917
            if (jaxWsModel != null) {
919
            if (jaxWsModel != null) {
 Lines 922-930    Link Here 
922
                    try {
924
                    try {
923
                        ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<Boolean>() {
925
                        ProjectManager.mutex().readAccess(new Mutex.ExceptionAction<Boolean>() {
924
                            public Boolean run() throws IOException {
926
                            public Boolean run() throws IOException {
927
                                JAXWSSupport support = JAXWSSupport.getJAXWSSupport(
928
                                        project.getProjectDirectory());
929
                                Properties props = WSUtils.identifyWsimport(
930
                                        support.getAntProjectHelper());
925
                                ExecutorTask wsimportTask =
931
                                ExecutorTask wsimportTask =
926
                                    ActionUtils.runTarget(buildImplFo,
932
                                    ActionUtils.runTarget(buildImplFo,
927
                                    new String[]{"wsimport-service-clean-"+serviceName,"wsimport-service-"+serviceName},null); //NOI18N                                       ActionUtils.runTarget(buildImplFo,new String[]{"wsimport-client-"+finalName,"wsimport-client-compile" },null); //NOI18N
933
                                    new String[]{"wsimport-service-clean-"+serviceName,
934
                                            "wsimport-service-"+serviceName},props); //NOI18N                                       ActionUtils.runTarget(buildImplFo,new String[]{"wsimport-client-"+finalName,"wsimport-client-compile" },null); //NOI18N
928
                                wsimportTask.waitFinished();
935
                                wsimportTask.waitFinished();
929
                                return Boolean.TRUE;
936
                                return Boolean.TRUE;
930
                            }
937
                            }
(-)websvc.jaxwsapi/src/org/netbeans/modules/websvc/jaxws/spi/ProjectJAXWSSupport.java (-1 / +6 lines)
 Lines 53-58    Link Here 
53
import java.net.UnknownHostException;
53
import java.net.UnknownHostException;
54
import java.util.ArrayList;
54
import java.util.ArrayList;
55
import java.util.List;
55
import java.util.List;
56
import java.util.Properties;
57
56
import javax.xml.parsers.ParserConfigurationException;
58
import javax.xml.parsers.ParserConfigurationException;
57
import javax.xml.transform.stream.StreamSource;
59
import javax.xml.transform.stream.StreamSource;
58
import org.apache.tools.ant.module.api.support.ActionUtils;
60
import org.apache.tools.ant.module.api.support.ActionUtils;
 Lines 305-312    Link Here 
305
                }
307
                }
306
                FileObject buildImplFo = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
308
                FileObject buildImplFo = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
307
                try {
309
                try {
310
                    Properties props = WSUtils.identifyWsimport(antProjectHelper);
308
                    ExecutorTask wsimportTask =
311
                    ExecutorTask wsimportTask =
309
                            ActionUtils.runTarget(buildImplFo,new String[]{"wsimport-service-"+finalServiceName},null); //NOI18N
312
                            ActionUtils.runTarget(buildImplFo,
313
                                    new String[]{"wsimport-service-"+finalServiceName}, //NOI18N
314
                                    props); 
310
                    wsimportTask.waitFinished();
315
                    wsimportTask.waitFinished();
311
                } catch (IOException ex) {
316
                } catch (IOException ex) {
312
                    ErrorManager.getDefault().log(ex.getLocalizedMessage());
317
                    ErrorManager.getDefault().log(ex.getLocalizedMessage());
(-)websvc.jaxwsmodel/src/org/netbeans/modules/websvc/api/jaxws/project/Bundle.properties (+3 lines)
 Lines 49-51    Link Here 
49
USG_WEBSVC_DETECTED=Web Service Detected [WS Stack: {0}, Project: {1}, Object: {2}]
49
USG_WEBSVC_DETECTED=Web Service Detected [WS Stack: {0}, Project: {1}, Object: {2}]
50
50
51
ERR_ModifyCatalog=Could not modify catalog: {0}
51
ERR_ModifyCatalog=Could not modify catalog: {0}
52
ERR_WsimportBadVersion=The wsimport ant task version {0} is known to have serious \
53
bug in JAX-WS. This bug may cause NetBeans to stop responding. \
54
The task is defined in the classpath {1}. Please update it with newer version. 
(-)websvc.jaxwsmodel/src/org/netbeans/modules/websvc/api/jaxws/project/WSUtils.java (+84 lines)
 Lines 60-67    Link Here 
60
import java.util.Iterator;
60
import java.util.Iterator;
61
import java.util.List;
61
import java.util.List;
62
import java.util.Map;
62
import java.util.Map;
63
import java.util.Properties;
63
import java.util.Set;
64
import java.util.Set;
64
import java.util.StringTokenizer;
65
import java.util.StringTokenizer;
66
import java.util.jar.Attributes;
67
import java.util.jar.Manifest;
68
import java.util.logging.Level;
69
import java.util.logging.Logger;
70
65
import javax.xml.parsers.ParserConfigurationException;
71
import javax.xml.parsers.ParserConfigurationException;
66
import org.netbeans.api.java.classpath.ClassPath;
72
import org.netbeans.api.java.classpath.ClassPath;
67
import org.netbeans.api.java.project.JavaProjectConstants;
73
import org.netbeans.api.java.project.JavaProjectConstants;
 Lines 77-83    Link Here 
77
import org.netbeans.modules.websvc.jaxwsmodel.project.WsdlNamespaceHandler;
83
import org.netbeans.modules.websvc.jaxwsmodel.project.WsdlNamespaceHandler;
78
import org.netbeans.modules.xml.retriever.RetrieveEntry;
84
import org.netbeans.modules.xml.retriever.RetrieveEntry;
79
import org.netbeans.modules.xml.retriever.Retriever;
85
import org.netbeans.modules.xml.retriever.Retriever;
86
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
87
import org.netbeans.spi.project.support.ant.AntProjectHelper;
80
import org.netbeans.spi.project.support.ant.EditableProperties;
88
import org.netbeans.spi.project.support.ant.EditableProperties;
89
import org.netbeans.spi.project.support.ant.PropertyEvaluator;
81
import org.openide.DialogDisplayer;
90
import org.openide.DialogDisplayer;
82
import org.openide.ErrorManager;
91
import org.openide.ErrorManager;
83
import org.openide.NotifyDescriptor;
92
import org.openide.NotifyDescriptor;
 Lines 94-99    Link Here 
94
import org.openide.util.NbBundle;
103
import org.openide.util.NbBundle;
95
import org.xml.sax.SAXException;
104
import org.xml.sax.SAXException;
96
105
106
97
/**
107
/**
98
 *
108
 *
99
 * @author mkuchtiak
109
 * @author mkuchtiak
 Lines 631-635    Link Here 
631
        }
641
        }
632
        return found;
642
        return found;
633
    }
643
    }
644
    
645
    public static Properties identifyWsimport( AntProjectHelper helper ){
646
        if ( helper == null ){
647
            return null;
648
        }
649
        EditableProperties props = helper.getProperties(
650
                AntProjectHelper.PROJECT_PROPERTIES_PATH);
651
        String wsImportCp = props.getProperty("j2ee.platform.wsimport.classpath");  // NOI18N
652
        if ( wsImportCp ==null && wsImportCp.length() == 0 ){
653
            return null;
654
        }
655
        PropertyEvaluator evaluator = helper.getStandardPropertyEvaluator();
656
        String[] roots = wsImportCp.split(":");
657
        List<FileObject> cpItems = new ArrayList<FileObject>(roots.length);
658
        for (String root : roots) {
659
            String wsImportCpItem = evaluator.evaluate(root);
660
            FileObject fileObject = FileUtil.toFileObject( 
661
                    FileUtil.normalizeFile( new File(wsImportCpItem)));
662
            if ( fileObject == null ){
663
                continue;
664
            }
665
            if ( fileObject.isFolder() ){
666
                cpItems.add( fileObject);
667
            }
668
            else if ( FileUtil.isArchiveFile(fileObject)){
669
                cpItems.add( FileUtil.getArchiveRoot(fileObject));
670
            }
671
        }
672
        
673
        ClassPath classPath = ClassPathSupport.createClassPath(cpItems.toArray(
674
                new FileObject[cpItems.size()]));
675
        FileObject wsImport = classPath.findResource(
676
                    "com/sun/tools/ws/ant/WsImport.class");                         // NOI18N
677
        if ( wsImport == null ){
678
            return null;
679
        }
680
        FileObject wsImportRoot = classPath.findOwnerRoot(wsImport);
681
        FileObject manifest = wsImportRoot.getFileObject("META-INF/MANIFEST.MF");   // NOI18N
682
        try {
683
            Manifest mnfst = new Manifest( manifest.getInputStream());
684
            String version = mnfst.getMainAttributes().getValue(
685
                    "Implementation-Version");                                      // NOI18N
686
            if ( version.startsWith("2.2.")){                                       // NOI18N
687
                /*
688
                 *  version is 2.2 but it has minor release numbers so it is 
689
                 *  newer 2.2 version with fixed wsimport issue 
690
                 */
691
                return null;
692
            }
693
            else if ( version.startsWith("2.2")){                                   // NOI18N
694
                // buggy 2.2 version
695
                FileObject badRoot = FileUtil.getArchiveFile(wsImport);
696
                if ( badRoot== null){
697
                    badRoot = classPath.findOwnerRoot(wsImport);
698
                }
699
                NotifyDescriptor notifyDescriptor =
700
                    new NotifyDescriptor.Message(NbBundle.getMessage(WSUtils.class, 
701
                            "ERR_WsimportBadVersion", version, badRoot.getPath()),  // NOI18N
702
                            NotifyDescriptor.ERROR_MESSAGE);
703
                DialogDisplayer.getDefault().notify(notifyDescriptor);
704
                Properties properties = new Properties();
705
                properties.put("wsimport.bad.version", Boolean.TRUE.toString());    // NOI18N
706
                return properties;
707
            }
708
            else {
709
                // version is not 2.2 ( older or newer )
710
                return null;
711
            }
712
        }
713
        catch( IOException e ){
714
            Logger.getLogger(WSUtils.class.getName()).log(Level.INFO, null , e);
715
            return null;
716
        }
717
    }
634
718
635
}
719
}
(-)websvc.jaxwsmodel/src/org/netbeans/modules/websvc/jaxwsmodel/resources/jaxws-app-client.xsl (+1 lines)
 Lines 70-75    Link Here 
70
            
70
            
71
            <xsl:if test="/jaxws:jax-ws/jaxws:clients/jaxws:client">
71
            <xsl:if test="/jaxws:jax-ws/jaxws:clients/jaxws:client">
72
                <target name="wsimport-init" depends="init">
72
                <target name="wsimport-init" depends="init">
73
		    <fail if="${{wsimport.bad.version}}" message="WsImport ant task defined in the classpath ${{j2ee.platform.wsimport.classpath}} has a serious bug."/>
73
                    <mkdir dir="${{build.generated.sources.dir}}/jax-ws"/>
74
                    <mkdir dir="${{build.generated.sources.dir}}/jax-ws"/>
74
                    <property name="j2ee.platform.wsimport.classpath" value="${{libs.jaxws21.classpath}}"/>
75
                    <property name="j2ee.platform.wsimport.classpath" value="${{libs.jaxws21.classpath}}"/>
75
                    <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
76
                    <taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
(-)websvc.jaxwsmodel/src/org/netbeans/modules/websvc/jaxwsmodel/resources/jaxws-ejb.xsl (+1 lines)
 Lines 139-144    Link Here 
139
            <!-- wsimport task initialization -->
139
            <!-- wsimport task initialization -->
140
            <xsl:if test="/*/*/*/jaxws:wsdl-url">
140
            <xsl:if test="/*/*/*/jaxws:wsdl-url">
141
                <target name="wsimport-init" depends="init">
141
                <target name="wsimport-init" depends="init">
142
   		    <fail if="${{wsimport.bad.version}}" message="WsImport ant task defined in the classpath ${{j2ee.platform.wsimport.classpath}} has a serious bug."/>
142
                    <xsl:if test="/jaxws:jax-ws/jaxws:clients/jaxws:client">
143
                    <xsl:if test="/jaxws:jax-ws/jaxws:clients/jaxws:client">
143
                        <mkdir dir="${{build.generated.sources.dir}}/jax-ws"/>
144
                        <mkdir dir="${{build.generated.sources.dir}}/jax-ws"/>
144
                    </xsl:if>
145
                    </xsl:if>
(-)websvc.jaxwsmodel/src/org/netbeans/modules/websvc/jaxwsmodel/resources/jaxws-web.xsl (+1 lines)
 Lines 134-139    Link Here 
134
                    <xsl:value-of select="/jaxws:jax-ws/jaxws:jsr109"/>
134
                    <xsl:value-of select="/jaxws:jax-ws/jaxws:jsr109"/>
135
                </xsl:variable>
135
                </xsl:variable>
136
                <target name="wsimport-init" depends="init">
136
                <target name="wsimport-init" depends="init">
137
		    <fail if="${{wsimport.bad.version}}" message="WsImport ant task defined in the classpath ${{j2ee.platform.wsimport.classpath}} has a serious bug."/>
137
                    <xsl:if test="/jaxws:jax-ws/jaxws:clients/jaxws:client">
138
                    <xsl:if test="/jaxws:jax-ws/jaxws:clients/jaxws:client">
138
                        <mkdir dir="${{build.generated.sources.dir}}/jax-ws"/>
139
                        <mkdir dir="${{build.generated.sources.dir}}/jax-ws"/>
139
                    </xsl:if>
140
                    </xsl:if>

Return to bug 211962
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo