kandi background
Explore Kits

cdi-properties | CDI Properties is a CDI extension | JSON Processing library

 by   gonmarques Java Version: 1.1.1 License: Apache-2.0

 by   gonmarques Java Version: 1.1.1 License: Apache-2.0

Download this library from

kandi X-RAY | cdi-properties Summary

cdi-properties is a Java library typically used in Utilities, JSON Processing, Hibernate, Eclipse applications. cdi-properties has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub, Maven.
CDI Properties is a CDI extension that enables resource bundle injection in a CDI enabled Java EE application, requiring little to no configuration depending on the application requirements. The resource bundle source may be the typical .properties files or any other external resource or system.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • cdi-properties has a low active ecosystem.
  • It has 24 star(s) with 4 fork(s). There are 2 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 1 open issues and 1 have been closed. There are no pull requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of cdi-properties is 1.1.1
cdi-properties Support
Best in #JSON Processing
Average in #JSON Processing
cdi-properties Support
Best in #JSON Processing
Average in #JSON Processing

quality kandi Quality

  • cdi-properties has 0 bugs and 0 code smells.
cdi-properties Quality
Best in #JSON Processing
Average in #JSON Processing
cdi-properties Quality
Best in #JSON Processing
Average in #JSON Processing

securitySecurity

  • cdi-properties has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • cdi-properties code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
cdi-properties Security
Best in #JSON Processing
Average in #JSON Processing
cdi-properties Security
Best in #JSON Processing
Average in #JSON Processing

license License

  • cdi-properties is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
cdi-properties License
Best in #JSON Processing
Average in #JSON Processing
cdi-properties License
Best in #JSON Processing
Average in #JSON Processing

buildReuse

  • cdi-properties releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • cdi-properties saves you 1469 person hours of effort in developing the same functionality from scratch.
  • It has 3279 lines of code, 265 functions and 112 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
cdi-properties Reuse
Best in #JSON Processing
Average in #JSON Processing
cdi-properties Reuse
Best in #JSON Processing
Average in #JSON Processing
Top functions reviewed by kandi - BETA

kandi has reviewed cdi-properties and discovered the below as its top functions. This is intended to give you an instant insight into cdi-properties implemented functionality, and help decide if they suit your requirements.

  • Inject property bundle .
  • Get a converter for the given type .
  • Initialize the resolver .
  • Determines whether a type is dependent on the JEE .
  • Returns the resolver instance .
  • Checks that multiple annotation is annotated .
  • Resolve a property .
  • Initialize the web application context .
  • Gets the qualifiers .
  • Verify that the locale resolver parameter annotation .

cdi-properties Key Features

Java web application

EJB standalone application

CDI Properties

copy iconCopydownload iconDownload
<dependency>
  <groupId>com.byteslounge</groupId>
  <artifactId>cdi-properties</artifactId>
  <version>1.1.1</version>
</dependency>

Usage

copy iconCopydownload iconDownload
@Property("hello.world")
private String helloWorld;

Property Resolver

copy iconCopydownload iconDownload
@PropertyResolver
public String resolveProperty(@PropertyLocale Locale locale, 
  @PropertyBundle String bundleName, @PropertyKey String key){
  
  String result = // resolve the property;
  return result;
  
}

Locale Resolver

copy iconCopydownload iconDownload
FacesContext.getCurrentInstance().getViewRoot().getLocale();

Configuration

copy iconCopydownload iconDownload
<context-param>
  <description>Default resource bundle name</description>
  <param-name>defaultResourceBundleBaseName</param-name>
  <param-value>com.example.messages</param-value>
</context-param>

Community Discussions

Trending Discussions on cdi-properties
  • FailedToCreateRouteException Deploying Camel-CDI application to Wildfly 8.2
Trending Discussions on cdi-properties

QUESTION

FailedToCreateRouteException Deploying Camel-CDI application to Wildfly 8.2

Asked 2017-Mar-31 at 16:03

I am developing an application that reads messages from a Kafka queue, and processes them creating an e-mail and sending it.

I was able to get a simple camel route working in a standalone java application, however when I package it up using CDI and Wildfly 8.2 it fails to deploy. I am following the directions from here: camel CDI Properties example I used the example as a template for my application. I am using Wildfly 8.2.0, Camel 2.18.1, Kafka 0.10.1.1

What am I doing wrong? I don't understand the error "org.apache.camel.FailedToCreateRouteException: Failed to create route Deep-email-notify-route: Route(Deep-email-notify-route)[[From[no uri or ref supplied!... because of Either 'uri' or 'ref' must be specified on: org.apache.camel.impl.DefaultRouteContext@55edcc54"

This is most of my code:

@ApplicationScoped
public class OrderEmailApplication  {

/** The logger. */
private static Logger logger =LogManager.getLogger(OrderEmailRoute.class);

public OrderEmailApplication() {}

@ContextName("OrderNotifications")
static class OrderEmailRoute extends RouteBuilder {

    @Uri("kafka://{{deep.notify.kafka.server}}?topic={{deep.notify.order.topics}}&groupId={{deep.notify.order.groupId}}&"+
                "keyDeserializer=org.apache.kafka.common.serialization.StringDeserializer&" +
                "valueDeserializer=org.apache.kafka.common.serialization.StringDeserializer")
    Endpoint kafkaEndpoint;

    @Uri("file:///home/whomer/tmp/Notify/deadMessages")
    private Endpoint deadLetter;


    @BeanInject
    BulkEmailProcessor bulkEmailProcessor;

    @BeanInject
    FailedMessageEnrichmentProcessor failedEmailEnrichement;


    @Override
    public void configure() throws Exception {
        errorHandler(defaultErrorHandler().maximumRedeliveries(0));

        from(kafkaEndpoint).routeId("Deep-email-notify-route")
        .unmarshal().json(JsonLibrary.Jackson, LinkedHashMap.class)
        .bean("velocityBean")
        .process(bulkEmailProcessor)
        .marshal().json(JsonLibrary.Jackson, Map.class) 
        .to("Log:?level=DEBUG");

        from("direct:getTemplate").to("velocity://dummy");
    }
}

@Named("velocityBean")
static class VelocityBean {
    @Uri("direct:getTemplate")
    private ProducerTemplate template;

    public void process(Exchange exchange) {
        // removed for brevity
    }

}
@Produces
@Named("properties")
// "properties" component bean that Camel uses to lookup properties
PropertiesComponent properties(PropertiesParser parser) {
    PropertiesComponent component = new PropertiesComponent();
    // Use DeltaSpike as configuration source for Camel CDI
    component.setPropertiesParser(parser);
    return component;
}

// PropertiesParser bean that uses DeltaSpike to resolve properties
static class DeltaSpikeParser extends DefaultPropertiesParser {

    @Override
    public String parseProperty(String key, String value, Properties properties) {
        return ConfigResolver.getPropertyValue(key);
    }
}   

}

This is the stack trace:

14:51:37,674 INFO  [org.apache.camel.cdi.CdiCamelExtension] (MSC service thread 1-4) Camel CDI is starting Camel context [OrderNotifications]
14:51:37,680 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-4) Apache Camel 2.18.1 (CamelContext: OrderNotifications) is starting
14:51:37,682 INFO  [org.apache.camel.management.ManagedManagementStrategy] (MSC service thread 1-4) JMX is enabled
14:51:37,821 INFO  [org.apache.camel.impl.DefaultRuntimeEndpointRegistry] (MSC service thread 1-4) Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
14:51:37,827 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-4) Apache Camel 2.18.1 (CamelContext: OrderNotifications) is shutting down
14:51:37,849 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-4) Apache Camel 2.18.1 (CamelContext: OrderNotifications) uptime 0.169 seconds
14:51:37,849 INFO  [org.apache.camel.impl.DefaultCamelContext] (MSC service thread 1-4) Apache Camel 2.18.1 (CamelContext: OrderNotifications) is shutdown in 0.022 seconds
14:51:37,859 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."NotificationService.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."NotificationService.war".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
org.apache.camel.FailedToCreateRouteException: Failed to create route Deep-email-notify-route: Route(Deep-email-notify-route)[[From[no uri or ref supplied!... because of Either 'uri' or 'ref' must be specified on:      org.apache.camel.impl.DefaultRouteContext@55edcc54
at  org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:201)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1008)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3397)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3128)
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:182)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2957)
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2953)
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2976)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2953)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2920)
at org.apache.camel.impl.DefaultCamelContext$Proxy$_$$_WeldClientProxy.start(Unknown Source)
at org.apache.camel.cdi.CdiCamelExtension.afterDeploymentValidation(CdiCamelExtension.java:422)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:271)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:258)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:237)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:174)
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:133)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:107)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:54)
at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:439)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:93)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Either 'uri' or 'ref' must be specified on: org.apache.camel.impl.DefaultRouteContext@55edcc54
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:136)
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:69)
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1051)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:196)
... 35 more

at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:37)
at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:439)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:93)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more

ANSWER

Answered 2017-Jan-24 at 22:01

OOPS. Programmer error! The main issue turned out to be the Endpoint injections.

Instead of @Uri("kafka:...") Endpoint fubar; the injection should have been:

@EndpointInjection(uri = "kafka:...") Endpoint fubar;

Source https://stackoverflow.com/questions/41839262

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install cdi-properties

You can download it from GitHub, Maven.
You can use cdi-properties like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the cdi-properties component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Consider Popular JSON Processing Libraries
Compare JSON Processing Libraries with Highest Support
Compare JSON Processing Libraries with Permissive License
Compare JSON Processing Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.