I do have the home html file, when I give the context root http://localhost:8080/ccc the html file automatically loaded in browser. In the html file I have five links, each contains the ,
link in this format,
<a href="servlet_alias_name">Title</a> ,
when I click on the any one of the link, it says servlet_name not found…is it not possible to navigate from html to servlet via “a href” tag?
I’m using Sun Java App Server8.0, I have included the libraries too while deploying..
And It shows the following exception,
javax.servlet.ServletException: Error instantiating servlet class pagesvsnodes
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
root cause
java.lang.NoClassDefFoundError: org/jfree/data/general/PieDataset
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
java.lang.Class.getConstructor0(Class.java:2640)
java.lang.Class.newInstance0(Class.java:321)
java.lang.Class.newInstance(Class.java:303)
If the
servlet_alias_nameis defined as aurl-mappingin the deployment descriptor (/WEB-INF/web.xml) for your web application you should be able to access the servlet in this way. My guess is you haven’t defined a URL mapping and are trying to use the servlet-name element directly, which won’t work.For example, the following snippet would map the servlet class
com.mycompany.SuperServletto the logical namemyServlet, then map the URLhttp://localhost:8080/ccc/servlet-alias-nameto the logical namemyServlettoo. That would make requests to that URL invoke that servlet class.Update – OK scratch all that.
Your problem is that your webapp can’t find the
org.jfree.data.general.PieDatasetclass at runtime, although it was there when the code was compiled, check the javadoc for NoClassDefFoundError.Have you included the libs in the deployed webapp?
Or are the libs supposed to be deployed and available globally on the appserver?
Do you have the same versions of the libs in your build environment and in your runtime env?
To debug this error when I’ve seen it on Tomcat, I go to the simple case (deploy jar with webapp) and try to get that to work. I’ve never found any particularly useful tooling for debugging this situation to be honest – anyone know of anything that helps?