我创建了一个Web应用程序(使用JSP),它使用SOAP服务器端点来执行某些操作。 我使用gradle来自动构建。 我的问题是,当我运行WebApp时,它找不到WSDL生成的类(我在build.gradle中指定了它们)。
我的servlet源文件在/ src / main / java / servlets中 ,生成的WSDL文件在/ src-gen / main / java / todo_soap中 。
这是我的WebApp build.gradle :
buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath (group: 'com.sahlbach.gradle', name: 'gradle-jetty-eclipse-plugin', version: '1.9.+') classpath 'org.gradle.jacobo.plugins:gradle-wsdl-plugin:1.7.6' classpath 'org.gradle.jacobo.plugins:gradle-jaxb-plugin:1.3.4' } } apply plugin: 'com.github.jacobono.wsdl' apply plugin: 'com.github.jacobono.jaxb' apply plugin: 'java' apply plugin: 'war' apply plugin: 'jettyEclipse' apply plugin: 'eclipse' apply plugin: 'eclipse-wtp' repositories { mavenCentral() } dependencies { providedCompile 'javax.servlet:javax.servlet-api:3.0.1' compile 'com.google.code.gson:gson:2.3' jaxws "com.sun.xml.ws:jaxws-rt:2.2.8" jaxws "com.sun.xml.ws:jaxws-tools:2.2.8" } // // See the documentation of this plugin at // https://github.com/jacobono/gradle-wsdl-plugin // wsdl { wsdlFolder = "src/main/wsdl" wsimport { sourceDestinationDirectory = "src-gen/main/java" wsdlLocation = "http://localhost.com:8081/toDoSOAP?wsdl" } } sourceSets.main.java.srcDirs += wsdl.wsimport.sourceDestinationDirectory compileJava.dependsOn wsimport // // Required by XJC because toDoSOAP.xsd is a file // System.setProperty('javax.xml.accessExternalSchema', 'all')我的完整项目在这里
I've created a Web Application (with JSP) that uses a SOAP server endpoint to do some operations. I use gradle to automate the build. My problem is that when I run WebApp, it does not find the WSDL generated classes (and I've specified them in build.gradle).
My source files of servlet are in /src/main/java/servlets and generated WSDL files are in /src-gen/main/java/todo_soap.
Here my WebApp build.gradle:
buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath (group: 'com.sahlbach.gradle', name: 'gradle-jetty-eclipse-plugin', version: '1.9.+') classpath 'org.gradle.jacobo.plugins:gradle-wsdl-plugin:1.7.6' classpath 'org.gradle.jacobo.plugins:gradle-jaxb-plugin:1.3.4' } } apply plugin: 'com.github.jacobono.wsdl' apply plugin: 'com.github.jacobono.jaxb' apply plugin: 'java' apply plugin: 'war' apply plugin: 'jettyEclipse' apply plugin: 'eclipse' apply plugin: 'eclipse-wtp' repositories { mavenCentral() } dependencies { providedCompile 'javax.servlet:javax.servlet-api:3.0.1' compile 'com.google.code.gson:gson:2.3' jaxws "com.sun.xml.ws:jaxws-rt:2.2.8" jaxws "com.sun.xml.ws:jaxws-tools:2.2.8" } // // See the documentation of this plugin at // https://github.com/jacobono/gradle-wsdl-plugin // wsdl { wsdlFolder = "src/main/wsdl" wsimport { sourceDestinationDirectory = "src-gen/main/java" wsdlLocation = "http://localhost.com:8081/toDoSOAP?wsdl" } } sourceSets.main.java.srcDirs += wsdl.wsimport.sourceDestinationDirectory compileJava.dependsOn wsimport // // Required by XJC because toDoSOAP.xsd is a file // System.setProperty('javax.xml.accessExternalSchema', 'all')My full project here
最满意答案
我刚刚测试了你的代码。 以下是Martijn Courteaux要求的缺失信息的示例:
/Users/javier/Downloads/Lab1-master/ToDo_SOAP_WebApp-ws/src/main/java/servlets/ToDoAddServlet.java:39: error: cannot find symbol ToDoWebServiceService twss = new ToDoWebServiceService(); ^ symbol: class ToDoWebServiceService location: class ToDoAddServlet错误的原因是您忘记添加import todo_soap.*; 在文件ToDoAddServlet.java 。 如果你看一下src-gen\main\java你会发现生成的代码属于包todo_soap 。
I've just tested your code. Below is an example of the missing info that Martijn Courteaux requests:
/Users/javier/Downloads/Lab1-master/ToDo_SOAP_WebApp-ws/src/main/java/servlets/ToDoAddServlet.java:39: error: cannot find symbol ToDoWebServiceService twss = new ToDoWebServiceService(); ^ symbol: class ToDoWebServiceService location: class ToDoAddServletThe reason of the error is that you forgot to add import todo_soap.*; in the file ToDoAddServlet.java. If you look at src-gen\main\java you can see that the generated code belongs to the package todo_soap.
WSDL生成的文件(WSDL generated files)我创建了一个Web应用程序(使用JSP),它使用SOAP服务器端点来执行某些操作。 我使用gradle来自动构建。 我的问题是,当我运行WebApp时,它找不到WSDL生成的类(我在build.gradle中指定了它们)。
我的servlet源文件在/ src / main / java / servlets中 ,生成的WSDL文件在/ src-gen / main / java / todo_soap中 。
这是我的WebApp build.gradle :
buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath (group: 'com.sahlbach.gradle', name: 'gradle-jetty-eclipse-plugin', version: '1.9.+') classpath 'org.gradle.jacobo.plugins:gradle-wsdl-plugin:1.7.6' classpath 'org.gradle.jacobo.plugins:gradle-jaxb-plugin:1.3.4' } } apply plugin: 'com.github.jacobono.wsdl' apply plugin: 'com.github.jacobono.jaxb' apply plugin: 'java' apply plugin: 'war' apply plugin: 'jettyEclipse' apply plugin: 'eclipse' apply plugin: 'eclipse-wtp' repositories { mavenCentral() } dependencies { providedCompile 'javax.servlet:javax.servlet-api:3.0.1' compile 'com.google.code.gson:gson:2.3' jaxws "com.sun.xml.ws:jaxws-rt:2.2.8" jaxws "com.sun.xml.ws:jaxws-tools:2.2.8" } // // See the documentation of this plugin at // https://github.com/jacobono/gradle-wsdl-plugin // wsdl { wsdlFolder = "src/main/wsdl" wsimport { sourceDestinationDirectory = "src-gen/main/java" wsdlLocation = "http://localhost.com:8081/toDoSOAP?wsdl" } } sourceSets.main.java.srcDirs += wsdl.wsimport.sourceDestinationDirectory compileJava.dependsOn wsimport // // Required by XJC because toDoSOAP.xsd is a file // System.setProperty('javax.xml.accessExternalSchema', 'all')我的完整项目在这里
I've created a Web Application (with JSP) that uses a SOAP server endpoint to do some operations. I use gradle to automate the build. My problem is that when I run WebApp, it does not find the WSDL generated classes (and I've specified them in build.gradle).
My source files of servlet are in /src/main/java/servlets and generated WSDL files are in /src-gen/main/java/todo_soap.
Here my WebApp build.gradle:
buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath (group: 'com.sahlbach.gradle', name: 'gradle-jetty-eclipse-plugin', version: '1.9.+') classpath 'org.gradle.jacobo.plugins:gradle-wsdl-plugin:1.7.6' classpath 'org.gradle.jacobo.plugins:gradle-jaxb-plugin:1.3.4' } } apply plugin: 'com.github.jacobono.wsdl' apply plugin: 'com.github.jacobono.jaxb' apply plugin: 'java' apply plugin: 'war' apply plugin: 'jettyEclipse' apply plugin: 'eclipse' apply plugin: 'eclipse-wtp' repositories { mavenCentral() } dependencies { providedCompile 'javax.servlet:javax.servlet-api:3.0.1' compile 'com.google.code.gson:gson:2.3' jaxws "com.sun.xml.ws:jaxws-rt:2.2.8" jaxws "com.sun.xml.ws:jaxws-tools:2.2.8" } // // See the documentation of this plugin at // https://github.com/jacobono/gradle-wsdl-plugin // wsdl { wsdlFolder = "src/main/wsdl" wsimport { sourceDestinationDirectory = "src-gen/main/java" wsdlLocation = "http://localhost.com:8081/toDoSOAP?wsdl" } } sourceSets.main.java.srcDirs += wsdl.wsimport.sourceDestinationDirectory compileJava.dependsOn wsimport // // Required by XJC because toDoSOAP.xsd is a file // System.setProperty('javax.xml.accessExternalSchema', 'all')My full project here
最满意答案
我刚刚测试了你的代码。 以下是Martijn Courteaux要求的缺失信息的示例:
/Users/javier/Downloads/Lab1-master/ToDo_SOAP_WebApp-ws/src/main/java/servlets/ToDoAddServlet.java:39: error: cannot find symbol ToDoWebServiceService twss = new ToDoWebServiceService(); ^ symbol: class ToDoWebServiceService location: class ToDoAddServlet错误的原因是您忘记添加import todo_soap.*; 在文件ToDoAddServlet.java 。 如果你看一下src-gen\main\java你会发现生成的代码属于包todo_soap 。
I've just tested your code. Below is an example of the missing info that Martijn Courteaux requests:
/Users/javier/Downloads/Lab1-master/ToDo_SOAP_WebApp-ws/src/main/java/servlets/ToDoAddServlet.java:39: error: cannot find symbol ToDoWebServiceService twss = new ToDoWebServiceService(); ^ symbol: class ToDoWebServiceService location: class ToDoAddServletThe reason of the error is that you forgot to add import todo_soap.*; in the file ToDoAddServlet.java. If you look at src-gen\main\java you can see that the generated code belongs to the package todo_soap.
发布评论