Hi all,
I have several components which are application scoped. Depending on which environment I am in, I want to install one or the other. In JBoss Seam, I would use @Install(false), then configure the bean that I wanted through components.xml.
Is there a similar method for doing this in CDI / WELD?
Thanks,
Walter
...
I have a few Hibernate Envers listeners which I use for audit purposes. I am just getting started on CDI and so far am pleasantly surprised by its simplicity and power. Since it seems everything is integrating CDI functionality, I thought I'd raise the question, is Hibernate supporting it or will it?
Not only would it be nice to have ...
Hi all,
I am migrating my Seam 2 powered application to CDI and one of the things that is critical for me to retain is the error handling. In Seam 2, I simply replaced the default exception handler with my own, but in CDI, I am guessing I'll have to use an Interceptor.
How would I set this up as using an Interceptor requires me to spe...
I have some problem with using weld logger injection.
Scenario: I have ear with ejb-jar inside.
This is my ejb bean:
@Stateless
@LocalBean
public class PartnersService {
@Inject
Logger log;
@PersistenceContext(unitName = "Utopia")
EntityManager em;
public PartnersService() {
}
public OasysPartnerEntity g...
Scenario:
1) create maven ear project, create war project inside
2) add beans.xml to war project`s WEB-INF/
3) creat simple @Steateless bean
project - http://drp.ly/1j5C3t
ejb bean :
@Stateless
@LocalBean
public class TestEjb {
@Inject
Logger log;
public TestEjb() {
}
@Schedule(hour = "*", minute = "*", secon...
Hi all!
Problem: searching for some more suitable design .
Goal: I want to have table of some user information and with button "change password" in column for each user, after click : "change password" button disappeared (rendered ="false") and a inputSecreat field appeared - user entering the password and submitting it (by clicking ...
[My Setup: Java EE 6 application, with EJB3.1, CDI/Weld, JSF2 running on Glassfish 3.0.1]
I read some articles about the new @Asynchronous methods in EJB3.1, but none of them mentioned the dangers of asynchronous methods and what you really have to care about.
In my app i'm having an @Asynchronous E-Mail service, sending lots of mails...
I have a small yet complete JEE 6 application at hand.
The traditional annotations are being used: @Resource, @EJB, @Singleton, @PostConstruct, @PreDestroy, @PersistenceContext, @ManagedBean, @ManagedProperty, @RequestScope, @ApplicationScope,...
I would like to evaluate whether it makes sense to introduce CDI, and to standardize ...
In a managed bean, @PostConstruct is called after the regular Java object constructor.
Why would I use @PostConstruct to initialize by bean, instead of the regular constructor itself?
...
It is done through some session key that holds some structure?
...
I have a properties file for localization:
foo=Bar
title=Widget Application
This is tied in as a resource-bundle in the faces-config:
<resource-bundle>
<base-name>com.example.messages.messages</base-name>
<var>msgs</var>
</resource-bundle>
I can access this just fine in the facelets view using EL:
<title>#{msgs.title}<...
[UPDATE: After discussion on the Glassfish forums/ML at http://forums.java.net/jive/thread.jspa?messageID=480532 a bug was filed against Glassfish https://glassfish.dev.java.net/issues/show_bug.cgi?id=13040 for this issue.]
I'm trying to inject a local no-interface view of a @Stateless EJB into a JSF2 @Named @javax.enterprise.context.Se...
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...
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...
Is constructor injection supported in GlassFish 3.1's implementation of CDI for managed beans? I have a @Singleton EJB into which I want to inject another managed bean (contained in the same EJB module) using constructor injection. Field injection does work. But with constructor injection I get a NullPointerException from AbstractSinglet...
Hi all,
I am new to Java EE 6 and working on getting a number of demo applications running finally.
I have an application scoped bean that has a @Schedule annotation on it that should in theory trigger that method every minute. However, that method doesn't appear to ever be invoked. It simply writes to the logs that it was called.
C...
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.
...
Hi all,
I have event observers which all observe the same event, so I have an abstract superclass which observes that event and then the subclass overrides / implements the specific functionality.
The problem with this is that it doesn't observe the event unless I put the event observer method in the subclass (which defeats the purpose...
Hello,
I've read some blog articles about Observer pattern implementation on JEE6 and something bother me... I can't find any information atm so i ask there...
I've found the following exemples:
@Stateless
[...]
public class ParisJugService {
@Inject
Event event;
public void helloParis(){
System.out.println("Hello P...
I follow the Weld's doc
in the section 4.11. The InjectionPoint object
There is a very interesting example about how to obtain the http parameter using CDI
but i copy-pasted the code into netbeans, everything compiles, but has an deployment error
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Injection point ...