我尝试将Apache Flume
应用来源与Oracle AQ
相关联。
jndi.properties
位于类路径中,配置如下:
java.naming.factory.initial=oracle.jms.AQjmsInitialContextFactory
java.naming.provider.url=tcp://my.db.url
java.naming.security.principal=remote
java.naming.security.credentials=remotepwd
我在日志中收到以下错误:
Source jmsSource has been removed due to an error during configuration
org.apache.flume.FlumeException: Could not create initial context oracle.jms.AQjmsInitialContextFactory provider tcp://my.db.url
....
Caused by: javax.naming.NamingException: The configuration of the AQjmsInitialContext is not complete.
The configuration must contain datasource or (db_url,java.naming.security.principal,java.naming.security.credentials) or both
我已经从示例中复制了java.naming.security.principal=remote
java.naming.security.credentials=remotepwd
,但我并不知道我需要插入的值是什么。
有关如何正确配置jndi.properties
文件的任何建议吗?
答案 0 :(得分:0)
根据错误消息(在我查看源代码之前我不清楚),通过db_url
属性指定了db url。所以你想要像
java.naming.factory.initial=oracle.jms.AQjmsInitialContextFactory
db_url=tcp://my.db.url
java.naming.security.principal=remote
java.naming.security.credentials=remotepwd