Foren

Problem when Adding a record , with JSF ICE faces portlet

ZahidUlla Khan Junaid, geändert vor 16 Jahren.

Problem when Adding a record , with JSF ICE faces portlet

New Member Beiträge: 2 Beitrittsdatum: 01.04.08 Neueste Beiträge
Hi i am Zahid .I have developed a Myfaces jsf portlet with complete functionality in Plug-in environment.
But when i try to do the same thing with ICE faces portlet i am not able to add a record. It says java.lang.ClassCastException: .

here is the error message .and below that code for adding a record into the data base.
If any one can help me in this it will be of great help to me.Please tell me whether i am going in the right direction or not. and the right way to do it.

Thanking you

Zahid


java.lang.ClassCastException:
com.icesoft.faces.env.ServletEnvironmentRequest
at
com.sample.icefaces.managedbean.JobApplication.addJobApplication(JobApplicat
ion.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
at javax.faces.component.UICommand.broadcast(UICommand.java:89)
at com.icesoft.faces.component.panelseries.UISeries
$RowEvent.broadcast(UISeries.java:524)
at
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:232
)
at
com.icesoft.faces.component.paneltabset.PanelTabSet.broadcast(PanelTabSet.ja
va:286)
at javax.faces.component.UIData.broadcast(UIData.java:517)
at
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:227
)
at
com.icesoft.faces.component.paneltabset.PanelTabSet.broadcast(PanelTabSet.ja
va:286)
at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplica
tionExecutor.java:32)
at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:9
5)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSen
dUpdates.java:57)
at
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpd
ates.java:45)
at
com.icesoft.faces.webapp.http.core.IDVerifier.service(IDVerifier.java:25)
at
com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdap
tingServlet.java:16)
at
com.icesoft.faces.webapp.http.servlet.ViewBoundAdaptingServlet.service(ViewB
oundAdaptingServlet.java:44)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher
$Matcher.serviceOnMatch(PathDispatcher.java:52)
at
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.
java:29)
at
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSe
ssionBoundServlet.java:97)
at
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispa
tcher.java:35)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher
$Matcher.serviceOnMatch(PathDispatcher.java:52)
at
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.
java:29)
at
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:8
5)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:654)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:445)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:343)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:292)
at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.jav
a:54)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
//============================================================
this is my add method

//===============================================================
public void addJobApplication(ActionEvent actionEvent) {

FacesContext facesContext =
FacesContext.getCurrentInstance();
try {
System.out.println("JobApplication");

ICEJobApplicationLocalServiceUtil.addJobApplication((ActionRequest)facesCont
ext.getExternalContext().getRequest(),

getFirstName(),getLastName(),getEmailAddress(),getPhoneNumber(),getPhoneNumb
erType(),getFaxNumber(),getComments());
}
catch (Exception e) {
FacesMessage message = new
FacesMessage(FacesMessage.SEVERITY_ERROR,
"Error adding jobApplication.",
e.toString());
facesContext.addMessage(null, message);
e.printStackTrace();
return;
}



}

//===============================================================
--
Thanks And Regards

ZahidUlla Khan Junaid

Software Developer
Trans-IT Mpower Labs Pvt Ltd.
musarath pasha, geändert vor 16 Jahren.

RE: Problem when Adding a record , with JSF ICE faces portlet

New Member Beitrag: 1 Beitrittsdatum: 01.04.08 Neueste Beiträge
Well i am too facing the same problem. can any one help us out from the liferay team




ZahidUlla Khan Junaid:
Hi i am Zahid .I have developed a Myfaces jsf portlet with complete functionality in Plug-in environment.
But when i try to do the same thing with ICE faces portlet i am not able to add a record. It says java.lang.ClassCastException: .

here is the error message .and below that code for adding a record into the data base.
If any one can help me in this it will be of great help to me.Please tell me whether i am going in the right direction or not. and the right way to do it.

Thanking you

Zahid


java.lang.ClassCastException:
com.icesoft.faces.env.ServletEnvironmentRequest
at
com.sample.icefaces.managedbean.JobApplication.addJobApplication(JobApplicat
ion.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
at javax.faces.component.UICommand.broadcast(UICommand.java:89)
at com.icesoft.faces.component.panelseries.UISeries
$RowEvent.broadcast(UISeries.java:524)
at
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:232
)
at
com.icesoft.faces.component.paneltabset.PanelTabSet.broadcast(PanelTabSet.ja
va:286)
at javax.faces.component.UIData.broadcast(UIData.java:517)
at
com.icesoft.faces.component.panelseries.UISeries.broadcast(UISeries.java:227
)
at
com.icesoft.faces.component.paneltabset.PanelTabSet.broadcast(PanelTabSet.ja
va:286)
at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
at
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplica
tionExecutor.java:32)
at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:9
5)
at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
at
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSen
dUpdates.java:57)
at
com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpd
ates.java:45)
at
com.icesoft.faces.webapp.http.core.IDVerifier.service(IDVerifier.java:25)
at
com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdap
tingServlet.java:16)
at
com.icesoft.faces.webapp.http.servlet.ViewBoundAdaptingServlet.service(ViewB
oundAdaptingServlet.java:44)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher
$Matcher.serviceOnMatch(PathDispatcher.java:52)
at
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.
java:29)
at
com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSe
ssionBoundServlet.java:97)
at
com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispa
tcher.java:35)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher
$Matcher.serviceOnMatch(PathDispatcher.java:52)
at
com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.
java:29)
at
com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:8
5)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:654)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
patcher.java:445)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:343)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:292)
at
com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.jav
a:54)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint
$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
//============================================================
this is my add method

//===============================================================
public void addJobApplication(ActionEvent actionEvent) {

FacesContext facesContext =
FacesContext.getCurrentInstance();
try {
System.out.println("JobApplication");

ICEJobApplicationLocalServiceUtil.addJobApplication((ActionRequest)facesCont
ext.getExternalContext().getRequest(),

getFirstName(),getLastName(),getEmailAddress(),getPhoneNumber(),getPhoneNumb
erType(),getFaxNumber(),getComments());
}
catch (Exception e) {
FacesMessage message = new
FacesMessage(FacesMessage.SEVERITY_ERROR,
"Error adding jobApplication.",
e.toString());
facesContext.addMessage(null, message);
e.printStackTrace();
return;
}



}

//===============================================================
--
Thanks And Regards

ZahidUlla Khan Junaid

Software Developer
Trans-IT Mpower Labs Pvt Ltd.