使用Fabric8和Docker在OpenShift V3中运行quickstart-camelservlet时出错

时间:2015-03-06 21:10:18

标签: docker openshift fabric8

我按照入门指南在OpenShift V3上运行Fabric8,并且在此示例中运行mvn fabric8:run时出现此错误:http://fabric8.io/v2/example.html。该项目正确构建并被推入Docker,但我仍然坚持到最后一步。似乎 kubernetes.json 中缺少某些内容,但我不确定为什么它没有生成或者如何添加丢失的内容。

有人有任何想法吗?

感谢。

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building War Quickstart :  Camel Servlet 2.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- fabric8-maven-plugin:2.0.30:run (default-cli) @ quickstart-war-    camel-servlet ---
[INFO] Deploying /app/fabric8/quickstarts/quickstarts/war/camel-servlet/target/classes/kubernetes.json to https://127.0.0.1:8443
[WARNING] Default key managers cannot be initialized: /home/****/.keystore (No such file or directory)
[INFO] Creating a service from kubernetes.json namespace  name quickstart-camelservlet
[WARNING] Default key managers cannot be initialized: /home/****/.keystore (No such file or directory)
[ERROR] Failed to create service from kubernetes.json.     javax.ws.rs.WebApplicationException: HTTP 422 Service "quickstart-camelservlet"     is invalid: metadata.namespace: required value. io.fabric8.kubernetes.api.model.Service@24943658[annotations=<null>,apiVersion=v1beta1,containerPort=io.fabric8.kubernetes.api.model.IntOrString@5b36755c[IntVal=8080,Kind=<null>,StrVal=<null>,additionalProperties={}],createExternalLoadBalancer=<null>,creationTimestamp=<null>,id=quickstart-camelservlet,kind=Service,labels=<null>,namespace=<null>,port=9101,portalIP=<null>,protocol=<null>,proxyPort=<null>,publicIPs=[],resourceVersion=<null>,selector={component=quickStartCamelServlet, group=quickstarts},selfLink=<null>,sessionAffinity=<null>,uid=<null>,additionalProperties={}]
javax.ws.rs.WebApplicationException: HTTP 422 Service "quickstart-camelservlet" is invalid: metadata.namespace: required value
at io.fabric8.kubernetes.api.ExceptionResponseMapper.fromResponse(ExceptionResponseMapper.java:27)
at io.fabric8.kubernetes.api.ExceptionResponseMapper.fromResponse(ExceptionResponseMapper.java:11)
at org.apache.cxf.jaxrs.client.ClientProxyImpl.checkResponse(ClientProxyImpl.java:302)
at org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:725)
at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:683)
at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:224)
at com.sun.proxy.$Proxy47.createService(Unknown Source)
at io.fabric8.kubernetes.api.KubernetesClient.createService(KubernetesClient.java:309)
at io.fabric8.kubernetes.api.KubernetesClient.createService(KubernetesClient.java:301)
at io.fabric8.kubernetes.api.Controller.applyService(Controller.java:251)
at io.fabric8.kubernetes.api.Controller.applyEntity(Controller.java:180)
at io.fabric8.kubernetes.api.Controller.applyConfig(Controller.java:197)
at io.fabric8.kubernetes.api.Controller.apply(Controller.java:148)
at io.fabric8.maven.RunMojo.execute(RunMojo.java:57)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

1 个答案:

答案 0 :(得分:1)

看起来fabric8的2.0.30版本不接受默认的命名空间,这是一个空字符串。您应该尝试以前版本的插件。我尝试过使用2.0.25,看起来它正在运行。