我有最后一个Apache Brooklyn(24.08.2015),版本:0.8.0-SNAPSHOT,当我尝试以下蓝图示例时:https://brooklyn.incubator.apache.org/v/latest/yaml/custom-entities.html
name: Simple Netcat Server Example
location: localhost
services:
- type: brooklyn.entity.basic.VanillaSoftwareProcess
name: Simple Netcat Server
launch.command: |
echo hello | nc -l 4321 &
echo $! > $PID_FILE
# The following overrides demonstrate the use of a custom shell environment as well as
# check-running and stop commands. These are optional; default behavior will "do the
# right thing" with the pid file automatically.
env: { CHECK_MARKER: "checkRunning", STOP_MARKER: "stop" }
checkRunning.command: echo $CHECK_MARKER >> DATE && test -f "$PID_FILE" && ps -p `cat $PID_FILE` >/dev/null
stop.command: echo $STOP_MARKER >> DATE && test -f "$PID_FILE" && { kill -9 `cat $PID_FILE`; rm /tmp/vanilla.pid; }
# can also define download.url, in which case the launch command defaults to ./start.sh in that (archive) file
当我尝试使用Apache Brooklyn创建应用程序时,出现内部错误。我调试了该应用程序,得到的异常如下(PlanToSpecFactory.java):
java.lang.UnsupportedOperationException:部署计划项
org.apache.brooklyn.camp.spi.pdp.Service@62abec8e [name =简单Netcat
服务器,说明=,服务类型= brooklyn.entity.basic.VanillaSoftwareProcess,特性= [],customAttributes = {launch.command = echo
你好nc -l 4321&echo $! > $ PID_FILE,
env = {CHECK_MARKER = checkRunning,STOP_MARKER = stop},
checkRunning.command = echo $ CHECK_MARKER >>日期&&测试-f“ $ PID_FILE”
&& ps -p
cat $PID_FILE
> /dev/null,stop.command=echo $ STOP_MARKERDATE &&测试-f“ $ PID_FILE” && {杀死-9
cat $PID_FILE
; rm /tmp/vanilla.pid; }}]无法匹配在debug.log中的跟踪
调试o.a.b.c.plan.PlanToSpecFactory
[brooklyn-jetty-server-8443-qtp1119923741-24]:无法制定计划
转变故障将传播(尝试过的其他变压器=
[]):[java.lang.IllegalArgumentException:布鲁克林的变形金刚
OASIS CAMP解释器在创建此计划时出错。
知道为什么吗?在过去,这种做法很有效
(我想在Apache Brooklyn的邮件列表中发帖,但出现错误,无法联系任何人)
最佳答案
最新的SNAPSHOT版本经过大量的重构,将软件包名称更改为org.apache.brooklyn.*
。这可能就是为什么您的布鲁克林版本找不到VanillaSoftwareProcess
的原因。
基于Github repository,该实体现在位于以下位置:org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess