Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-13708

nifi-stateless-assembly unable to pull flow from registry

    XMLWordPrintableJSON

Details

    Description

      After building nifi-stateless-assembly as outlined above (Stateless Assembly build on eclipse-temurin:21-jdk running mvn clean install at nifi-rel-nifi-2.0.0-M4/nifi-stateless/), I am finding the following error when attempting to run a flow from my NiFi Registry

      Java home (JAVA_HOME): /opt/java/openjdk
      NiFi home (NIFI_HOME): /opt/nifi/build/nifi-rel-nifi-2.0.0-M4/nifi-stateless/nifi-stateless-assembly/target/nifi-stateless-2.0.0-M4-bin/nifi-stateless-2.0.0-M4
      Java options (STATELESS_JAVA_OPTS): -Xms1024m -Xmx1024m
      
      2024-09-03 18:35:29,036 INFO [main] org.apache.nifi.nar.NarUnpacker Expanding 5 NAR files started
      2024-09-03 18:35:29,039 INFO [main] org.apache.nifi.nar.NarUnpacker Expanded 5 NAR files in 0.003 seconds (3574584 ns)
      2024-09-03 18:35:29,044 INFO [main] o.a.n.s.bootstrap.StatelessBootstrap Unpacked NAR files in 10 millis
      2024-09-03 18:35:29,113 INFO [main] o.a.n.s.c.PropertiesFileFlowDefinitionParser Fetching flow from NiFi Registry at http://dev-nifi-registry:18080/nifi-registry
      Exception in thread "main" java.lang.NoClassDefFoundError: jakarta/inject/Singleton
              at org.glassfish.jersey.model.ContractProvider$Builder.<clinit>(ContractProvider.java:67)
              at org.glassfish.jersey.model.ContractProvider.builder(ContractProvider.java:49)
              at org.glassfish.jersey.model.internal.ComponentBag.modelFor(ComponentBag.java:522)
              at org.glassfish.jersey.model.internal.ComponentBag.lambda$registerModel$10(ComponentBag.java:454)
              at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
              at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
              at org.glassfish.jersey.internal.Errors.process(Errors.java:205)
              at org.glassfish.jersey.model.internal.ComponentBag.registerModel(ComponentBag.java:446)
              at org.glassfish.jersey.model.internal.ComponentBag.register(ComponentBag.java:357)
              at org.glassfish.jersey.model.internal.CommonConfig.register(CommonConfig.java:459)
              at org.glassfish.jersey.client.ClientConfig$State.register(ClientConfig.java:224)
              at org.glassfish.jersey.client.ClientConfig.register(ClientConfig.java:627)
              at org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient.<init>(JerseyNiFiRegistryClient.java:115)
              at org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient$Builder.build(JerseyNiFiRegistryClient.java:275)
              at org.apache.nifi.stateless.core.RegistryUtil.getRegistryClient(RegistryUtil.java:107)
              at org.apache.nifi.stateless.core.RegistryUtil.getFlowClient(RegistryUtil.java:81)
              at org.apache.nifi.stateless.core.RegistryUtil.getLatestVersion(RegistryUtil.java:76)
              at org.apache.nifi.stateless.core.RegistryUtil.getFlowByID(RegistryUtil.java:63)
              at org.apache.nifi.stateless.config.PropertiesFileFlowDefinitionParser.fetchFlowFromRegistry(PropertiesFileFlowDefinitionParser.java:603)
              at org.apache.nifi.stateless.config.PropertiesFileFlowDefinitionParser.fetchVersionedFlowSnapshot(PropertiesFileFlowDefinitionParser.java:541)
              at org.apache.nifi.stateless.config.PropertiesFileFlowDefinitionParser.parseFlowDefinition(PropertiesFileFlowDefinitionParser.java:119)
              at org.apache.nifi.stateless.config.PropertiesFileFlowDefinitionParser.parseFlowDefinition(PropertiesFileFlowDefinitionParser.java:106)
              at org.apache.nifi.stateless.bootstrap.StatelessBootstrap.parseDataflowDefinition(StatelessBootstrap.java:80)
              at org.apache.nifi.stateless.bootstrap.RunStatelessFlow.createDataflow(RunStatelessFlow.java:92)
              at org.apache.nifi.stateless.bootstrap.RunStatelessFlow.main(RunStatelessFlow.java:56)
      Caused by: java.lang.ClassNotFoundException: jakarta.inject.Singleton
              at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
              ... 25 more

      test_flow.properties

      nifi.stateless.registry.url=http://nifi-registry:18080/nifi-registry
      nifi.stateless.flow.bucketId=906ab936-9d68-4181-812f-96f81d396ad4
      nifi.stateless.flow.id=e8f924d6-6b20-4dad-a41b-eeec62aa7d78 

      I am able to access the registry container from the stateless container

      nifi@a20bc73e3297:/opt/nifi$ curl -I http://nifi-registry:18080/nifi-registry
      HTTP/1.1 301 Moved Permanently
      Server: Jetty(12.0.10)
      Date: Wed, 04 Sep 2024 15:12:38 GMT
      Location: /nifi-registry/
      Content-Length: 0 

      Additional details/context in NiFi Slack

      Attachments

        Activity

          People

            Unassigned Unassigned
            greggers Greg Meinecke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: