jboss-weld

Using JAX-RS (RESTEasy) with CDI (Weld) in Tomcat 7

孤人 提交于 2019-12-10 21:04:07
问题 In a JSF 2.0 application (running on Tomcat 7 and using weld 1.1.1.Final), I want to propose my user to download some binary files (.doc, .pdf etc). In order to fulfil that need, I want to use a JAX-RS (RESTEasy 2.2.0.Final) resource bean (annotated with @Path ). The problem is that inside that bean, I want to call a service from a field annotated with @Inject annotation. Actually, like a weld user trying a similar thing I've got a NullPointerException : Weld doesn't inject me my service. So

How to properly use Weld in JavaFX 2 application?

不想你离开。 提交于 2019-12-10 20:23:15
问题 I'm trying to get Weld to work inside my JavaFX 2 (SE) application (or should I say JavaFX inside Weld?). I have controllers which respond to user interaction. Now I would like to inject my services like a database service for example into these controllers. Using Weld this should be as easy as : @Inject private MyService service; Now in order to initialise Weld there are three options. Option 1) public void main(@Observes ContainerInitialized event) { launch(); // start JavaFX } Option 2)

Weld - Asynchronous event observers

跟風遠走 提交于 2019-12-10 14:00:29
问题 I am using Weld to observe events. I thought there was a way to specify if the observer was asynchronous or not, but I am not finding that annotation or documentation. Can observers be asynchronous, if so, what do I need to do to make that happen? 回答1: There is an open request for this: CDI-31: Asynchronous events. Depending on your requirements, you can, as indicated in your comment, set a different transactional observer: If you use AFTER_COMPLETION or AFTER_SUCCESS, it should seem to your

CDI injection is not working in Servlets

為{幸葍}努か 提交于 2019-12-10 12:56:03
问题 I really need your help. I'm working on this problem for weeks or months now. I apologize for the long post, but I want to explain the problem and my settings as precisely as possible. My JAVA EE 6 web application mainly contains 3 Servlets: a javax.faces.webapp.FacesServlet , a StreamingServlet extending javax.servlet.http.HttpServlet and a ClientServlet extending org.eclipse.jetty.websocket.WebSocketServlet . I want to use CDI with these Servlets but it only works for the FacesServlet, to

Bean discovery problems when using weld-se with Gradle application plugin

微笑、不失礼 提交于 2019-12-10 12:32:29
问题 I am building a Gradle-based Java SE application built on top of Hibernate as my ORM of choice. My plan is to use weld-se to be able to use CDI annotations for injections of EntityManagers throughout the application. Based on the common HibernateUtil helper class found in the Hibernate documentation, I moved towards JPA interfaces and added @Produces annotations to provide producer methods (I have added an empty META-INF/beans.xml as well): package dao; import javax.enterprise.inject.Disposes

java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)

不羁的心 提交于 2019-12-10 10:53:36
问题 I'm trying to port an application using Weld 1.1.8 to Google App Engine. I'm using a listener in web.xml to bootstrap Weld: <listener> <listener-class>org.jboss.weld.environment.servlet.Listener</listener-class> </listener> The application starts fine on a regular Jetty 7. But upon bootstrapping on GAE, things go wrong: com.google.common.collect.ComputationException: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers) at com.google.common

Using CDI instead of @ManagedBean: UnproxyableResolutionException because super class has no no-args constructor

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 03:15:03
问题 I'm trying to use CDI for my JSF/Java EE application. I have the following class hierarchy: /** * base controller class * also contains some final methods and an inner enum class declaration */ public abstract class AbstractCrudController<K, E> implements Serializable { private Class<E> entityClass; public AbstractCrudController(Class<E> entityClass) { this.entityClass = entityClass; } // ... } import javax.enterprise.context.SessionScoped; import javax.inject.Named; @Named @SessionScoped

Are CDI event observer methods compatible with EJBs?

守給你的承諾、 提交于 2019-12-10 03:03:30
问题 I have a Singleton EJB (javax.ejb.Singleton version. sigh.) which has a CDI observer method on it. When I try to deploy this to glassfish 3.1 the server fails to deploy the EAR file without any real explanation - simply saying there was an exception during deployment without any more details. SEVERE: Exception while loading the app SEVERE: Exception while shutting down application container .... SEVERE: Exception while shutting down application container : java.lang.NullPointerException This

Is it possible to destroy a CDI scope?

陌路散爱 提交于 2019-12-10 02:36:51
问题 I'm working on a Java EE application, primarily JAX-RS with a JSF admin console, that uses CDI/Weld for dependency injection with javax.enterprise.context.ApplicationScoped objects. Minor debugging issues aside, CDI has worked beautifully for this project. Now I need some very coarse-grained control over CDI-injected object lifecycles. I need the ability to: Remove an injected object from the application context, or Destroy/delete/clear/reset/remove the entire application context, or Define

JSF 1.2 on Wildfly 8 Final - weld-core-jsf is still referencing JSF 2.2 API

主宰稳场 提交于 2019-12-09 00:18:13
问题 I'm currently migrating a JSF-1.2 app to Wildfly 8 Final and am stuck :( First of all, I've read many post with related issues (e.g. https://community.jboss.org/message/845006 or Migrate JSF 1.2 Seam app to WildFly Beta 1) but the proposed solution (excluding the weld subsystem) doesn't work for me. What I did: I followed the multi-jsf feature tutorial here and installed JSF 1.2 as a module for wildfly (to be exact, 3 modules). The next was that I added exclusions for javax.faces.api and com