Hi all!
I'm trying to develop a portlet using jsf and Ejb. (Websphere portal
express 5.0.2)
All goes well on my test environment(RAD 6.0), but deploying my ear
and war to the server ...i've got some problems : I'm able to display
and edit data ( using dataTable ). Also I'm able to insert data
but when I try to display the new inserted value,all I can see are the
old rows plus a blank row. Data are correctly memorized on db and if I
restart the portal magically the new information are correctly
displayed on the dataTable. Error log says:

Non-application exception occurred while processing method
"getLangData". Exception data: com.ibm.websphere.cpi.CPIException: ;
nested exception is:
java.lang.ClassCastException: tsm.ejb.LangKey
java.lang.ClassCastException: tsm.ejb.LangKey
at
tsm.ejb.websphere_deploy.DB2UDBNT_V82_1.LangBeanIn jectorImpl_21a12840.ejbFindByPrimaryKey(LangBeanIn jectorImpl_21a12840.java:
36)
at
com.ibm.ws.ejbpersistence.beanextensions.ConcreteB eanStatefulInstanceExtensionImpl.getFindByPrimaryK eyInputRecord(Unknown
Source)
at
com.ibm.ws.ejbpersistence.beanextensions.ConcreteB eanStatefulInstanceExtensionImpl.fetchRecordFromDa taStore(Unknown
Source)
at
com.ibm.ws.ejbpersistence.beanextensions.ConcreteB eanStatefulInstanceExtensionImpl.getRecordForLoad( Unknown
Source)
at
com.ibm.ws.ejbpersistence.beanextensions.ConcreteB eanStatefulInstanceExtensionImpl.executeLoad(Unkno wn
Source)
at
com.ibm.ws.ejbpersistence.beanextensions.CBReadySt ate.ejbLoad(Unknown
Source)
at
com.ibm.ws.ejbpersistence.beanextensions.ConcreteB eanStatefulInstanceExtensionImpl.ejbLoad(Unknown
Source)
at tsm.ejb.ConcreteLang_21a12840.ejbLoad(ConcreteLang _21a12840.java:
37)
at
com.ibm.ejs.container.ContainerManaged2_0BeanO.loa dForEnlist(ContainerManaged2_0BeanO.java:
331)
at com.ibm.ejs.container.EntityBeanO.enlist(EntityBea nO.java:718)
at
com.ibm.ejs.container.activator.OptCEntityActivati onStrategy.atActivate(OptCEntityActivationStrategy .java:
117)
at
com.ibm.ejs.container.activator.Activator.activate Bean(Activator.java:
516)
at
com.ibm.ejs.container.EJSContainer.preInvoke_inter nal(EJSContainer.java:
2704)
at com.ibm.ejs.container.EJSContainer.preInvoke(EJSCo ntainer.java:
2432)
at
tsm.ejb.EJSLocalCMPLang_21a12840.getLangData(EJSLo calCMPLang_21a12840.java:
22)
at tsm.ejb.LangFacadeBean.findLanguages(LangFacadeBea n.java:93)
at
tsm.ejb.EJSRemoteStatelessLangFacade_7248278b.find Languages(EJSRemoteStatelessLangFacade_7248278b.ja va:
76)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.CORBA.iiop.ClientDelegate$3.run(ClientDele gate.java:1144)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.CORBA.iiop.ClientDelegate.invoke(ClientDel egate.java:1140)
at $Proxy14.findLanguages(Unknown Source)
at tsm.ejb._LangFacade_Stub.findLanguages(_LangFacade _Stub.java:252)
at
pagecode.TSMLangView.doLangFacadeFindLanguagesActi on(TSMLangView.java:
113)
at
pagecode.TSMLangView.getLangFacadeFindLanguagesRes ultBean(TSMLangView.java:
103)
at java.lang.reflect.Method.invoke(Native Method)
at
com.sun.faces.el.PropertyResolverImpl.getValue(Pro pertyResolverImpl.java:
79)
at
com.ibm.faces.databind.SelectItemsPropResolver.get Value(SelectItemsPropResolver.java:
41)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySu ffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(Comple xValue.java:151)
at
com.sun.faces.el.impl.ExpressionEvaluatorImpl.eval uate(ExpressionEvaluatorImpl.java:
238)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBi ndingImpl.java:
155)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBi ndingImpl.java:
136)
at javax.faces.component.UIData.getValue(UIData.java: 527)
at javax.faces.component.UIData.getDataModel(UIData.j ava:856)
at javax.faces.component.UIData.setRowIndex(UIData.ja va:379)
at
com.ibm.faces.renderkit.html_extended.DataTableExR enderer.encodeBegin(DataTableExRenderer.java:
109)
at
javax.faces.component.UIComponentBase.encodeBegin( UIComponentBase.java:
723)
at javax.faces.component.UIData.encodeBegin(UIData.ja va:681)
at
com.sun.faces.renderkit.html_basic.HtmlBasicRender er.encodeRecursive(HtmlBasicRenderer.java:
440)
at
com.ibm.faces.renderkit.html_extended.BoxRenderer. encodeChildren(BoxRenderer.java:
204)
at
javax.faces.component.UIComponentBase.encodeChildr en(UIComponentBase.java:
741)
at
javax.faces.webapp.UIComponentTag.encodeChildren(U IComponentTag.java:
588)
at javax.faces.webapp.UIComponentTag.doEndTag(UICompo nentTag.java:
525)
at
com.ibm.faces.taglib.html_extended.PanelBoxTag.doE ndTag(PanelBoxTag.java:
238)
at org.apache.jsp._TSMLangView._jspService(_TSMLangVi ew.java:1187)
at
com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.se rvice(HttpJspBase.java:
89)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at
com.ibm.ws.cache.servlet.ServletWrapper.servicePro xied(ServletWrapper.java:
269)
at com.ibm.ws.cache.servlet.CacheHook.handleFragment( CacheHook.java:
233)
at com.ibm.ws.cache.servlet.CacheHook.handleServlet(C acheHook.java:
141)
at
com.ibm.ws.cache.servlet.ServletWrapper.service(Se rvletWrapper.java:
251)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet
$JspServletWrapper.service(JspServlet.java:364)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet.ser viceJspFile(JspServlet.java:
700)
at
com.ibm.ws.webcontainer.jsp.servlet.JspServlet.ser vice(JspServlet.java:
798)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at
com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:
110)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:
174)
at
com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:
313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:
116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:
283)
at
com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java:
42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:
40)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:
1030)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:
566)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.include(WebAppRequestDispatcher.java:
251)
at
com.ibm.wps.pe.pc.legacy.impl.PortletContextImpl.i nclude(PortletContextImpl.java:
259)
at
com.ibm.faces.context.WPPortletExternalContextImpl .dispatch(WPPortletExternalContextImpl.java:
438)
at
com.sun.faces.application.ViewHandlerImpl.renderVi ew(ViewHandlerImpl.java:
295)
at
com.ibm.faces.application.PortletViewHandlerImpl.r enderView(PortletViewHandlerImpl.java:
74)
at
com.sun.faces.lifecycle.RenderResponsePhase.execut e(RenderResponsePhase.java:
87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Lifecy cleImpl.java:
217)
at com.sun.faces.lifecycle.LifecycleImpl.render(Lifec ycleImpl.java:
117)
at
com.ibm.faces.webapp.WPFacesGenericPortlet.doRende r(WPFacesGenericPortlet.java:
358)
at
com.ibm.faces.webapp.WPFacesGenericPortlet.doView( WPFacesGenericPortlet.java:
388)
at
org.apache.jetspeed.portlet.PortletAdapter.service (PortletAdapter.java:
154)
at org.apache.jetspeed.portlet.Portlet._dispatch(Port let.java:744)
at org.apache.jetspeed.portlet.Portlet.access$100(Por tlet.java:88)
at org.apache.jetspeed.portlet.Portlet
$Context.callPortlet(Portlet.java:899)
at
com.ibm.wps.pe.pc.legacy.cmpf.impl.PortletFilterMa nager.doFilter(PortletFilterManager.java:
253)
at org.apache.jetspeed.portlet.Portlet.dispatch(Portl et.java:636)
at org.apache.jetspeed.portlet.Portlet.doPost(Portlet .java:516)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at
com.ibm.wps.pe.pc.legacy.cache.CacheablePortlet.se rvice(CacheablePortlet.java:
352)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jetspeed.portlet.Portlet.service(Portle t.java:491)
at
com.ibm.ws.cache.servlet.ServletWrapper.servicePro xied(ServletWrapper.java:
269)
at com.ibm.ws.cache.servlet.CacheHook.handleFragment( CacheHook.java:
233)
at com.ibm.ws.cache.servlet.CacheHook.handleServlet(C acheHook.java:
141)
at com.ib


And this is the code on my LangFacadeBean that raises the exception:


public LangData[] findLanguages() {
LangData[] data = null;

try {
Collection col = getLangLocalHome().findLanguages();
data = new LangData[col.size()];
Iterator it = col.iterator();
for (int i = 0; it.hasNext(); i++) {

data[i]= ((LangLocal)it.next()).getLangData(); //
ClasscastException on new //inserted data...
}
}
catch (Exception ex) {
ex.printStackTrace();
}
return data;
}



....anyone could help me please?


Thanks and sorry for my bad english