You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/04/29 00:36:01 UTC

[GitHub] [camel-quarkus] gus-maurizio opened a new issue #2532: CDI: programmatic lookup problem detected io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans

gus-maurizio opened a new issue #2532:
URL: https://github.com/apache/camel-quarkus/issues/2532


   A camel quarkus route that processes JSON files in a directory runs into warnings for every file processed using JSONPATH.
   Camel Quarkus 1.8.1 with camel 3.9.0
   
   The purpose of the route is to filter out those files that do not have a top level Record element. For those that do have it, split the body and process every record.
   
   LOG when running the runner jar file.
   ```
   2021-04-28 20:07:28,879 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 3.9.0 (AppName.Cloudtrail) started in 296ms (build:0ms init:147ms start:149ms)
   2021-04-28 20:07:28,880 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Pooled mode enabled. Camel pools and reuses objects to reduce JVM object allocations.
   2021-04-28 20:07:28,880 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Lightweight mode enabled. Performing optimizations and memory reduction.
   Apr 28, 2021 8:07:28 PM io.quarkus.bootstrap.runner.Timing printStartupTime
   INFO: quarkus181-cloudtrail 1.0.0 on JVM (powered by Quarkus 1.13.2.Final) started in 2.414s. Listening on: http://0.0.0.0:8080
   Apr 28, 2021 8:07:28 PM io.quarkus.bootstrap.runner.Timing printStartupTime
   INFO: Profile prod activated.
   Apr 28, 2021 8:07:28 PM io.quarkus.bootstrap.runner.Timing printStartupTime
   INFO: Installed features: [camel-attachments, camel-controlbus, camel-core, camel-direct, camel-file, camel-java-joor-dsl, camel-jsonpath, camel-log, camel-management, camel-microprofile-health, camel-microprofile-metrics, camel-platform-http, camel-rest, camel-support-common, camel-timer, camel-xml-jaxb, camel-yaml-dsl, camel-zip-deflater, cdi, mutiny, smallrye-context-propagation, smallrye-health, smallrye-metrics, vertx, vertx-web]
   2021-04-28 20:07:29,878 INFO  [App.Clo.Readfiles] (Camel (AppName.Cloudtrail) thread #0 - file://data/cloudtrail) FILE {CamelFileAbsolute=false, CamelFileAbsolutePath=/Users/SNP144/Source/quarkus/quarkus181-cloudtrail/data/cloudtrail/good.json, CamelFileLastModified=1619654623338, CamelFileLength=622, CamelFileName=good.json, CamelFileNameConsumed=good.json, CamelFileNameOnly=good.json, CamelFileParent=data/cloudtrail, CamelFilePath=data/cloudtrail/good.json, CamelFileRelativePath=good.json}
   2021-04-28 20:07:29,881 INFO  [App.Clo.HeartBeat] (Camel (AppName.Cloudtrail) thread #1 - timer://java) HEARTBEAT Random: 73
   Apr 28, 2021 8:07:29 PM io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans
   WARN:
   ================================================================================
   CDI: programmatic lookup problem detected
   -----------------------------------------
   At least one bean matched the required type and qualifiers but was marked as unused and removed during build
   Removed beans:
   	- PRODUCER_METHOD bean io.quarkus.jackson.runtime.ObjectMapperProducer#objectMapper() [types=[interface com.fasterxml.jackson.core.Versioned, interface java.io.Serializable, class com.fasterxml.jackson.core.ObjectCodec, class com.fasterxml.jackson.databind.ObjectMapper, class com.fasterxml.jackson.core.TreeCodec], qualifiers=[@javax.enterprise.inject.Default(), @javax.enterprise.inject.Any()]]
   Required type: class com.fasterxml.jackson.databind.ObjectMapper
   Required qualifiers: []
   Solutions:
   	- Application developers can eliminate false positives via the @Unremovable annotation
   	- Extensions can eliminate false positives via build items, e.g. using the UnremovableBeanBuildItem
   	- See also https://quarkus.io/guides/cdi-reference#remove_unused_beans
   ================================================================================
   
   2021-04-28 20:07:29,963 INFO  [App.Clo.Readfiles] (Camel (AppName.Cloudtrail) thread #0 - file://data/cloudtrail) FILE {CamelFileAbsolute=false, CamelFileAbsolutePath=/Users/SNP144/Source/quarkus/quarkus181-cloudtrail/data/cloudtrail/Bad.json, CamelFileLastModified=1619654636211, CamelFileLength=620, CamelFileName=Bad.json, CamelFileNameConsumed=Bad.json, CamelFileNameOnly=Bad.json, CamelFileParent=data/cloudtrail, CamelFilePath=data/cloudtrail/Bad.json, CamelFileRelativePath=Bad.json}
   Apr 28, 2021 8:07:29 PM io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans
   WARN:
   ================================================================================
   CDI: programmatic lookup problem detected
   ```
   The route is
   ```
           from("file://{{datadir}}?idempotent=true&noop=true").routeId("AppName.Cloudtrail.Readfiles")
               .log("FILE ${headers}")
           	// .unmarshal().gzipDeflater()
           	.choice()
   	        	// use true to suppress exceptions
   	        	.when().jsonpath("Records", true)
   	    	    	.to("direct:ctrecord")
   	        	.otherwise()
   	            	.to("direct:ctinvalid");
   
           from("direct:ctrecord").routeId("AppName.Cloudtrail.CTRecord")
           	// .split().jsonpathWriteAsString("$.Records[*]")
           		.to("log:out0?level=OFF");
   
           from("direct:ctinvalid").routeId("AppName.Cloudtrail.CTInvalid")
           	.log("INVALID ${headers}");
   ```
   
   and the files look like
   ```
   {
     "Records": [
       {
         "eventVersion": "1.08",
         "eventTime": "2021-04-26T23:53:10Z",
         "eventCategory": "Data"
       },
       {
         "eventVersion": "1.08",
         "eventTime": "2021-04-26T23:53:24Z",
         "eventSource": "lambda.amazonaws.com",
         "eventName": "InvokeExecution",
         "awsRegion": "us-east-1",
         "eventCategory": "Data"
       },
       {
         "eventVersion": "1.08",
         "eventTime": "2021-04-26T23:53:17Z",
         "eventSource": "lambda.amazonaws.com",
         "eventName": "Invoke",
         "sharedEventID": "c33094dd-e57a-46b6-9086-b8b58771d619",
         "eventCategory": "Data"
       }
     ]
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] lburgazzoli commented on issue #2532: CDI: programmatic lookup problem detected io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2532:
URL: https://github.com/apache/camel-quarkus/issues/2532#issuecomment-829063589


   yes, that's the way :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] lburgazzoli commented on issue #2532: CDI: programmatic lookup problem detected io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on issue #2532:
URL: https://github.com/apache/camel-quarkus/issues/2532#issuecomment-828931574


   I think you can workaround this by adding
     
       quarkus.arc.unremovable-types=com.fasterxml.jackson.databind.ObjectMapper
   
   to your application.properties.
   
   We then need the jsonpath extension to declare `ObjectMapper` as unremovable through `UnremovableBeanBuildItem`
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] gus-maurizio closed issue #2532: CDI: programmatic lookup problem detected io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans

Posted by GitBox <gi...@apache.org>.
gus-maurizio closed issue #2532:
URL: https://github.com/apache/camel-quarkus/issues/2532


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] gus-maurizio commented on issue #2532: CDI: programmatic lookup problem detected io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans

Posted by GitBox <gi...@apache.org>.
gus-maurizio commented on issue #2532:
URL: https://github.com/apache/camel-quarkus/issues/2532#issuecomment-829046837


   Thanks Luca, that did indeed work and the message is gone. Will this be the procedure when a similar message happens for a different class? the parameter seems to support a list of strings?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] gus-maurizio commented on issue #2532: CDI: programmatic lookup problem detected io.quarkus.arc.impl.ArcContainerImpl getMatchingBeans

Posted by GitBox <gi...@apache.org>.
gus-maurizio commented on issue #2532:
URL: https://github.com/apache/camel-quarkus/issues/2532#issuecomment-829096670


   it is the way


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org