dev@jsftemplating.java.net

Re: JSFTemplating: NoClassDefFoundError

From: Irfan Ahmed <Irfan.Ahmed_at_Sun.COM>
Date: Wed, 03 Oct 2007 20:34:12 +0530
Hi Senthil,

Thanks for your reply. The Handler.map and the jsf file calling the handler are fine. I am sure this is a class path issue as the Web application class loader for the GF GUI will pick up classes from the server class path, but the other way it would not be allowed ie., classes on the server class path being able to pick up classes within the WEB-INF/lib of a deployed web application.

Is this what you meant by "appropriate class path"?

I have attached the JSF file and the Handler.map file.

Thanks and Warm Rgds,
Irfan.

Senthil Chidambaram wrote:
Irfan,
Could you please email us the generated Handler.map file after compiling SipConfigurationHandlers.java, and the .jsf file which calls the handler. Usually this happens when the Handler.map file don't have the handler defined. Also make sure Handler.map file is placed at the appropriate classpath.

thx
Senthil

Irfan Ahmed wrote:
Hi All,

I have written a Handler for handling SIP Related commands. However I am getting an exception when I hit upon the page. The page has a call to a handler called getSipService. I have generated the map file and when I debugged the code, I could see that JSFTemplating code could locate the correct class file. However getting the method was a problem.

The following is the stacktrace.

[#|2007-10-03T14:33:49.844+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=20;_ThreadName=httpWorkerThread-8080-1;_RequestID=1ac66d91-f5cb-40ae-afb1-4f174fe058eb;|StandardWrapperValve[FacesServlet]: PWC1406: Servlet.service() for servlet FacesServlet threw exception
java.lang.NoClassDefFoundError: com/sun/jsftemplating/layout/descriptors/handler/HandlerContext
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
        at java.lang.Class.getMethod0(Class.java:2642)
        at java.lang.Class.getMethod(Class.java:1579)
        at com.sun.jsftemplating.layout.descriptors.handler.HandlerDefinition.getHandlerMethod(HandlerDefinition.java:156)
        at com.sun.jsftemplating.layout.descriptors.handler.Handler.invoke(Handler.java:413)
        at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:343)
        at com.sun.jsftemplating.layout.descriptors.LayoutElementBase.dispatchHandlers(LayoutElementBase.java:317)
        at com.sun.jsftemplating.layout.descriptors.LayoutComponent.beforeCreate(LayoutComponent.java:335)
        at com.sun.jsftemplating.layout.descriptors.LayoutComponent.getChild(LayoutComponent.java:274)
        at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:518)
        at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:533)
        at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:533)
        at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:533)
        at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:533)
        at com.sun.jsftemplating.layout.LayoutViewHandler.buildUIComponentTree(LayoutViewHandler.java:533)
        at com.sun.jsftemplating.layout.LayoutViewHandler.createView(LayoutViewHandler.java:234)
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:203)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:80)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
        at com.sun.enterprise.tools.admingui.servlet.DelayedInitFacesServlet.service(DelayedInitFacesServlet.java:89)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
|#]

I have also attached my simple SipConfigurationHandler.java file.

Thanks and Warm Rgds,
Irfan.
-- 
Irfan Ahmed | Sun Microsystems Inc., Bangalore, India. | 9180-66927726, x27726


--
<a class="moz-txt-link-abbreviated" href="mailto:irfan@sun.com">irfan@sun.com</a>
Irfan Ahmed | Sun Microsystems Inc., Bangalore, India. | irfan@sun.com - 9180.66927726 - x27726

getSipService.class=org.jvnet.glassfish.comms.admin.gui.extensions.handlers.SipConfigurationHandlers
getSipService.method=getSipService
getSipService.input[0].name=ConfigName
getSipService.input[0].type=java.lang.String
getSipService.input[0].required=true
getSipService.output[0].name=accessLogBufferSize
getSipService.output[0].type=java.lang.String
getSipService.output[1].name=accessLogWriteInterval
getSipService.output[1].type=java.lang.String
getSipService.output[2].name=accessLoggingEnabled
getSipService.output[2].type=java.lang.Boolean
getSipService.output[3].name=Properties
getSipService.output[3].type=java.util.Map

saveSipService.class=org.jvnet.glassfish.comms.admin.gui.extensions.handlers.SipConfigurationHandlers
saveSipService.method=saveSipService
saveSipService.input[0].name=ConfigName
saveSipService.input[0].type=java.lang.String
saveSipService.input[0].required=true
saveSipService.input[1].name=newProps
saveSipService.input[1].type=java.util.Map
saveSipService.input[2].name=accessLoggingEnabled
saveSipService.input[2].type=java.lang.String
saveSipService.input[3].name=accessLogWriteInterval
saveSipService.input[3].type=java.lang.String
saveSipService.input[4].name=accessLogBufferSize
saveSipService.input[4].type=java.lang.String

$page{configName}); /> #include "shared/restart.inc" #include "treeBreadcrumbs.inc" #include "configuration/sipServiceTabs.inc" #include "alertMsg.inc" $attribute{tableRowGroup}); getAllSingleMapRows(TableRowGroup="$attribute{tableRowGroup}", Rows=>$attribute{newList}); convertRowsToProperties(NewList="#{newList}", AddProps=>$attribute{newProps}); prepareSuccessfulMsg(); saveSipService( ConfigName="#{configName}", newProps="${newProps}", accessLogBufferSize="#{accessLogBufferSize}", accessLogWriteInterval="#{accessLogWriteInterval}", accessLoggingEnabled="#{accessLoggingEnabled}" ); redirect(page="../configuration/sipService.jsf?alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}&configName=$pageSession{configName}"); /> $page{props}, accessLogBufferSize=>$attribute{accessLogBufferSize} accessLogWriteInterval=>$attribute{accessLogWriteInterval} accessLoggingEnabled=>$attribute{accessLoggingEnabled} ); getTableList(Properties="#{props}", TableList=>$attribute{tableList}); /> #include "propertyTable.inc" "
#include "changeButtonsJS.inc"