Instantiation

Hi,

iam getting below exception while running the jsf appliaction

javax.faces.FacesException: Can't instantiate class: 'com.edit.jsf.Contact'.. class com.edit.jsf.Contact : java.lang.InstantiationException: com.edit.jsf.Contact

at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:210)

at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:253)

at com.sun.faces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:78)

at com.sun.faces.el.impl.NamedValue.evaluate(NamedValue.java:125)

at com.sun.faces.el.impl.NamedValue.setValue(NamedValue.java:136)

at com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:234)

at com.edit.jsf.backing.Tabular.editLinkAction(Tabular.java:28)

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 com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)

at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)

at javax.faces.component.UICommand.broadcast(UICommand.java:312)

at javax.faces.component.UIData.broadcast(UIData.java:657)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.lang.ClassNotFoundException: class com.edit.jsf.Contact : java.lang.InstantiationException: com.edit.jsf.Contact

at java.beans.Beans.instantiate(Beans.java:208)

at java.beans.Beans.instantiate(Beans.java:48)

at com.sun.faces.config.ManagedBeanFactory.newInstance(ManagedBeanFactory.java:204)

... 44 more

Caused by: java.lang.InstantiationException: com.edit.jsf.Contact

at java.lang.Class.newInstance0(Class.java:335)

at java.lang.Class.newInstance(Class.java:303)

at java.beans.Beans.instantiate(Beans.java:204)

this is my class where i write the code iam not getting the Contact object .But am import the Contact class and create objtect for this.

public class Tabular {

private HtmlDataTable _dataTable;

public Contact editContact;

public HtmlDataTable getDataTable() {

return _dataTable;

}

public void setDataTable(HtmlDataTable dataTable) {

this._dataTable = dataTable;

}

public String newButtonAction()

{

return "drilldown";

}

public String editLinkAction()

{

editContact=(Contact)this.getDataTable().getRowData();

FacesContext ctxt=FacesContext.getCurrentInstance();

ValueBinding binding=ctxt.getApplication().createValueBinding("#{editContact}");

binding.setValue(ctxt,editContact);

return "drilldown";

}

}

[5538 byte] By [venkatJSFa] at [2007-11-27 7:41:05]
# 1
Add the jar containing the com.edit.jsf.Contact class to the WEB-INF/lib directory of your WAR file.
RaymondDeCampoa at 2007-7-12 19:21:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I tried this but am not getting the resule getting the same exception .I got hang plz help me
venkatJSFa at 2007-7-12 19:21:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Do you have all of the dependencies for that class as well?
RaymondDeCampoa at 2007-7-12 19:21:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Yes I had all! But am getting that exception
venkatJSFa at 2007-7-12 19:21:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
It looks as if there is a problem within the com.edit.jsf.Contact class. Is this one of your classes or did you get it from a library? Perhaps the vendor can help.
RaymondDeCampoa at 2007-7-12 19:21:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...