You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mauro2java2011 <ma...@gmail.com> on 2014/01/29 19:10:59 UTC

problem with jsf crud application :how resolve?

i have deployed a jsf crud application. 

Into glassfsih i t work , but from tomee i get the following problems:

WARNING: Detected the following possible violations of the restrictions
placed on property access persistent types:
"jpa.entities.ClientPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "equals" defined in
"jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "hashCode" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "equals" defined in
"jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "toString" defined
in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "toString" defined in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "hashCode" defined
in "jpa.entities.ClientPK".
"jpa.entities.ClientPK" uses property access, but its field "clientName" is
accessed directly in method "hashCode" defined in "jpa.entities.ClientPK".
gen 29, 2014 7:06:19 PM null
WARNING: Detected the following possible violations of the restrictions
placed on property access persistent types:
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "hashCode" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "hashCode" defined
in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "hashCode" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "toString" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "hashCode" defined in
"jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "equals" defined in
"jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "toString" defined
in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "clientName" is
accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "toString" defined in
"jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field "projectName"
is accessed directly in method "hashCode" defined in
"jpa.entities.ProjectPK".
"jpa.entities.ProjectPK" uses property access, but its field
"clientDepartmentNumber" is accessed directly in method "equals" defined in
"jpa.entities.ProjectPK".
gen 29, 2014 7:06:19 PM org.apache.openejb.cdi.OpenEJBLifecycle
startApplication
SEVERE: CDI Beans module deployment failed
org.apache.webbeans.exception.inject.DeploymentException:
org.apache.webbeans.exception.WebBeansConfigurationException: Passivation
scoped defined bean must be passivation capable, but bean :
BillableController, Name:billableController, WebBeans Type:MANAGED, API
Types:[jsf.BillableController,java.lang.Object],
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
is not passivation capable




--
View this message in context: http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: problem with jsf crud application :how resolve?

Posted by mauro2java2011 <ma...@gmail.com>.
Ok i have added implements Serializable . It work.

I think that the controller i have to make it RequestScoped.
 Il giorno 30/gen/2014 00.51, "Anthony Fryer [via OpenEJB]" <
ml-node+s979440n4667354h49@n4.nabble.com> ha scritto:

> As Romain said, make BillableController implement Serializable so it can
> be passivated if required.
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346p4667354.html
>  To unsubscribe from problem with jsf crud application :how resolve?, click
> here<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4667346&code=bWF1cm8yamF2YTIwMTFAZ21haWwuY29tfDQ2NjczNDZ8LTExMTcxODc2MjU=>
> .
> NAML<http://openejb.979440.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346p4667358.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: problem with jsf crud application :how resolve?

Posted by Anthony Fryer <ap...@hotmail.com>.
As Romain said, make BillableController implement Serializable so it can be
passivated if required.



--
View this message in context: http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346p4667354.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: problem with jsf crud application :how resolve?

Posted by mauro2java2011 <ma...@gmail.com>.
the billable controller
package jsf;

import jpa.entities.Billable;
import jsf.util.JsfUtil;
import jsf.util.PaginationHelper;
import jpa.session.BillableFacade;

import java.util.ResourceBundle;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
import javax.faces.model.SelectItem;

@ManagedBean (name="billableController")
@SessionScoped
public class BillableController {

    private Billable current;
    private DataModel items = null;
    @EJB private jpa.session.BillableFacade ejbFacade;
    private PaginationHelper pagination;
    private int selectedItemIndex;

    public BillableController() {
    }

    public Billable getSelected() {
        if (current == null) {
            current = new Billable();
            selectedItemIndex = -1;
        }
        return current;
    }

    private BillableFacade getFacade() {
        return ejbFacade;
    }

    public PaginationHelper getPagination() {
        if (pagination == null) {
            pagination = new PaginationHelper(10) {

                @Override
                public int getItemsCount() {
                    return getFacade().count();
                }

                @Override
                public DataModel createPageDataModel() {
                    return new ListDataModel(getFacade().findRange(new
int[]{getPageFirstItem(), getPageFirstItem()+getPageSize()}));
                }
            };
        }
        return pagination;
    }

    public String prepareList() {
        recreateModel();
        return "List";
    }

    public String prepareView() {
        current = (Billable)getItems().getRowData();
        selectedItemIndex = pagination.getPageFirstItem() +
getItems().getRowIndex();
        return "View";
    }

    public String prepareCreate() {
        current = new Billable();
        selectedItemIndex = -1;
        return "Create";
    }

    public String create() {
        try {
            getFacade().create(current);
           
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/resources/Bundle").getString("BillableCreated"));
            return prepareCreate();
        } catch (Exception e) {
            JsfUtil.addErrorMessage(e,
ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));
            return null;
        }
    }

    public String prepareEdit() {
        current = (Billable)getItems().getRowData();
        selectedItemIndex = pagination.getPageFirstItem() +
getItems().getRowIndex();
        return "Edit";
    }

    public String update() {
        try {
            getFacade().edit(current);
           
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/resources/Bundle").getString("BillableUpdated"));
            return "View";
        } catch (Exception e) {
            JsfUtil.addErrorMessage(e,
ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));
            return null;
        }
    }

    public String destroy() {
        current = (Billable)getItems().getRowData();
        selectedItemIndex = pagination.getPageFirstItem() +
getItems().getRowIndex();
        performDestroy();
        recreateModel();
        return "List";
    }

    public String destroyAndView() {
        performDestroy();
        recreateModel();
        updateCurrentItem();
        if (selectedItemIndex >= 0) {
            return "View";
        } else {
            // all items were removed - go back to list
            recreateModel();
            return "List";
        }
    }

    private void performDestroy() {
        try {
            getFacade().remove(current);
           
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/resources/Bundle").getString("BillableDeleted"));
        } catch (Exception e) {
            JsfUtil.addErrorMessage(e,
ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));
        }
    }

    private void updateCurrentItem() {
        int count = getFacade().count();
        if (selectedItemIndex >= count) {
            // selected index cannot be bigger than number of items:
            selectedItemIndex = count-1;
            // go to previous page if last page disappeared:
            if (pagination.getPageFirstItem() >= count) {
                pagination.previousPage();
            }
        }
        if (selectedItemIndex >= 0) {
            current = getFacade().findRange(new int[]{selectedItemIndex,
selectedItemIndex+1}).get(0);
        }
    }

    public DataModel getItems() {
        if (items == null) {
            items = getPagination().createPageDataModel();
        }
        return items;
    }

    private void recreateModel() {
        items = null;
    }

    public String next() {
        getPagination().nextPage();
        recreateModel();
        return "List";
    }

    public String previous() {
        getPagination().previousPage();
        recreateModel();
        return "List";
    }

    public SelectItem[] getItemsAvailableSelectMany() {
        return JsfUtil.getSelectItems(ejbFacade.findAll(), false);
    }

    public SelectItem[] getItemsAvailableSelectOne() {
        return JsfUtil.getSelectItems(ejbFacade.findAll(), true);
    }

    @FacesConverter(forClass=Billable.class)
    public static class BillableControllerConverter implements Converter {

        public Object getAsObject(FacesContext facesContext, UIComponent
component, String value) {
            if (value == null || value.length() == 0) {
                return null;
            }
            BillableController controller =
(BillableController)facesContext.getApplication().getELResolver().
                    getValue(facesContext.getELContext(), null,
"billableController");
            return controller.ejbFacade.find(getKey(value));
        }

        java.lang.Long getKey(String value) {
            java.lang.Long key;
            key = Long.valueOf(value);
            return key;
        }

        String getStringKey(java.lang.Long value) {
            StringBuffer sb = new StringBuffer();
            sb.append(value);
            return sb.toString();
        }

        public String getAsString(FacesContext facesContext, UIComponent
component, Object object) {
            if (object == null) {
                return null;
            }
            if (object instanceof Billable) {
                Billable o = (Billable) object;
                return getStringKey(o.getBillableId());
            } else {
                throw new IllegalArgumentException("object " + object + " is
of type " + object.getClass().getName() + "; expected type:
"+BillableController.class.getName());
            }
        }

    }

}




--
View this message in context: http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346p4667352.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: problem with jsf crud application :how resolve?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You need to implements serializable.

the warning are not that important and more on bad practise side of coding,
just sthg ignored by eclipselink

Le mercredi 29 janvier 2014, Thiago Veronezi <th...@veronezi.org> a écrit :
> Don't forget to share a bit of code. How do you implement
> BillableController?
> Check the specification [
> http://download.oracle.com/otndocs/jcp/web_beans-1.0-fr-eval-oth-JSpec/ -
> "Passivation and passivating scopes"]. It may give you some tips.
>
> []s,
> Thiago.
>
>
>
> On Wed, Jan 29, 2014 at 1:10 PM, mauro2java2011 <mauro2java2011@gmail.com
>wrote:
>
>> i have deployed a jsf crud application.
>>
>> Into glassfsih i t work , but from tomee i get the following problems:
>>
>> WARNING: Detected the following possible violations of the restrictions
>> placed on property access persistent types:
>> "jpa.entities.ClientPK" uses property access, but its field
>> "clientDepartmentNumber" is accessed directly in method "equals" defined
in
>> "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "hashCode" defined in
"jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field
>> "clientDepartmentNumber" is accessed directly in method "equals" defined
in
>> "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field
>> "clientDepartmentNumber" is accessed directly in method "toString"
defined
>> in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "toString" defined in
"jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field
>> "clientDepartmentNumber" is accessed directly in method "hashCode"
defined
>> in "jpa.entities.ClientPK".
>> "jpa.entities.ClientPK" uses property access, but its field "clientName"
is
>> accessed directly in method "hashCode" defined in
"jpa.entities.ClientPK".
>> gen 29, 2014 7:06:19 PM null
>> WARNING: Detected the following possible violations of the restrictions
>> placed on property access persistent types:
>> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
>> is
>> accessed directly in method "hashCode" defined in
"jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field
>> "clientDepartmentNumber" is accessed directly in method "hashCode"
defined
>> in "jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
>> is
>> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
>> is
>> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
>> is
>> accessed directly in method "hashCode" defined in
"jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
>> is
>> accessed directly in method "toString" defined in
"jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
>> is
>> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field
"projectName"
>> is accessed directly in method "equals" defined in
>> "jpa.entities.ProjectPK".
>> "jpa.entities.ProjectPK" uses property access, but its field
"projectName"
>> is accessed directly in method "hashCode" defined in
>> "jpa.

-- 
*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau
<http://fr.linkedin.com/in/rmannibucau>*
*Github: https://github.com/rmannibucau <https://github.com/rmannibucau>*

Re: problem with jsf crud application :how resolve?

Posted by mauro2java2011 <ma...@gmail.com>.
the billable controllerpackage jsf;import jpa.entities.Billable;import
jsf.util.JsfUtil;import jsf.util.PaginationHelper;import
jpa.session.BillableFacade;import java.util.ResourceBundle;import
javax.ejb.EJB;import javax.faces.bean.ManagedBean;import
javax.faces.bean.SessionScoped;import
javax.faces.component.UIComponent;import
javax.faces.context.FacesContext;import javax.faces.convert.Converter;import
javax.faces.convert.FacesConverter;import javax.faces.model.DataModel;import
javax.faces.model.ListDataModel;import
javax.faces.model.SelectItem;@ManagedBean
(name="billableController")@SessionScopedpublic class BillableController {   
private Billable current;    private DataModel items = null;    @EJB private
jpa.session.BillableFacade ejbFacade;    private PaginationHelper
pagination;    private int selectedItemIndex;    public BillableController()
{    }    public Billable getSelected() {        if (current == null) {           
current = new Billable();            selectedItemIndex = -1;        }       
return current;    }    private BillableFacade getFacade() {        return
ejbFacade;    }    public PaginationHelper getPagination() {        if
(pagination == null) {            pagination = new PaginationHelper(10) {               
@Override                public int getItemsCount() {                   
return getFacade().count();                }                @Override               
public DataModel createPageDataModel() {                    return new
ListDataModel(getFacade().findRange(new int[]{getPageFirstItem(),
getPageFirstItem()+getPageSize()}));                }            };        }       
return pagination;    }    public String prepareList() {       
recreateModel();        return "List";    }    public String prepareView() {       
current = (Billable)getItems().getRowData();        selectedItemIndex =
pagination.getPageFirstItem() + getItems().getRowIndex();        return
"View";    }    public String prepareCreate() {        current = new
Billable();        selectedItemIndex = -1;        return "Create";    }   
public String create() {        try {           
getFacade().create(current);           
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/resources/Bundle").getString("BillableCreated"));           
return prepareCreate();        } catch (Exception e) {           
JsfUtil.addErrorMessage(e,
ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));           
return null;        }    }    public String prepareEdit() {        current =
(Billable)getItems().getRowData();        selectedItemIndex =
pagination.getPageFirstItem() + getItems().getRowIndex();        return
"Edit";    }    public String update() {        try {           
getFacade().edit(current);           
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/resources/Bundle").getString("BillableUpdated"));           
return "View";        } catch (Exception e) {           
JsfUtil.addErrorMessage(e,
ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));           
return null;        }    }    public String destroy() {        current =
(Billable)getItems().getRowData();        selectedItemIndex =
pagination.getPageFirstItem() + getItems().getRowIndex();       
performDestroy();        recreateModel();        return "List";    }   
public String destroyAndView() {        performDestroy();       
recreateModel();        updateCurrentItem();        if (selectedItemIndex >=
0) {            return "View";        } else {            // all items were
removed - go back to list            recreateModel();            return
"List";        }    }    private void performDestroy() {        try {           
getFacade().remove(current);           
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/resources/Bundle").getString("BillableDeleted"));       
} catch (Exception e) {            JsfUtil.addErrorMessage(e,
ResourceBundle.getBundle("/resources/Bundle").getString("PersistenceErrorOccured"));       
}    }    private void updateCurrentItem() {        int count =
getFacade().count();        if (selectedItemIndex >= count) {            //
selected index cannot be bigger than number of items:           
selectedItemIndex = count-1;            // go to previous page if last page
disappeared:            if (pagination.getPageFirstItem() >= count) {               
pagination.previousPage();            }        }        if
(selectedItemIndex >= 0) {            current = getFacade().findRange(new
int[]{selectedItemIndex, selectedItemIndex+1}).get(0);        }    }   
public DataModel getItems() {        if (items == null) {            items =
getPagination().createPageDataModel();        }        return items;    }   
private void recreateModel() {        items = null;    }    public String
next() {        getPagination().nextPage();        recreateModel();       
return "List";    }    public String previous() {       
getPagination().previousPage();        recreateModel();        return
"List";    }    public SelectItem[] getItemsAvailableSelectMany() {       
return JsfUtil.getSelectItems(ejbFacade.findAll(), false);    }    public
SelectItem[] getItemsAvailableSelectOne() {        return
JsfUtil.getSelectItems(ejbFacade.findAll(), true);    }   
@FacesConverter(forClass=Billable.class)    public static class
BillableControllerConverter implements Converter {        public Object
getAsObject(FacesContext facesContext, UIComponent component, String value)
{            if (value == null || value.length() == 0) {               
return null;            }            BillableController controller =
(BillableController)facesContext.getApplication().getELResolver().                   
getValue(facesContext.getELContext(), null, "billableController");           
return controller.ejbFacade.find(getKey(value));        }       
java.lang.Long getKey(String value) {            java.lang.Long key;           
key = Long.valueOf(value);            return key;        }        String
getStringKey(java.lang.Long value) {            StringBuffer sb = new
StringBuffer();            sb.append(value);            return
sb.toString();        }        public String getAsString(FacesContext
facesContext, UIComponent component, Object object) {            if (object
== null) {                return null;            }            if (object
instanceof Billable) {                Billable o = (Billable) object;               
return getStringKey(o.getBillableId());            } else {               
throw new IllegalArgumentException("object " + object + " is of type " +
object.getClass().getName() + "; expected type:
"+BillableController.class.getName());            }        }    }}



--
View this message in context: http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346p4667350.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: problem with jsf crud application :how resolve?

Posted by Thiago Veronezi <th...@veronezi.org>.
Don't forget to share a bit of code. How do you implement
BillableController?
Check the specification [
http://download.oracle.com/otndocs/jcp/web_beans-1.0-fr-eval-oth-JSpec/ -
"Passivation and passivating scopes"]. It may give you some tips.

[]s,
Thiago.



On Wed, Jan 29, 2014 at 1:10 PM, mauro2java2011 <ma...@gmail.com>wrote:

> i have deployed a jsf crud application.
>
> Into glassfsih i t work , but from tomee i get the following problems:
>
> WARNING: Detected the following possible violations of the restrictions
> placed on property access persistent types:
> "jpa.entities.ClientPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "equals" defined in
> "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "hashCode" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "equals" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "equals" defined in
> "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "toString" defined
> in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "toString" defined in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "hashCode" defined
> in "jpa.entities.ClientPK".
> "jpa.entities.ClientPK" uses property access, but its field "clientName" is
> accessed directly in method "hashCode" defined in "jpa.entities.ClientPK".
> gen 29, 2014 7:06:19 PM null
> WARNING: Detected the following possible violations of the restrictions
> placed on property access persistent types:
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "hashCode" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "hashCode" defined
> in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "hashCode" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "toString" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "hashCode" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "toString" defined
> in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "clientName"
> is
> accessed directly in method "equals" defined in "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "toString" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field "projectName"
> is accessed directly in method "hashCode" defined in
> "jpa.entities.ProjectPK".
> "jpa.entities.ProjectPK" uses property access, but its field
> "clientDepartmentNumber" is accessed directly in method "equals" defined in
> "jpa.entities.ProjectPK".
> gen 29, 2014 7:06:19 PM org.apache.openejb.cdi.OpenEJBLifecycle
> startApplication
> SEVERE: CDI Beans module deployment failed
> org.apache.webbeans.exception.inject.DeploymentException:
> org.apache.webbeans.exception.WebBeansConfigurationException: Passivation
> scoped defined bean must be passivation capable, but bean :
> BillableController, Name:billableController, WebBeans Type:MANAGED, API
> Types:[jsf.BillableController,java.lang.Object],
>
> Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]
> is not passivation capable
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/problem-with-jsf-crud-application-how-resolve-tp4667346.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>