Questions tagged [weld2]

Weld 2.x, reference implementation of CDI spec 1.1.

Weld 2.x is a reference implementation of the JSR-346, also known as CDI specification 1.1.
See also the official CDI web.

Besides the implementation of the spec, Weld also offers several own extensions.

28 questions
10
votes
4 answers

How to override a built-in exception mapper in Jersey 2.23?

In one of my projects I've already upgraded Jersey from version 2.14 to 2.23. But I'm struggling many hours with one problem. My project defines its own ExceptionMapper for a ValidationException, but unfortunately Jersey already has a built-in…
G. Demecki
  • 10,145
  • 3
  • 58
  • 58
7
votes
1 answer

Java EE using a producer method yields 'WELD-001408 Unsatisfied dependencies ..' exception

Hy there, I am absolutely fresh to Java EE and CDI. I try to set up a test-project in order to do my first steps with JAX-RS and CDI. I have CDI enabled by providing a beans.xml. As long as I am testing, I use the bean-discovery-mode="all" element.…
user3836334
  • 173
  • 2
  • 7
6
votes
1 answer

Seed value in Weld CDI custom scope

Coming from a Guice background, I know that it is possible to seed an object value from a scope using. scope.seed(Key.get(SomeObject.class), someObject); I suppose one could do this by registering a Bean that gets a value from an…
4
votes
1 answer

Injection into Jersey resource, HK2 doing injection instead of Weld when running in Java SE -> Unsatisfied dependency

I have a simple test-application which I deploy to GlassFish (just one resource having one simple class injected). On GlassFish everything is working fine (except for the exceptions when logging FINE, see here). I can successfully call the resource…
user3836334
  • 173
  • 2
  • 7
3
votes
1 answer

Omnifaces exception on deployment on Tomcat 7

I'm trying to add Omnifaces 2.1 to a web application to use FullAjaxExceptionHandler and possibly other functionality in Omnifaces 2.1. I've read and followed following post by BallusC and am still stuck: How to install and use CDI on Tomcat? Tried…
user1746582
  • 579
  • 1
  • 9
  • 20
2
votes
2 answers

WeldContainer and SeContainer

What is the difference between using: WeldContainer se = new Weld().initialize(); or SeContainer se = SeContainerInitializer.newInstance().initialize(); I just want to use @Injection and @Produce annotations, but I have not found the difference…
lubrum
  • 352
  • 4
  • 21
2
votes
1 answer

Tomcat - WELD workaround for asynchronous requests

I have a REST application implemented with WELD 3.0.5 and RestEasy 3.6.1 running on Tomcat 9. For the asynchronous requests, Tomcat fires the request destroyed event in a different thread than the one that fired the initialized event. In this case,…
b0gusb
  • 4,283
  • 2
  • 14
  • 33
2
votes
1 answer

Is it possible to obtain a reference of containing class (CDI)?

My setup is as below - public class ParentModel { private StatusModel sm; } StatusModel class is as below - public class StatusModel { private ParentModel pm; public void setParentModel(ParentModel pm) { this.pm = pm; …
Tirath
  • 2,294
  • 18
  • 27
2
votes
1 answer

Deltaspike Data (CDI + JPA) Custom PrePersistAuditListener and PreUpdateAuditListener for custom java.time.ChronoLocalDateTime at UTC

Deltaspike Ver 1.7.2 on Wildfly 9.0.2.Final I'm using the JPA @EntityListeners(AuditEntityListener.class) and the audit functionality of Deltaspike Data (@CreatedOn, @ModifiedOn and @ModifiedBy annotations) on an entity bean with the difference…
nicoschl
  • 2,346
  • 1
  • 17
  • 17
2
votes
1 answer

Method validation with Weld and Hibernate Validator

Does anyone know how to get method validation to run when using Weld and Hibernate Validator? My application should be a standalone application, so I'm not using an application server. The @NotNull constraint for the method test in my code below is…
Sun
  • 315
  • 3
  • 8
2
votes
0 answers

Weld 2.0.Final, Tomcat 7 and JSF 2.2

At the moment we use the above combination, with the exception that we are still on JSF 2.1. But I do miss the View Scope very strong in the CDI environment, I tried to update to JSF 2.2 while keeping the rest in place. Now I encountered several…
1
vote
1 answer

Defer TransactionalObserverNotifier fails with ARJUNA016082: Synchronizations are not allowed

I am currently facing an issue when I fire an CDI event through a Hibernate lifecycle listener, and defer the notification until the transaction has succeeded using @Observe(during = ...). This logic works fine in some cases, but there seem some…
1
vote
0 answers

JSF+WELD CDI+EL MethodNotFound from superclass

Environment: Wildfly 9.0.1 JSF: jsf-impl-2.2.11-jbossorg-1 WELD: wildfly-weld-9.0.1 I have this scenario: CustomerController.java public abstract class CustomerController { public String registerCustomer(){ //Do something and return…
maress
  • 3,533
  • 1
  • 19
  • 37
1
vote
0 answers

Associate session bean in application Context

I have session id map and I want to get each session associated with session id. BoundSessionContext is told to use but I could not figure put how to set map value to it. Is there any code sample or another way to achieve getting sessionContext. I m…
fatih
  • 105
  • 9
0
votes
0 answers

What's the last stable version of CDI/Weld we can use with latest Payara 4.x Server?

I use Payara Server 4.1.2.174 #badassfish (build 192) with default CDI/Weld 2.4.5 (Final), but I know there is newest versions of CDI/Weld. Is there a reliable new version of CDI/Weld to work with Payara 4.x? The default version of CDI/Weld has many…
1
2