I deployed my application to JBoss AS 7.1.1.Final and realised that my @Produces annotations were not really producing... But they were working fine with Arquillian.
It was my programming error.
This does not work
@ApplicationScoped
public class TrackMappersFactory {
@EJB
private AudiobookMapper audiobookMapper;
@EJB
private PodcastMapper podcastMapper;
@EJB
private SongMapper songMapper;
@EJB
private VideoMapper videoMapper;
@Produces
@AggregateMapper
public Map<Class<? extends TrackTo>, TrackMapper<? extends TrackTo>> getAggregateTrackMapper() {
The reason why is simple, this class is not detected by the container because it's not an EJB. The solution is to make it a @Singleton bean instead.
This works
@Singleton
public class TrackMappersFactory {
@EJB
private AudiobookMapper audiobookMapper;
@EJB
private PodcastMapper podcastMapper;
@EJB
private SongMapper songMapper;
@EJB
private VideoMapper videoMapper;
@Produces
@AggregateMapper
public Map<Class<? extends TrackTo>, TrackMapper<? extends TrackTo>> getAggregateTrackMapper() {
Here is the
diff for this change.
I feel good about your share. I am so happy to see your blog. Do My Homework Thank you for sharing it with us.
ReplyDeleteVery much like your beloved football crew, you won't ever walk alone when you want task help in liverpool. Our expert task aides will give you all the essential Assignment Done For You help according to your guidelines and will offer extra work to guarantee your task gets appropriate appreciation.
ReplyDeleteThis is it! You can use this service and be raddy for help! Enjoy your life and be rady for this! Check this personal statement writing help help adn go on! Enjoy your life adn be rady for wins! Enjoy your life and be ready for you! Good luck!
ReplyDeleteI sent my application to JBoss AS 7.1.1.Final and understood that my @Produces explanations were not actually creating... Yet, they were turned out great with Arquillian. It was my programming error.The justification for what reason is straightforward, this class isn't identified by the compartment since it's anything but an EJB. The arrangement is to make it a @Singleton bean all things considered. divorce lawyer charlottesville
ReplyDeleteCDI (Contexts and Dependency Injection) is a dependency injection framework used in Java EE (Jakarta EE) applications. Common reasons for CDI issues include missing or incorrect dependencies, CDI not being enabled in your application, incorrect bean scopes or annotations, issues with your application server, inconsistent injection points, scouped beans in non-CDI contexts, version mismatch, and bean discovery mode in beans.xml Registro Central Violencia Doméstica Nueva Jersey.
ReplyDelete
ReplyDeleteWhen @Produces in CDI isn't working, it could be due to ||Middlesex County Trespassing Lawyer||Middlesex County Trespassing Attorney misconfigured injection points or missing beans.xml setup. Ensure the producer method is correctly annotated and the injection context is valid.