我正在尝试使用 Java DSL 和 RouteBuilder 实现 Camel 路由。我想从计时器端点发送到 cxf 端点。
public class MyRoute extends RouteBuilder {
@Override
public void configure() {
CamelContext camelContext = getContext();
CxfEndpoint cxfEndpoint = new CxfEndpoint();
cxfEndpoint.setAddress("http://localhost:8088/interface");
cxfEndpoint.setWsdlURL("wsdl/contract.wsdl");
cxfEndpoint.setCamelContext(camelContext);
cxfEndpoint.setDataFormat(DataFormat.PAYLOAD);
try {
camelContext.addEndpoint("myEndpoint", cxfEndpoint);
} catch (Exception e) {
e.printStackTrace();
}
from("timer://my-timer?fixedRate=true&period=500")
.transform(constant("DummyBody"))
.to("cxf://myEndpoint");
}
}
Run Code Online (Sandbox Code Playgroud)
这条路线被插入到使用 Spring XML 定义的骆驼上下文中(我还有一些其他路线)。
我收到以下错误:
karaf@root> Exception in thread "SpringOsgiExtenderThread-78" org.apache.camel.FailedToCreateProducerException: Failed to create Producer fo
r endpoint: Endpoint[cxf://myEndpoint]. Reason: java.lang.IllegalArgumentException: serviceClass must be specified
at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395) …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用PDFBox 2.0.0的密码解锁PDF.
在1.8.11中,我使用的是PDDocument.openProtection(DecryptionMaterial pm)方法,但它在2.0.0中被删除了.
该在线文档并没有说这是如何在2.0.0被achived.
PDFBox 2.0.0中仍然可以使用密码解锁PDF吗?
我正在尝试更改Visitor表中用于Userid 的外键列名.该列现在命名user_id,我想将其更改为who_id.
最小User域类:
class User {
static hasMany = [
visitor: Visitor
]
String uid
...
}
Run Code Online (Sandbox Code Playgroud)
最小Visitor域类:
class Visitor {
static belongsTo = [user: User]
....
}
Run Code Online (Sandbox Code Playgroud)
我试过mappedBy但没有成功,是否有另一种方法可以使用属性User作为外键Visitor?