Topic
  • 13 replies
  • Latest Post - ‏2011-05-06T13:32:27Z by bnorwood
bnorwood
bnorwood
9 Posts

Pinned topic JSF/JPA question

‏2011-05-04T15:02:01Z |
To start off, I'm a Faces/JPA newbie (been doing Struts 8 years and just swapped). I created a couple of tables in a database, one of which will feed values to dropdowns. I generated the entity and entity mangers using the RAD 8 wizards, and am now trying to populate a dropdown. When I do so, I am getting a NullPointerException on this method from the DropDownManager:

private EntityManager getEntityManager()
{
return emf.createEntityManager();
}

I've done a lot of googling and folks keep saying that you need to inject the entity manager with your framework, but I'm at a loss on how to do this with Faces. Can somebody point me in the right direction?

Thanks

Brian
Updated on 2011-05-06T13:32:27Z at 2011-05-06T13:32:27Z by bnorwood
  • SystemAdmin
    SystemAdmin
    45 Posts

    Re: JSF/JPA question

    ‏2011-05-04T17:58:28Z  
    You probably mean using annotations?

    This presentation may help - Google for "JPA code examples ibm" and choose the IBM link on top.
  • leealber
    leealber
    19 Posts

    Re: JSF/JPA question

    ‏2011-05-04T19:03:23Z  
    Based on JEE spec, "JSF scoped managed bean" supports injection of EntityManagerFactory.

    Try the following:

    @PersistenceUnit(unitName="yourPuName")
    EntityManagerFactory emf;

    .....
    private EntityManager getEntityManager()
    {
    return emf.createEntityManager();
    }

    Albert.
  • sutter
    sutter
    94 Posts

    Re: JSF/JPA question

    ‏2011-05-04T19:05:55Z  
    Hi Brian,
    What version of WebSphere Application Server are you working with? And, what version of JPA and JSF are you working with?

    How and where are you defining your emf variable? You will need to initialize "emf" before using it. You either need to do this via injection, or with explicit code such as Persistence.createEntityManagerFactory(), or via a jndi lookup (not as popular).

    With Java EE 6, which is supported by WebSphere Application Server v8, you should be able to inject a PersistenceUnit (EntityManagerFactory) into a JSF Managed Bean. Something along these lines:

    @ManagedBean
    public class myManagedBean {
    @PersistenceUnit
    EntityManagerFactory emf;
    :
    :
    }

    Prior to Java EE 6 (and JSF 2.0), you might have to revert to the more explicit approach and create the EMF programatically.

    Let's see where you're at before guessing too much...

    Kevin
  • bnorwood
    bnorwood
    9 Posts

    Re: JSF/JPA question

    ‏2011-05-04T19:43:35Z  
    • sutter
    • ‏2011-05-04T19:05:55Z
    Hi Brian,
    What version of WebSphere Application Server are you working with? And, what version of JPA and JSF are you working with?

    How and where are you defining your emf variable? You will need to initialize "emf" before using it. You either need to do this via injection, or with explicit code such as Persistence.createEntityManagerFactory(), or via a jndi lookup (not as popular).

    With Java EE 6, which is supported by WebSphere Application Server v8, you should be able to inject a PersistenceUnit (EntityManagerFactory) into a JSF Managed Bean. Something along these lines:

    @ManagedBean
    public class myManagedBean {
    @PersistenceUnit
    EntityManagerFactory emf;
    :
    :
    }

    Prior to Java EE 6 (and JSF 2.0), you might have to revert to the more explicit approach and create the EMF programatically.

    Let's see where you're at before guessing too much...

    Kevin
    I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    here is my persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    + <persistence-unit name="incidentRpt">+
    + <jta-data-source>jdbc/incRpt</jta-data-source>+
    + +
    + <class>gov.ms.its.isd.jpa.Dropdown</class>+
    + <class>gov.ms.its.isd.jpa.Host</class>+
    + <class>gov.ms.its.isd.jpa.Report</class>+
    + <class>gov.ms.its.isd.jpa.DropdownCat</class>+
    + +
    + <properties>+
    + <property name="openjpa.Log" value="none" />+
    + <property name="openjpa.jdbc.Schema" value="INCRPT" />+
    + <property name="openjpa.jdbc.SynchrnozieMappings" value="buildSchema"/>+
    + </properties>+
    + </persistence-unit>+
    </persistence>

    Here is a snippet of my DropDownManager

    @SuppressWarnings("unchecked")
    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager
    {
    @PersistenceUnit
    private EntityManagerFactory emf;
    @Resource
    private UserTransaction utx;

    public DropdownManager()
    {

    }

    private EntityManager getEntityManager()
    {
    return emf.createEntityManager();
    }
  • bnorwood
    bnorwood
    9 Posts

    Re: JSF/JPA question

    ‏2011-05-04T19:45:47Z  
    • sutter
    • ‏2011-05-04T19:05:55Z
    Hi Brian,
    What version of WebSphere Application Server are you working with? And, what version of JPA and JSF are you working with?

    How and where are you defining your emf variable? You will need to initialize "emf" before using it. You either need to do this via injection, or with explicit code such as Persistence.createEntityManagerFactory(), or via a jndi lookup (not as popular).

    With Java EE 6, which is supported by WebSphere Application Server v8, you should be able to inject a PersistenceUnit (EntityManagerFactory) into a JSF Managed Bean. Something along these lines:

    @ManagedBean
    public class myManagedBean {
    @PersistenceUnit
    EntityManagerFactory emf;
    :
    :
    }

    Prior to Java EE 6 (and JSF 2.0), you might have to revert to the more explicit approach and create the EMF programatically.

    Let's see where you're at before guessing too much...

    Kevin
    I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    here is my persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    + <persistence-unit name="incidentRpt">+
    + <jta-data-source>jdbc/incRpt</jta-data-source>+
    + +
    + <class>gov.ms.its.isd.jpa.Dropdown</class>+
    + <class>gov.ms.its.isd.jpa.Host</class>+
    + <class>gov.ms.its.isd.jpa.Report</class>+
    + <class>gov.ms.its.isd.jpa.DropdownCat</class>+
    + +
    + <properties>+
    + <property name="openjpa.Log" value="none" />+
    + <property name="openjpa.jdbc.Schema" value="INCRPT" />+
    + <property name="openjpa.jdbc.SynchrnozieMappings" value="buildSchema"/>+
    + </properties>+
    + </persistence-unit>+
    </persistence>

    Here is a snippet of my DropDownManager

    @SuppressWarnings("unchecked")
    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager
    {
    + @PersistenceUnit+
    + private EntityManagerFactory emf;+
    + @Resource+
    + private UserTransaction utx;+

    + public DropdownManager()+
    + {+

    + }+

    + private EntityManager getEntityManager()+
    + {+
    + return emf.createEntityManager();+
    + }+

    <<<< Generated stuff for create, update, delete, etc >>>>>>
    <<<<<< Here is the method I'm trying to call >>>>>>>

    + public ArrayList<SelectItem> getDropdownValuesForCategory(int category) throws Exception+
    + {+
    + ArrayList<SelectItem> returnList = new ArrayList<SelectItem>();+
    + int x = 1;+
    + EntityManager em = getEntityManager();+
    + Query query = em.createNamedQuery("getDropdownValues");+
    + query.setParameter("category", category);+
    + ArrayList<Dropdown> myList = (ArrayList<Dropdown>) query.getResultList();+
    + Iterator<Dropdown> it = myList.iterator();+
    + Dropdown tmpDropDown = null;+
    + while(it.hasNext())+
    + {+
    + tmpDropDown = it.next();+
    + System.out.println(tmpDropDown.toString());+
    + }+
    + +
    + return returnList;+
    + }+
    + +
    }

    the getEntityManager() method is what is throwing the null. Does this help clarify any?

    Thanks for the help.
  • SystemAdmin
    SystemAdmin
    45 Posts

    Re: JSF/JPA question

    ‏2011-05-05T13:40:45Z  
    • bnorwood
    • ‏2011-05-04T19:45:47Z
    I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    here is my persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    + <persistence-unit name="incidentRpt">+
    + <jta-data-source>jdbc/incRpt</jta-data-source>+
    + +
    + <class>gov.ms.its.isd.jpa.Dropdown</class>+
    + <class>gov.ms.its.isd.jpa.Host</class>+
    + <class>gov.ms.its.isd.jpa.Report</class>+
    + <class>gov.ms.its.isd.jpa.DropdownCat</class>+
    + +
    + <properties>+
    + <property name="openjpa.Log" value="none" />+
    + <property name="openjpa.jdbc.Schema" value="INCRPT" />+
    + <property name="openjpa.jdbc.SynchrnozieMappings" value="buildSchema"/>+
    + </properties>+
    + </persistence-unit>+
    </persistence>

    Here is a snippet of my DropDownManager

    @SuppressWarnings("unchecked")
    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager
    {
    + @PersistenceUnit+
    + private EntityManagerFactory emf;+
    + @Resource+
    + private UserTransaction utx;+

    + public DropdownManager()+
    + {+

    + }+

    + private EntityManager getEntityManager()+
    + {+
    + return emf.createEntityManager();+
    + }+

    <<<< Generated stuff for create, update, delete, etc >>>>>>
    <<<<<< Here is the method I'm trying to call >>>>>>>

    + public ArrayList<SelectItem> getDropdownValuesForCategory(int category) throws Exception+
    + {+
    + ArrayList<SelectItem> returnList = new ArrayList<SelectItem>();+
    + int x = 1;+
    + EntityManager em = getEntityManager();+
    + Query query = em.createNamedQuery("getDropdownValues");+
    + query.setParameter("category", category);+
    + ArrayList<Dropdown> myList = (ArrayList<Dropdown>) query.getResultList();+
    + Iterator<Dropdown> it = myList.iterator();+
    + Dropdown tmpDropDown = null;+
    + while(it.hasNext())+
    + {+
    + tmpDropDown = it.next();+
    + System.out.println(tmpDropDown.toString());+
    + }+
    + +
    + return returnList;+
    + }+
    + +
    }

    the getEntityManager() method is what is throwing the null. Does this help clarify any?

    Thanks for the help.
    It looks like injection failed - the JPAManager bean is a valid target, and your config looks correct.

    Could you try specifying the name of the persistence unit on your annotation :
    @PersistenceUnit(unitName="incidentRpt")
    private EntityManagerFactory emf;

    -mike
  • sutter
    sutter
    94 Posts

    Re: JSF/JPA question

    ‏2011-05-05T13:54:50Z  
    • bnorwood
    • ‏2011-05-04T19:45:47Z
    I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    here is my persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    + <persistence-unit name="incidentRpt">+
    + <jta-data-source>jdbc/incRpt</jta-data-source>+
    + +
    + <class>gov.ms.its.isd.jpa.Dropdown</class>+
    + <class>gov.ms.its.isd.jpa.Host</class>+
    + <class>gov.ms.its.isd.jpa.Report</class>+
    + <class>gov.ms.its.isd.jpa.DropdownCat</class>+
    + +
    + <properties>+
    + <property name="openjpa.Log" value="none" />+
    + <property name="openjpa.jdbc.Schema" value="INCRPT" />+
    + <property name="openjpa.jdbc.SynchrnozieMappings" value="buildSchema"/>+
    + </properties>+
    + </persistence-unit>+
    </persistence>

    Here is a snippet of my DropDownManager

    @SuppressWarnings("unchecked")
    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager
    {
    + @PersistenceUnit+
    + private EntityManagerFactory emf;+
    + @Resource+
    + private UserTransaction utx;+

    + public DropdownManager()+
    + {+

    + }+

    + private EntityManager getEntityManager()+
    + {+
    + return emf.createEntityManager();+
    + }+

    <<<< Generated stuff for create, update, delete, etc >>>>>>
    <<<<<< Here is the method I'm trying to call >>>>>>>

    + public ArrayList<SelectItem> getDropdownValuesForCategory(int category) throws Exception+
    + {+
    + ArrayList<SelectItem> returnList = new ArrayList<SelectItem>();+
    + int x = 1;+
    + EntityManager em = getEntityManager();+
    + Query query = em.createNamedQuery("getDropdownValues");+
    + query.setParameter("category", category);+
    + ArrayList<Dropdown> myList = (ArrayList<Dropdown>) query.getResultList();+
    + Iterator<Dropdown> it = myList.iterator();+
    + Dropdown tmpDropDown = null;+
    + while(it.hasNext())+
    + {+
    + tmpDropDown = it.next();+
    + System.out.println(tmpDropDown.toString());+
    + }+
    + +
    + return returnList;+
    + }+
    + +
    }

    the getEntityManager() method is what is throwing the null. Does this help clarify any?

    Thanks for the help.
    Hi Brian,
    This might be a dumb question, but are you running with the OSGi/JPA 2.0 Feature Pack? Your note said this:

    > I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    Base WAS v7 does not support JPA 2.0. So, if you running with base WAS v7 that would probably explain why the runtime is having issues with creating the EMF. If you don't have the Feature Pack installed, then try changing the versions in the header of the persistence.xml to 1.0 and see if the injection works better.

    If you are running with the JPA 2.0 Feature Pack, then you can ignore this rambling... :-)

    Good luck,
    Kevin
  • bnorwood
    bnorwood
    9 Posts

    Re: JSF/JPA question

    ‏2011-05-05T14:35:33Z  
    It looks like injection failed - the JPAManager bean is a valid target, and your config looks correct.

    Could you try specifying the name of the persistence unit on your annotation :
    @PersistenceUnit(unitName="incidentRpt")
    private EntityManagerFactory emf;

    -mike
    Hey Mike,

    Thanks for helping me on this. I tried what you suggested, but still get a NullPointerException in that getEntityManger method.

    Caused by: java.lang.NullPointerException
    at gov.ms.its.isd.jpa.controller.DropdownManager.getEntityManager(DropdownManager.java:37)
    at gov.ms.its.isd.jpa.controller.DropdownManager.getDropdownValuesForCategory(DropdownManager.java:164)
    at gov.ms.its.isd.DropDownCache.getProtocolList(DropDownCache.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:273)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:102)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:263)
    at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:100)
    ... 51 more

    Any other suggestions of what I can try?
  • bnorwood
    bnorwood
    9 Posts

    Re: JSF/JPA question

    ‏2011-05-05T14:36:26Z  
    • sutter
    • ‏2011-05-05T13:54:50Z
    Hi Brian,
    This might be a dumb question, but are you running with the OSGi/JPA 2.0 Feature Pack? Your note said this:

    > I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    Base WAS v7 does not support JPA 2.0. So, if you running with base WAS v7 that would probably explain why the runtime is having issues with creating the EMF. If you don't have the Feature Pack installed, then try changing the versions in the header of the persistence.xml to 1.0 and see if the injection works better.

    If you are running with the JPA 2.0 Feature Pack, then you can ignore this rambling... :-)

    Good luck,
    Kevin
    Hey Kevin,

    Yes, I should have mentioned that I was running the OSGi/JPA 2 feature pack. Thanks for your help.

    Brian
  • sutter
    sutter
    94 Posts

    Re: JSF/JPA question

    ‏2011-05-05T14:58:56Z  
    • bnorwood
    • ‏2011-05-05T14:35:33Z
    Hey Mike,

    Thanks for helping me on this. I tried what you suggested, but still get a NullPointerException in that getEntityManger method.

    Caused by: java.lang.NullPointerException
    at gov.ms.its.isd.jpa.controller.DropdownManager.getEntityManager(DropdownManager.java:37)
    at gov.ms.its.isd.jpa.controller.DropdownManager.getDropdownValuesForCategory(DropdownManager.java:164)
    at gov.ms.its.isd.DropDownCache.getProtocolList(DropDownCache.java:22)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:600)
    at javax.el.BeanELResolver.getValue(BeanELResolver.java:273)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:102)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:263)
    at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:100)
    ... 51 more

    Any other suggestions of what I can try?
    Hi Brian,
    Like Mike mentioned, it looks like there's a problem with the injection. Normally, when there's a problem with creating an EMF and injecting the instance, then an FFDC log (or two or three) are generated. Can you check if there are any FFDC logs that might hint at the problem? If no FFDC logs were generated by this event, then we'll probably have to turn on some Trace.

    Thanks,
    Kevin
  • leealber
    leealber
    19 Posts

    Re: JSF/JPA question

    ‏2011-05-05T15:00:41Z  
    • bnorwood
    • ‏2011-05-04T19:45:47Z
    I'm using JPA 2.0 and JSF 1.2 (in RAD 8 on WAS 7).

    here is my persistence.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    + <persistence-unit name="incidentRpt">+
    + <jta-data-source>jdbc/incRpt</jta-data-source>+
    + +
    + <class>gov.ms.its.isd.jpa.Dropdown</class>+
    + <class>gov.ms.its.isd.jpa.Host</class>+
    + <class>gov.ms.its.isd.jpa.Report</class>+
    + <class>gov.ms.its.isd.jpa.DropdownCat</class>+
    + +
    + <properties>+
    + <property name="openjpa.Log" value="none" />+
    + <property name="openjpa.jdbc.Schema" value="INCRPT" />+
    + <property name="openjpa.jdbc.SynchrnozieMappings" value="buildSchema"/>+
    + </properties>+
    + </persistence-unit>+
    </persistence>

    Here is a snippet of my DropDownManager

    @SuppressWarnings("unchecked")
    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager
    {
    + @PersistenceUnit+
    + private EntityManagerFactory emf;+
    + @Resource+
    + private UserTransaction utx;+

    + public DropdownManager()+
    + {+

    + }+

    + private EntityManager getEntityManager()+
    + {+
    + return emf.createEntityManager();+
    + }+

    <<<< Generated stuff for create, update, delete, etc >>>>>>
    <<<<<< Here is the method I'm trying to call >>>>>>>

    + public ArrayList<SelectItem> getDropdownValuesForCategory(int category) throws Exception+
    + {+
    + ArrayList<SelectItem> returnList = new ArrayList<SelectItem>();+
    + int x = 1;+
    + EntityManager em = getEntityManager();+
    + Query query = em.createNamedQuery("getDropdownValues");+
    + query.setParameter("category", category);+
    + ArrayList<Dropdown> myList = (ArrayList<Dropdown>) query.getResultList();+
    + Iterator<Dropdown> it = myList.iterator();+
    + Dropdown tmpDropDown = null;+
    + while(it.hasNext())+
    + {+
    + tmpDropDown = it.next();+
    + System.out.println(tmpDropDown.toString());+
    + }+
    + +
    + return returnList;+
    + }+
    + +
    }

    the getEntityManager() method is what is throwing the null. Does this help clarify any?

    Thanks for the help.
    The NPE is caused by there is no injection to the emf. Let's focus on the injection.

    In general, injection only apply to "managed bean", e.g. EJB session beans, servlet etc..

    You have a Java class DropdownManager:

    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager {
    @PersistenceUnit(unitName="incidentRp")
    private EntityManagerFactory emf;

    Is this class a "managed bean" type? i.e Is this class defined in "faces-config.xml" like ?

    <managed-bean>
    <managed-bean-name>DropdownManager </managed-bean-name>
    <managed-bean-class>gov.ms.its.isd.jpa.DropdownManager</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>propName</property-name>
    <value>provValue</value>
    </managed-property>
    </managed-bean>

    Albert.
  • bnorwood
    bnorwood
    9 Posts

    Re: JSF/JPA question

    ‏2011-05-05T18:00:31Z  
    • leealber
    • ‏2011-05-05T15:00:41Z
    The NPE is caused by there is no injection to the emf. Let's focus on the injection.

    In general, injection only apply to "managed bean", e.g. EJB session beans, servlet etc..

    You have a Java class DropdownManager:

    @JPAManager(targetEntity = gov.ms.its.isd.jpa.Dropdown.class)
    public class DropdownManager {
    @PersistenceUnit(unitName="incidentRp")
    private EntityManagerFactory emf;

    Is this class a "managed bean" type? i.e Is this class defined in "faces-config.xml" like ?

    <managed-bean>
    <managed-bean-name>DropdownManager </managed-bean-name>
    <managed-bean-class>gov.ms.its.isd.jpa.DropdownManager</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>propName</property-name>
    <value>provValue</value>
    </managed-property>
    </managed-bean>

    Albert.
    Hey Albert,

    This code was generated by RAD and in the faces-config

    <managed-bean>
    <managed-bean-name>DropdownManager</managed-bean-name>
    <managed-bean-class>gov.ms.its.isd.jpa.controller.DropdownManager</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
  • bnorwood
    bnorwood
    9 Posts

    Re: JSF/JPA question

    ‏2011-05-06T13:32:27Z  
    • bnorwood
    • ‏2011-05-05T18:00:31Z
    Hey Albert,

    This code was generated by RAD and in the faces-config

    <managed-bean>
    <managed-bean-name>DropdownManager</managed-bean-name>
    <managed-bean-class>gov.ms.its.isd.jpa.controller.DropdownManager</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    Ok guys. Ready for the weirdest fix ever. I got tired of screwing around with this, and created a new workspace, generated the entities and entitymanagers again and it all started working. I don't think I did it any different than the first time. Anyway, it is working now. Thanks for all your help.