jboss-weld

Can you get jboss weld to continually scan for newly added classes during development?

hi. i'm setting up a JSF2 project on tomcat 6.0.29 with weld. also using jrebel - not sure if that makes a difference. In testing out JRebel i can see that updating classes that existed when the container was started are handled fine. however, if i ADD a newly defined CDI component class and re-explode the app without restarting the a...

CDI - Observing Container Events

Hi all, I am trying to observe both the startup and shutdown events for a CDI web application. I have an ApplicationScoped bean that listens for those events: @ApplicationScoped public class PrettyfacesStartupObserver { private static final Log LOGGER = LogFactory.getLog(PrettyfacesStartupObserver.class); public PrettyfacesSt...

Can CDI be lessened towards JSE?

JSR-330 dependency injection can be applied to both JSE and JEE environments, while JSR-299 is titled "Contexts and Dependency Injection for the Java EE platform". Except strictly JEE-oriented features, what CDI features make sense on JSE either? Any examples available? Thanks! [Revised] Here's Weld on JSE. ...

Configure Interceptor to be used for ALL CDI-Beans inside an application

In my JEE6-CDI-webapp, i declared a Security Interceptor, like this one: //Secure.java @Inherited @Target({TYPE, METHOD}) @Retention(RUNTIME) @InterceptorBinding public @interface Secure {} //SecurityInterceptor.java @Secure @Interceptor public class SecurityInterceptor { @AroundInvoke protected Object invoke(InvocationContext ...

Weld - Asynchronous Event Observers

Hi all, 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? Thanks, Walter ...

Using CDI (Weld) in Tomcat with simple POJO classes

Hi there After 2 days of debugging and trying I have no other idea than asking you for a solution. I want to use CDI (on JEE6) in a Tomcat WebApp with only simple plain old java objects (yet). As far as I know it is simply possible to inject POJO java classes into other POJO Java classes?! Here are my example classes class ToBeInjec...

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

Hi, 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 AbstractCrudCont...

Useful environment for CDI / weld web-applications

I am new to weld and consider what environment is useful for a web-application using CDI (Weld). I want to use JSF or Wicket for presentation and JPA/Hibernate for my persistence layer (including Transaction-Management). The obvious scenario is to use a JBoss or Glassfish application server with EJB3 surrounding, but is there not a chanc...

Inject list of objects in CDI (Weld)

Let's say I have an interface called SocialNetworkService, and three implementations - TwitterService, FacebookService and FriendFeedService. Now I want, whenever my managed bean (or whatever web component) receives a message, to share it in all social networks. I tried: @Inject private List<SocialNetworkService> socialNetworkServices;...

How to inject external APIs beans with Weld - JSR-299

It's clear to me how to inject an object which is in my domain (I have access to the source) using Weld. You just annotate the implementation with e.g. @Named and @ApplicationScoped, and then annotate the target attribute with @Inject to get the implementation injected. However, not sure how can I inject implementations of classes which...

CDI (Weld) / Seam 3 Persistence module / Glassfish 3 - Unexplainable exception when starting server

Ok, so I've come upon an exception that is starting to frustrate me. Let me set the scene. I am using Weld, Jboss' implementation of CDI. JPA/Hibernate for persistence. For something different I am giving it a crack on Glassfish 3 which I have not used before. I am using Maven for dependency management. Anyway, as CDI doesn't have ...