-
1. Re: How to produces EntityManager used in SessionScoped Bean
andyc.andy.chen.zhen.gmail.com Oct 20, 2009 7:19 PM (in response to andyc.andy.chen.zhen.gmail.com)In fact, I got a
javax.enterprise.inject.IllegalProductException: The bean org.jboss.weld.bean-flat-ManagedBean-com.myweb.managed.Login declares a passivating scope but the producer returned a non-serializable bean for injection: org.jboss.weld.bean-flat-ProducerField-com.myweb.managed.Databases.userDatabaseEntityManager -
2. Re: How to produces EntityManager used in SessionScoped Bean
gavin.king Oct 21, 2009 3:14 PM (in response to andyc.andy.chen.zhen.gmail.com)Please show us the code.
-
3. Re: How to produces EntityManager used in SessionScoped Bean
andyc.andy.chen.zhen.gmail.com Oct 21, 2009 3:39 PM (in response to andyc.andy.chen.zhen.gmail.com)Hi Gavin, Thanks for your replay.
Here is the code
@Stateful @SessionScoped @Model
public class Login implements Serializable {
/**
*
*/
private static final long serialVersionUID = 5992987551047430691L;
@Inject Credentials credentials;
@Inject @Users EntityManager em;
...
}public class Databases implements Serializable {
/**
*
*/
private static final long serialVersionUID = 3767599890213709880L;
@Produces @PersistenceContext(unitName="myweb") @Users
EntityManager userDatabaseEntityManager;
...
} -
4. Re: How to produces EntityManager used in SessionScoped Bean
andyc.andy.chen.zhen.gmail.com Oct 21, 2009 3:41 PM (in response to andyc.andy.chen.zhen.gmail.com)Hi Gavin, Thanks for your replay.
Here is the code
@Stateful @SessionScoped @Model public class Login implements Serializable { /** * */ private static final long serialVersionUID = 5992987551047430691L; @Inject Credentials credentials; @Inject @Users EntityManager em; ... } public class Databases implements Serializable { /** * */ private static final long serialVersionUID = 3767599890213709880L; @Produces @PersistenceContext(unitName="myweb") @Users EntityManager userDatabaseEntityManager; ... }
-
5. Re: How to produces EntityManager used in SessionScoped Bean
gavin.king Oct 21, 2009 3:46 PM (in response to andyc.andy.chen.zhen.gmail.com)The code looks fine to me. Submit a bug report.
-
6. Re: How to produces EntityManager used in SessionScoped Bean
andyc.andy.chen.zhen.gmail.com Oct 22, 2009 4:10 PM (in response to andyc.andy.chen.zhen.gmail.com)When will this be fixed? Which release version?
Or I just download fixed code from SVN, and compile it by myself?I am trying to use Weld (Web beans) + JSF2.0 + JPA to develop a web site.
In web beans preview version, I got another transaction problem when I call em.persist. There are neither SQL output nor errors.
Maybe I have to wait a while for stable, bug less version.
-
7. Re: How to produces EntityManager used in SessionScoped Bean
gavin.king Oct 22, 2009 4:15 PM (in response to andyc.andy.chen.zhen.gmail.com)Pete is on vacation for a week, so please sit tight until he gets back.
-
8. Re: How to produces EntityManager used in SessionScoped Bean
pmuir Oct 29, 2009 1:48 PM (in response to andyc.andy.chen.zhen.gmail.com)Hi, please make sure to submit an issue for this in JIRA. Please attach classes sufficient to reproduce the problem.