Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-22608

Pls modify the sample to make sure it can run in both ocp and standalone env

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • fuse-7.13.1-GA
    • fuse-7.12.1-GA
    • Camel
    • None
    • False
    • None
    • False
    • % %
    • Todo
    • Very Likely

      I am using the samples following the document:
      https://access.redhat.com/documentation/en-us/red_hat_fuse/7.12/html-single/fuse_on_openshift_guide/index#integrate-spring-boot-with-kubernetes

      When I try to run in a local env,

      mvn spring-boot:run 
      

      But I got the exception, the project cannot be run, looks like it is still running in a k8s env.

      10:08:31.875 [main] INFO  o.s.c.k.client.KubernetesClientUtils - Could not create the Kubernetes ApiClient in a cluster environment, because :
      java.lang.IllegalStateException: java.lang.NumberFormatException: null
      
      10:08:32.051 [main] ERROR o.s.boot.SpringApplication - Application run failed
      org.springframework.cloud.kubernetes.commons.config.NamespaceResolutionFailedException: unresolved namespace
      	at org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigUtils.getApplicationNamespace(KubernetesClientConfigUtils.java:110)
      	at org.springframework.cloud.kubernetes.client.config.KubernetesClientConfigMapPropertySourceLocator.getMapPropertySource(KubernetesClientConfigMapPropertySourceLocator.java:87)
      	at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.getMapPropertySourceForSingleConfigMap(ConfigMapPropertySourceLocator.java:95)
      	at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.lambda$locate$0(ConfigMapPropertySourceLocator.java:75)
      	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
      	at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.locate(ConfigMapPropertySourceLocator.java:75)
      	at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:51)
      	at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47)
      	at org.springframework.cloud.kubernetes.commons.config.ConfigMapPropertySourceLocator.locateCollection(ConfigMapPropertySourceLocator.java:87)
      	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:95)
      	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:604)
      	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:306)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
      	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
      	at org.example.fis.Application.main(Application.java:30)
      

            Unassigned Unassigned
            rhn-support-xiwu Xiaohui Wu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: