PDA

View Full Version : glassfish not loading jsp pages



dguido
October 22nd, 2007, 08:04 AM
I installed glassfish (apt-get install glassfish) and went to localhost:8080 and 4848 and they both load fine. However, when I download the hello.war test app (https://glassfish.dev.java.net/downloads/quickstart/index.html) into the domain1 autodeploy directory and try to browse to it, I got an HTTP 500 error like this:


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener

root cause

java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener

note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server Platform Edition 9.0_01 logs.

The logs look like this:


[#|2007-10-22T02:02:33.824-0500|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=13;_ThreadName=httpWorkerThread-8080-1;_RequestID=0d44dfaa-9fe9-4d7d-8481-3f94d635b0dc;|StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener
at org.apache.jasper.JspCompilationContext.createComp iler(JspCompilationContext.java:210)
at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:527)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:412)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:318)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
at org.apache.catalina.core.ApplicationFilterChain.se rvletService(ApplicationFilterChain.java:397)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:278)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:536)
at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:240)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:179)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:566)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipel ine.java:73)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:182)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:566)
at com.sun.enterprise.web.VirtualServerPipeline.invok e(VirtualServerPipeline.java:120)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:939)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:137)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:536)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:939)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:239)
at com.sun.enterprise.web.connector.grizzly.Processor Task.invokeAdapter(ProcessorTask.java:667)
at com.sun.enterprise.web.connector.grizzly.Processor Task.processNonBlocked(ProcessorTask.java:574)
at com.sun.enterprise.web.connector.grizzly.Processor Task.process(ProcessorTask.java:844)
at com.sun.enterprise.web.connector.grizzly.ReadTask. executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask. doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase. run(TaskBase.java:252)
at com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
|#]

Also, when I put a test.jsp page in the docroot, I get the same HTTP 500 error. I tried apt-get'ing ant but that wasn't the problem. Does anyone know what is going on?

dguido
October 22nd, 2007, 08:11 AM
I was just checking if I had the command-line tools mentioned at the bottom of Sun's quickstart document (linked to above) and I seem to be missing a bunch. Granted, Ubuntu is using Glassfish v1 and it looks like this guide is for v2, but I still think this could be a problem.

Could this be an environment variable problem? I see all the tools in /usr/share/sunappserver/bin but they're not in my PATH.

lavajumper
December 5th, 2007, 02:28 PM
I'm having the same problem. One small step I found was to run :

update-alternatives --config java
and select a sun-java option. Ant won't work without them.
I'm new to the java/sunappserver world so I can't offer more than that, and it only fixed the ant problem, the server is still not serving up pages.

Peter LaValle
January 8th, 2008, 11:55 PM
Err ... I have the same problem too. I have tried the alternatives thing and I have tried installing Ant from apt-get ... but GlassFish didn't seem to care ...

I also tried the example app from netbeans on my Ubuntu server (the host in question) again; no joy.

ecimon
January 10th, 2008, 01:14 AM
Hi,

This exception :


java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildListener

says that you're missing BuildListener class in your CLASSPATH. You need to add ant.jar (and possibly other depending on it jars) to the server CLASSPATH. On Glassfish, you can do this from the admin panel (goto http://localhost:4848).

If you have installed ant package already, then ant.jar should be in /usr/share/ant/lib.

Good luck