我有一个JAX-WS驱动的Web服务,其WSDL我们从另一个Maven模块生成一个Web服务客户端(我将调用它ws-consumer).
无论好坏,我们将"已发布的WSDL"(服务在发布时保存/生成的WSDL和XSD的版本)src/wsdl复制到我们的文件夹中ws-consumer,然后使用jaxws-maven-pluginorg.jvnet生成使用jaxws:wsimport以下内容的客户端(截断)配置:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<!--phase>generate-sources</phase -->
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlDirectory>src/main/resources/META-INF/wsdl/</wsdlDirectory>
<wsdlFiles>
<wsdlFile>MyWS/MyWS.wsdl</wsdlFile>
</wsdlFiles>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
现在,生成的客户端代码在类级别应用了以下注释:
@WebServiceClient(name = "MyWS", targetNamespace = "http://myws/blah", wsdlLocation = "**file:/C:/some/absolute/path/src/main/resources/META-INF/wsdl/MyWS/MyWS.wsdl"**)
Run Code Online (Sandbox Code Playgroud)
强调我的
正如您所希望看到的那样,wsdlLocation属性值具有硬编码的绝对路径,在部署服务时该路径将不正确.
有什么方法可以通过将其设置为just META-INF/wsdl/MyWS/MyWS.wsdl或其他值来"控制"它?
我有一台配备Intel Core-i7 2.00GHz×8处理器和8GB RAM并运行Ubuntu 14.04 64bit的HP Pavilion DV6笔记本电脑,但在更新到Intellij IDEA 14.0.2之后,IDE中的每一步都会延迟10到20秒.
任何人有同样的问题或知道如何解决它?
JRE 1.8_25-b17 amd64
Oracle的JVM Java HotSpot 64 ServerVM
我有几个不同的类来自外部源(不可修改),代表相同的概念.例如Address.我有com.namespace1.Address(有田houseNum,street,city), com.namespace2.Address(与领域h,s,c),(namespace3.com.CoolAddress与领域house_num,street,city).
问题是我使用的某些Web服务需要某些Address对象类型,所以我需要创建一个com.namespace1.Address给定的a namespace3.com.CoolAddress.这些字段很容易映射,但我正在寻找一个如何做到这一点的模式.
从我的角度来看,实例对象AddressConverter没有意义,因为没有状态(只有行为),当类只有行为时,它归结为实用程序类中的静态方法.从长远来看,无论何时我需要将新对象映射到另一个,我都有一个地方可以添加/修改/删除方法.如何完成它可能会改变,但我知道代码所在的位置(在一次位置)并且可以在需要时更改映射.
思考?
我试图在IntelliJ 13中使用Gradle项目,但我一直遇到以下问题:
我读到groovy插件允许Groovy和Java在混合自己的源路径中,但Java想要它自己的.所以我有以下目录结构:
我有Java和Groovy类的混合
这是我的build.gradle:
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'jacoco'
apply plugin: 'war'
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.0.RC4")
}
}
jar {
baseName = 'my-app'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-data-jpa:1.0.0.RC4")
compile("org.springframework:spring-orm:4.0.0.RC1")
compile("org.hibernate:hibernate-entitymanager:4.2.1.Final")
compile("com.h2database:h2:1.3.172")
compile("joda-time:joda-time:2.3")
compile("org.thymeleaf:thymeleaf-spring4")
compile("org.codehaus.groovy.modules.http-builder:http-builder:0.7.1")
compile …Run Code Online (Sandbox Code Playgroud) 我想添加一个通用对话框,其中"Ok"和"Cancel"按钮支持回调函数.
如何使用Dojo AMD实现这一目标?
例如:
myDialog = new Dialog ({
title: "My Dialog",
content: "Are you sure, you want to delete the selected Record?",
style: "width: 300px",
onExecute:function(){ //Callback function
console.log("Record Deleted")
},
onCancel:function(){
console.log("Event Cancelled") }
});
// create a button to clear the cart
new Button({ label:"Ok"
onClick: myDialog.onExecute()
}
new Button({ label:"Cancel"
onClick: function(){ myDialog.onCancel() }
}
Run Code Online (Sandbox Code Playgroud) 我知道eslintCLI本身有一个--fix标志,但我无法从文档中看出如何在我的Gruntfile中使用this via eslintConfig(in package.json)或grunt-eslint配置.
我有以下配置package.json:
"env": {
"browser": true,
"amd": true
},
"extends": "eslint:recommended",
Run Code Online (Sandbox Code Playgroud)
并lint使用此Grunt配置通过任务调用它:
eslint: {
target: [
'src/app/**/*.js'
],
format: 'checkstyle'
},
Run Code Online (Sandbox Code Playgroud)
如何--fix在此方案中启用该标志?
由于这个错误,我一直在阅读和测试并在墙上撞了一天多一天.
我在类中有一些Java代码Listener,看起来像这样
ExecutorService executor = Executors.newFixedThreadPool(NTHREADS);
boolean listening = true;
int count = 0;
while (listening) {
Runnable worker;
try {
worker = new ServerThread(serverSocket.accept()); // this is line 254
executor.execute(worker);
count++;
logger.info("{} threads started", count);
} catch (Exception e1){
//...
}
}
Run Code Online (Sandbox Code Playgroud)
我一直在调整JVM设置-Xmx(从1到15G -Xss不等)和(从104k到512M).服务器有24 GB的RAM,但还必须运行支持该程序的数据库.
在创建了2-20个线程之后(程序中的其他地方也存在了几十个),我得到了错误
Exception in thread "Thread-0" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:657)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:943)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1325)
at xxx.Listener.run(Listener.java:254)
Run Code Online (Sandbox Code Playgroud)
$java -version 收益率:
java version "1.6.0_24" …Run Code Online (Sandbox Code Playgroud) module Main where
qsort :: Ord a => [a] -> [a]
qsort [] = []
qsort (x : xs) = qsort smaller ++ [x] ++ qsort larger
where
smaller = [a | a <- xs , a <= x]
larger = [a | a <- xs , a > x]
main = do qsort [1,3,2]
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Couldn't match expected type `IO t0' with actual type `[a0]'
In the expression: main
When checking the type of the function `main'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
为什么这么简单的代码不起作用?
import Network.HTTP.Conduit
import qualified Data.ByteString.Lazy as L
main :: IO ()
main = simpleHttp "http://www.dir.bg/" >>= L.putStr
Run Code Online (Sandbox Code Playgroud)
它会导致以下错误:
TestConduit.exe:InternalIOException getAddrInfo:不存在(错误10093)
使用@Getter在List野外工作正常,但在尝试升级到Java 8我遇到的ConcurrentModificationException是因为受Lombok产生的吸气不执行领域,你应该希望阻止实例的状态的外部修正,它是必不可少的副本.
任何想法我如何让龙目岛复制Collection在getter上,还是我只限于写自己的?
java ×5
haskell ×2
javascript ×2
collections ×1
conduit ×1
dictionary ×1
dojo ×1
eslint ×1
gradle ×1
groovy ×1
grunt-eslint ×1
gruntjs ×1
http ×1
http-conduit ×1
jax-ws ×1
jvm ×1
lombok ×1
maven ×1
object ×1
openjdk ×1
spring-boot ×1
threadpool ×1
ubuntu ×1
web-services ×1
windows ×1
wsdl ×1