users@glassfish.java.net

Re: Simple JSP Beans don't work with Glassfish

From: Malachi de Ælfweald <malachid_at_gmail.com>
Date: Mon, 10 Apr 2006 21:18:21 -0700

I believe these are the pertinent lines from server.log:

(you'll notice C:\Java\glassfish\domains\domain1\docroot\jspTest\jsp3\ in
the following)

shared classpath jars : [, C:\Java\glassfish\lib\javaee.jar,
C:/Java/jdk1.6.0/jre/../lib/tools.jar,
C:\Java\glassfish\lib\install/applications/jmsra/imqjmsra.jar,
C:\Java\glassfish\lib\commons-launcher.jar, C:/Java/glassfish/imq/lib/jaxm-
api.jar, C:/Java/glassfish/imq/lib/fscontext.jar,
C:/Java/glassfish/imq/lib/imqbroker.jar,
C:/Java/glassfish/imq/lib/imqjmx.jar, C:/Java/glassfish/lib/ant/lib/ant.jar,
C:\Java\glassfish\lib\appserv-ws.jar, C:\Java\glassfish\lib\mail.jar,
C:\Java\glassfish\lib\jsf-api.jar, C:\Java\glassfish\lib\jsf-impl.jar,
C:\Java\glassfish\lib\appserv-jstl.jar, C:\Java\glassfish\lib\appserv-
env.jar, C:\Java\glassfish\lib\jmxremote_optional.jar,
C:/Java/glassfish/lib/SUNWjdmk/5.1/lib/jdmkrt.jar,
C:\Java\glassfish\lib\commons-logging.jar,
C:\Java\glassfish\lib\activation.jar, C:\Java\glassfish\lib\appserv-rt.jar,
C:\Java\glassfish\lib\appserv-admin.jar, C:\Java\glassfish\lib\appserv-
cmp.jar, C:\Java\glassfish\domains\domain1\docroot\jspTest\jsp3\,
C:\Java\glassfish\lib\admin-cli.jar, C:\Java\glassfish\lib\antlr.jar,
C:\Java\glassfish\lib\appserv-deployment-client.jar,
C:\Java\glassfish\lib\appserv-ext.jar, C:\Java\glassfish\lib\appserv-
jwsacc-signed.jar, C:\Java\glassfish\lib\appserv-jwsacc.jar,
C:\Java\glassfish\lib\appserv-launch.jar, C:\Java\glassfish\lib\appserv-
tags.jar, C:\Java\glassfish\lib\appserv-upgrade.jar,
C:\Java\glassfish\lib\asm-attrs.jar, C:\Java\glassfish\lib\asm.jar,
C:\Java\glassfish\lib\dbschema.jar, C:\Java\glassfish\lib\framework.jar,
C:\Java\glassfish\lib\j2ee-svc.jar, C:\Java\glassfish\lib\jhall.jar,
C:\Java\glassfish\lib\sun-appserv-ant.jar, C:\Java\glassfish\lib\toplink-
essentials-agent.jar, C:\Java\glassfish\lib\toplink-essentials.jar]

And referencing the .class file that was in that directory:


[#|2006-04-10T10:26:
19.629-0700|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=13;_ThreadName=httpWorkerThread-8080-2;|StandardWrapperValve[jsp]:
Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:
    [javac]
C:\Java\glassfish\domains\domain1\generated\jsp\j2ee-modules\__default-web-module-server\org\apache\jsp\jspTest\jsp3\SaveName_jsp.java:43:
cannot find symbol
    [javac] symbol : class UserData
    [javac] location: class org.apache.jsp.jspTest.jsp3.SaveName_jsp
    [javac] UserData user = null;
    [javac] ^


Generated servlet error:
    [javac]
C:\Java\glassfish\domains\domain1\generated\jsp\j2ee-modules\__default-web-module-server\org\apache\jsp\jspTest\jsp3\SaveName_jsp.java:45:
cannot find symbol
    [javac] symbol : class UserData
    [javac] location: class org.apache.jsp.jspTest.jsp3.SaveName_jsp
    [javac] user = (UserData)
_jspx_page_context.getAttribute("user", PageContext.SESSION_SCOPE);
    [javac] ^


Generated servlet error:
    [javac]
C:\Java\glassfish\domains\domain1\generated\jsp\j2ee-modules\__default-web-module-server\org\apache\jsp\jspTest\jsp3\SaveName_jsp.java:47:
cannot find symbol
    [javac] symbol : class UserData
    [javac] location: class org.apache.jsp.jspTest.jsp3.SaveName_jsp
    [javac] user = new UserData();
    [javac] ^
    [javac] 3 errors




Thanks,
Malachi



On 4/10/06, Jan Luehe <Jan.Luehe_at_sun.com> wrote:
>
> Hi Malachi,
>
> Carla Mott wrote On 04/10/06 13:12,:
>
> > Hi Malachi,
> >
> > I'm posting this on the users alias as that is more appropriate for
> > this type of question.
> >
> > Carla
> >
> >
> > Malachi de Ælfweald wrote:
> >
> >> I was trying the tutorial here: http://www.jsptut.com/Forms.jsp
> >>
> >> When it failed due to being unable to locate the UserData.class (in
> >> same directory as the .jsp files), I went into the admin console and
> >> added that directory to the classpath suffix, and restarted the server.
> >>
> >> Checking java.class.path from within a JSP shows that the directory
> >> is in fact listed, but it is not able to be located. Best guess is
> >> that glassfish is unable to load .class files from the classpath and
> >> is only loading jars.
> >>
> >> After about 2 hours trying to get this resolved, I have to move on
> >> and just assume that Glassfish is incapable of doing it.
> >
> sorry about that!
>
> Can you send us the detailed error message (which includes the JSP
> compilation classpath)
> from your logs?
>
> Thanks,
>
> Jan
>
> >>
> >>
> >> Malachi
> >
> >
> >
>