Re: PA2 Question

7 views
Skip to first unread message

Betty O'Neil

unread,
Mar 14, 2012, 5:31:18 PM3/14/12
to Max Ward, cs63...@googlegroups.com
You need to deploy the input classes, that is, put them in
the WEB-INF/classes area.

On Wed, 14 Mar 2012, Max Ward wrote:

> Hi Professor O'Neil,
>
> Back from vacation and doing my homework...
>
> I'm having trouble debugging a class not found exception in PA2. The
> classes not found are the ones we are supposed to output xml for (SortEx,
> Grid, etc). In our previous assignment, we pointed to where the classes
> are using a command line "execution.classpath" but I can't figure out how
> to have ant make the server do that.
>
> Can you give me a hint, please?
>
> Max
>
> On Wed, Mar 7, 2012 at 6:15 PM, Betty O'Neil <eon...@cs.umb.edu> wrote:
>
>> OK, have a great vacation!--Betty O.
>>
>>
>> On Wed, 7 Mar 2012, Max Ward wrote:
>>
>> Thank you!
>>>
>>> As a reminder, I should also say that I won't be in class on Thursday.
>>> You might remember my telling you before the semester began that I had
>>> booked a vacation believing that our class was going to be on Mondays and
>>> Wednesdays.
>>>
>>> I'll read your class notes to catch up.
>>>
>>> Max
>>>
>>> Sent from my iPhone
>>>
>>> On Mar 7, 2012, at 9:59 AM, "Betty O'Neil" <eon...@cs.umb.edu> wrote:
>>>
>>> Thanks, done!--Betty O.
>>>>
>>>> On Tue, 6 Mar 2012, Max Ward wrote:
>>>>
>>>> Hi. Reminder to fix the link. :-)
>>>>>
>>>>> Sent from my iPhone
>>>>>
>>>>>
>>>
>

Jane H. DeBlois

unread,
Mar 19, 2012, 11:58:14 AM3/19/12
to cs63...@googlegroups.com
Hi all,
I continue to wrestle with the same trouble Max had, but even with the
hint from Prof. O'Neil (listed below with Max's question), I cannot make
my servlet find the files in the deployed file structure.
Did anybody see a good reference on how tomcat searches for files?
Thanks,
Holly

Matthew Almeida

unread,
Mar 19, 2012, 12:08:11 PM3/19/12
to cs63...@googlegroups.com
Be sure to look over the source code provided in the examples, servlet1 and servlet2.

Betty O'Neil

unread,
Mar 19, 2012, 12:41:01 PM3/19/12
to cs63...@googlegroups.com, Jane H. DeBlois
Holly--
From your deployment, I see your problem. You have
WEB-INF/input/classes/examples/sort
^^^^^^ need to remove "input" level
so that examples.sort is on the classpath
Everything under WEB-INF/classes is on the classpath for the servlet

Jane H. DeBlois

unread,
Mar 19, 2012, 7:03:33 PM3/19/12
to cs63...@googlegroups.com
Hi,
Thanks for the help. Tests 1a, 1b work fine. On Test2, when I use *.xsd
extension url pattern to pull in URI /pa2/javaSource.xsd, the
context.getResourceAsStream(fileName) fails, and outputs the error.xml
file instead. My file is in WebContent/WEB-INF/schema and gets deployed.
I read the servlet spec. Learned a lot, but can't get a view into
WEB-INF from my context yet.
Thanks,
Holly

Betty O'Neil

unread,
Mar 19, 2012, 7:46:14 PM3/19/12
to Jane H. DeBlois, cs63...@googlegroups.com
Watch out about using "pa2" in the spec. Note how "error.html" for
in servlet2 resolves to servlet2/error.html, because what's
important to a servlet is what is in its own area, not how
it's deployed as a directory in webapps. This way it is
independent of that deployment app name.

On Mon, 19 Mar 2012, Jane H. DeBlois wrote:

Reply all
Reply to author
Forward
0 new messages