weld

How can I enable CDI with Jersey Test Framework?

自闭症网瘾萝莉.ら 提交于 2019-12-04 12:48:44
I found How can I inject a data source dependency into a RESTful web service with Jersey (Test Framework)? but I think I'm gonna ask a little bit different question. This is a follow-up question of @PostConstruct of abstract ancestors are not invoked I wrote a JAX-RS library and I'm trying to unit-test with Jersey Test Framework . I seems HK2 injects properly. But I found some of my life cycle interceptor method annotated with @PostConstruct or @PreDestroy aren't invoked (or only some invoked). public class MyResource { @PostConstruct private void constructed() { // not invoked } @Inject

ZetCode Servlet 教程

别等时光非礼了梦想. 提交于 2019-12-04 06:21:19
来源: ApacheCN ZetCode 翻译项目 译者: 飞龙 协议: CC BY-NC-SA 4.0 贡献指南 本项目需要校对,欢迎大家提交 Pull Request。 请您勇敢地去翻译和改进翻译。虽然我们追求卓越,但我们并不要求您做到十全十美,因此请不要担心因为翻译上犯错——在大部分情况下,我们的服务器已经记录所有的翻译,因此您不必担心会因为您的失误遭到无法挽回的破坏。(改编自维基百科) 目录 从 Java Servlet 提供纯文本 Java Servlet JSON 教程 Java Servlet HTTP 标头 Java Servlet 复选框教程 Java servlet 发送图像教程 Java Servlet JQuery 列表教程 Servlet FreeMarker JdbcTemplate 教程-CRUD 操作 jQuery 自动补全教程 Java servlet PDF 教程 servlet 从 WAR 内读取 CSV 文件 Java HttpServletMapping EasyUI datagrid Java Servlet RESTFul 客户端 Java Servlet Log4j 教程 Java Servlet 图表教程 Java ServletConfig 教程 Java Servlet 读取网页 嵌入式 Tomcat Java Servlet

WELD + GF4 + SessionScoped: Sometimes wrong bean?

人盡茶涼 提交于 2019-12-03 13:06:10
问题 TL;DR We get @SessionScoped bean instances injected that have the content of another session lately we have been experiencing serious problems with two of our customer systems. Our customers are running two independent instances of the same JSF 2.2 application on two machines having a Glassfish 4.0 Server with WELD 2.0.5 (hail to the memory leak!). Some users have been reporting problems that after e.g. submitting a form the response shows another user name than the one who initially logged

org.jboss.weld.exceptions.IllegalStateException: WELD-000227 after every change in code

蹲街弑〆低调 提交于 2019-12-03 10:44:57
I'm developing a webapp with NetBeans and Glassfish 4.1.1. and I'm using JSF and CDI to manage the backing beans for the facelets. Since shortly after changing anything in the code I always get an Internal Server Error with this IllegalStateException after 'successful' deploying and running the app via the browser: org.jboss.weld.exceptions.IllegalStateException: WELD-000227: Bean identifier index inconsistency detected - the distributed container probably does not work with identical applications I can get rid of it by doing a clean & build and redeploying. But NetBeans is redeploying

WELD + GF4 + SessionScoped: Sometimes wrong bean?

这一生的挚爱 提交于 2019-12-03 04:10:27
TL;DR We get @SessionScoped bean instances injected that have the content of another session lately we have been experiencing serious problems with two of our customer systems. Our customers are running two independent instances of the same JSF 2.2 application on two machines having a Glassfish 4.0 Server with WELD 2.0.5 (hail to the memory leak!). Some users have been reporting problems that after e.g. submitting a form the response shows another user name than the one who initially logged in. Since we were unable to reproduce this behaviour in our development and testing environments, we

WELD-001519 An InjectionTarget implementation is created for an abstract class 'xxx'. It will not be possible to produce instances of this type

删除回忆录丶 提交于 2019-12-01 18:16:42
I'm running an application in the following environment. GlassFish Server 4.0 Mojarra 2.2.4 PrimeFaces 4.0 final PrimeFaces Extension 1.1.0 OmniFaces 1.6.3 After adding OmniFaces, the following warnings appear on the server terminal. WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.eventlistener.DefaultServletContextListener. It will not be possible to produce instances of this type! WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class org.omnifaces.filter.HttpFilter. It will not be possible to produce

CDI Extensions - Add Interceptors in ProcessAnnotatedType phase

核能气质少年 提交于 2019-12-01 13:18:39
I am trying to add an interceptor programatically. The interceptor is called LogginInterceptor and just logs the name of method it runs on. When using it with annotation @Interceptors(LogginInterceptor.class) on a method, everything works fine. I am however trying to create CDI Extension that adds this @Interceptors(LogginInterceptor) annotation programatically to every method of a certain class (to be simple). So, try it, I've created class Hello with few methods. When these methods are annotated manually, the LogginInterceptor works and prints the name of the method. However, my code to add

CDI Extensions - Add Interceptors in ProcessAnnotatedType phase

▼魔方 西西 提交于 2019-12-01 10:38:19
问题 I am trying to add an interceptor programatically. The interceptor is called LogginInterceptor and just logs the name of method it runs on. When using it with annotation @Interceptors(LogginInterceptor.class) on a method, everything works fine. I am however trying to create CDI Extension that adds this @Interceptors(LogginInterceptor) annotation programatically to every method of a certain class (to be simple). So, try it, I've created class Hello with few methods. When these methods are

Weld cannot find CDI producer method in library jar

时光毁灭记忆、已成空白 提交于 2019-12-01 07:44:22
问题 Using Wildfly 8.2.0.Final, which I believe uses Weld 2.2, I've reproduced this issue with 2 simple classes in a Maven multimodule project. One produces a javax.ws.rs.client.Client , another has an injection point for the same. Arquillian deployment fails with WELD-001408 : unsatisfied dependencies. The producer is in a library jar that gets included in the WEB-INF/lib for the consumer. Producer has a beans.xml in the META-INF with discovery-mode=annotation and the consumer has one in WEB-INF

CDI deployment failure:WELD-001414 Bean name is ambiguous

青春壹個敷衍的年華 提交于 2019-12-01 04:09:56
I have an application, which has multiple modules and various dependencies. When I deploy the application on Glassfish 4, I am getting error: org.jboss.weld.exceptions.DeploymentException: WELD-001414 Bean name is ambiguous. Name JerseyClassAnalyzer resolves to beans: [Managed Bean [class org.glassfish.jersey.internal.inject.JerseyClassAnalyzer] with qualifiers [@Default @Named @Any], Managed Bean [class org.glassfish.jersey.internal.inject.JerseyClassAnalyzer] with qualifiers [@Default @Named @Any]] What can be the cause? I saw already topics about this and the solution was to edit the