seam3

Unsatisfied dependencies for type […] with qualifiers [@Default] at injection point (using @Stateful EJB with CDI)

时间秒杀一切 提交于 2019-12-03 23:14:16
I have the following code to manage two kinds of repositories. Both repository classes inherit an interface to allow reinitialization of their resources. public interface CachingRepository { public void invalidateCache(); } Global, application-scoped repo: @Named("globalRepo") @ApplicationScoped public class GlobalRepository implements CachingRepository { private List<Category> categories; ... @Override public void invalidateCache() { categories = null; } ... } Per user, session-scoped repo: @Named("userRepo") @SessionScoped //@Stateful // <- NOTE HERE public class UserRepository implements

Startup POJO On A Weld/Seam3 Application

≡放荡痞女 提交于 2019-12-01 09:33:09
问题 I'm trying to get a POJO starting on startup within my Weld/Seam3 application but not having much luck. I've tried the following but none of them have worked: @Singleton public class StartupJobs { @Inject private Logger log; public void onStartup(@Observes @Initialized ServletContextEvent event) { log.info("Starting startup jobs"); } public void onStartupTwo(@Observes @Initialized WebApplication webApplication) { log.info("Starting startup jobs"); } } - // Guessing this way is no good as I

Configuration to be able to @Inject EntityManager in Seam 3

落花浮王杯 提交于 2019-11-29 15:39:26
问题 In my project I use Seam 3 and I am having issues injecting the EntityManager with the @Inject annotation. I am pretty sure there is some kind of configuration to make sure the EnityManager knows which PersistenceUnit to use. For example with EJB you can type: @PersistenceContext(unitName="MY_PERSISTENCE_UNIT_NAME") private EntityManager eManager; which persistence unit is configured in the persistence.xml file. Here is my pseudo configuration: <?xml version="1.0" encoding="UTF-8"?>

Memory leak with ViewScoped bean?

≡放荡痞女 提交于 2019-11-27 21:38:45
In our JavaEE6 project ( EJB3 , JSF2 ) on JBoss 7.1.1 , it seems we have a memory leak with SeamFaces @ViewScoped . We made a little prototype to check the fact : we use JMeter to call a page 200 times; the page contains and calls a viewscoped bean which injects a stateful EJB; we fix the session timeout at 1 minute. At the end of the test, we check the content of the memory with VisualVM, and here what we got: with a @ViewScoped bean, we still get 200 instances of the stateful MyController - and the @PreDestroy method is never called; with a @ConversationScoped bean, @preDestroy method is

Memory leak with ViewScoped bean?

喜欢而已 提交于 2019-11-26 20:45:01
问题 In our JavaEE6 project ( EJB3 , JSF2 ) on JBoss 7.1.1 , it seems we have a memory leak with SeamFaces @ViewScoped . We made a little prototype to check the fact : we use JMeter to call a page 200 times; the page contains and calls a viewscoped bean which injects a stateful EJB; we fix the session timeout at 1 minute. At the end of the test, we check the content of the memory with VisualVM, and here what we got: with a @ViewScoped bean, we still get 200 instances of the stateful MyController -