• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Updated servlets assignment page

 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Attention Kristen and Carol.

Updated Servlets Assignment Page.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wahoo!!! Thanks so much, Marilyn!
 
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for pointing out the updated page. The instructions are clearer now.
Ummmmm, I've downloaded the binary version of ant 1.6.5 and I'm looking over the manual. Surprisingly enough, I have questions!

The instructions say:
Installing Ant
The binary distribution of Ant consists of the following directory layout:

ant
+--- bin // contains launcher scripts
|
+--- lib // contains Ant jars plus necessary dependencies
|
+--- docs // contains documentation
| +--- ant2 // a brief description of ant2 requirements
| |
| +--- images // various logos for html documentation
| |
| +--- manual // Ant documentation (a must read ;-)
|
+--- etc // contains xsl goodies to:
// - create an enhanced report from xml output of various tasks.
// - migrate your build files and get rid of 'deprecated' warning
// - ... and more ;-)

Only the bin and lib directories are required to run Ant. To install Ant, choose a directory and copy the distribution file there. This directory will be known as ANT_HOME.

Question 1)So I'm thinking, I'll install ant by unzipping it to my C:\ drive, just like my jdk and orion, so the path will be C:\ant. Is this right?

Question 2) Do I need to do the following step?

Windows 95, Windows 98 & Windows ME Note:
On these systems, the script used to launch Ant will have problems if ANT_HOME is a long filename (i.e. a filename which is not of the format known as "8.3"). This is due to limitations in the OS's handling of the "for" batch-file statement. It is recommended, therefore, that Ant be installed in a short, 8.3 path, such as C:\Ant.
On these systems you will also need to configure more environment space to cater for the environment variables used in the Ant lauch script. To do this, you will need to add or update the following line in the config.sys file

shell=c:\command.com c:\ /p /e:32768

Question 3)And this?

Setup
Before you can run ant there is some additional set up you will need to do:

Add the bin directory to your path.
Set the ANT_HOME environment variable to the directory where you installed Ant. On some operating systems the ant wrapper scripts can guess ANT_HOME (Unix dialects and Windows NT/2000) - but it is better to not rely on this behavior.
Optionally, set the JAVA_HOME environment variable (see the Advanced section below). This should be set to the directory where your JDK is installed.
Note: Do not install Ant's ant.jar file into the lib/ext directory of the JDK/JRE. Ant is an application, whilst the extension directory is intended for JDK extensions. In particular there are security restrictions on the classes which may be loaded by an extension.

Question 4) (Fill in the blank) These lines of code belong ______________.

Windows and OS/2
Assume Ant is installed in c:\ant\. The following sets up the environment:

set ANT_HOME=c:\ant
set JAVA_HOME=c:\jdk1.2.2
set PATH=%PATH%;%ANT_HOME%\bin

I feel like I'm in over my head a bit here. I need waterwings or something until I can touch the bottom!
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 1)So I'm thinking, I'll install ant by unzipping it to my C:\ drive, just like my jdk and orion, so the path will be C:\ant. Is this right?

Yes. C:\ant is not the default, but especially in view of the next question, I think that would be best.

Question 2) Do I need to do the following step?

Windows 95, Windows 98 & Windows ME Note:
On these systems, the script used to launch Ant will have problems if ANT_HOME is a long filename (i.e. a filename which is not of the format known as "8.3"). This is due to limitations in the OS's handling of the "for" batch-file statement. It is recommended, therefore, that Ant be installed in a short, 8.3 path, such as C:\Ant. [/i]

I think we already resolved this in question 1.

On these systems you will also need to configure more environment space to cater for the environment variables used in the Ant lauch script. To do this, you will need to add or update the following line in the config.sys file

shell=c:\command.com c:\ /p /e:32768


This is something new, but since they recommend it, and it's easy, I would suggest doing it.

Question 3)And this?

Setup
Before you can run ant there is some additional set up you will need to do:

Add the bin directory to your path.


Definitely!

Set the ANT_HOME environment variable to the directory where you installed Ant.

Do this in your autoexec.bat file

ANT_HOME=C:\ant

Optionally, set the JAVA_HOME environment variable (see the Advanced section below). This should be set to the directory where your JDK is installed.

This is optional, but I usually do it.
JAVA_HOME=C:\j2sdk or whereever it is.

Question 4) (Fill in the blank) These lines of code belong in your autoexec.bat file (see question 3).

Assume Ant is installed in c:\ant\. The following sets up the environment:

set ANT_HOME=c:\ant
set JAVA_HOME=c:\jdk1.2.2
set PATH=%PATH%;%ANT_HOME%\bin
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ant isn't working as advertised.
I open a dos window and cd to java, which is my development directory, and type ant all deploy, and all I get for my trouble is bad command or file name.
I think I might be missing a step somewhere. I unzipped the file I downloaded to C:\ then changed the name from Apache Ant (or what ever it was) to just ant.
Is the placement of the 3 set commands important? I added them under the 2 existing SET commands. Is case important? I added C:\ant\bin to my PATH as well as doing the set %PATH% %ANT_HOME% bin thing as one of the set commands.
I backtracked over all of the instructions for installing and setting Ant up, and I can't see where I did anything wrong, but this is pretty foreign turf for me, and I could be overlooking something obvious.
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
set PATH=%PATH%;%ANT_HOME%\bin
should be after your other PATH declaration and, of course it must be after you define ANT_HOME.

However if you already added it to the end of your path, you don't need to have the
set PATH=%PATH%;%ANT_HOME%\bin statement at all.

What do you see when you type the word "path" at the DOS prompt? Does it include your C:\ant\bin directory? You did reboot after changing autoexec.bat, right?

I usually assume that the case is important, but I may be wrong.
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just noticed a colon where a semicolon should be in my PATH statement. Chnaged that, and now I'm going to check it out. Question: The build file says it is using ant 1.6. I've got ant 1.6.5. Any compatibility issues there?
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could be compatibility issues, but I don't anticipate any. I used the same script with ant 1.5 with no problems. Maybe when then come out with 1.7, but we'll deal with that issue when it arises. We're using pretty basic ant stuff, so I'd be really surprised if that is an issue at this point.
 
Kristin Stromberg
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used 1.6.2 and it worked a-okay.
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The semicolon seemed to be the problem. Now when I type the ant all deploy command, I got Buildfile build.xml then Build Failed C:\java\build.xml:1: XML declaration may only begin entities
Is this progress?
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And the first line of build.xml looks just like the one on the assignment page? You're not missing a < or a > or the ? or anything?
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did a copy and paste off of the assignment page rather than type the code by hand. The source code for java\build.xml looks exactly like the code on the assignment page. When displayed in IE the first line of code has a different color than the other lines, and the other tags are preceded by a dash, but the source code is identical. Perhaps I should look at the changes made in this version to see if that first tag should be written differently.
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, another twist. I commented out the <?xml=version"1.0"?> and typed Ant and got this:

BUILD FAILED
C:\java\build.xml:23: C:\java\resources\WEB-INF\lib not found.

Interesting.....
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no resources folder in my java folder. Should I create one and put the WEB-INF\lib folders in there, or is Ant supposed to do that during the build?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carol,

I had to create the folder WEB-INF\lib and place j2ee.jar and jr.jar into this folder.

typing 'ant initdirs' will make the classes directory and dist directory under the build directory. I think I had to make the build directory manually.

Make sure you put your JSP files in the source directory, or they won't get deployed to Orion.

Cheers,
Kelly
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you need to create the resources folder and put the WEB-INF\lib folders and the WEB-INF\web.xml in there.

When Ant creates the classes directory, it should create it inside the build directory (which it should also create). Let me know if it does not.
[ October 18, 2005: Message edited by: Marilyn de Queiroz ]
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marilyn,

Thanks for the feedback.

Here is what I am using. (working on 4a - Videos)
<pre>
C:\develop\ksl\cattledrive\video>ant -version
Apache Ant version 1.6.5 compiled on June 2 2005
</pre>
1.) First attempt with no 'build' directory
<pre>
C:\develop\ksl\cattledrive\video>ant all deploy
Buildfile: build.xml

init:

clean:

BUILD FAILED
C:\develop\ksl\cattledrive\video\build.xml:43: C:\develop\ksl\cattledrive\video\
build not found.

Total time: 0 seconds
</pre>
2.) using the 'initdirs' target.
<pre>
C:\develop\ksl\cattledrive\video>ant initdirs
Buildfile: build.xml

init:

initdirs:
[mkdir] Created dir: C:\develop\ksl\cattledrive\video\build\classes
[mkdir] Created dir: C:\develop\ksl\cattledrive\video\build\dist

BUILD SUCCESSFUL
Total time: 0 seconds
</pre>
3.) using the 'all' and 'deploy' build targets after the build directories were created.
<pre>
C:\develop\ksl\cattledrive\video>ant all deploy
Buildfile: build.xml

init:

clean:

initdirs:

compile:
[javac] Compiling 3 source files to C:\develop\ksl\cattledrive\video\build\c
lasses

war:
[war] Building war: C:\develop\ksl\cattledrive\video\build\dist\videos.war


build:

all:

init:

initdirs:

deploy:
[copy] Copying 1 file to C:\develop\orion\applications

BUILD SUCCESSFUL
Total time: 1 second
</pre>
Its good after this. I thought that the 'all' dependency chain was 'all' -> 'clean' & 'build' -> 'war' -> 'compile' -> 'initdirs' but 'initdirs' does not appear to happen.

Whoops, I get it! the 'all' does a clean first, but the directories haven't been created yet... hee hee

This is crude, but it works.

<target name="all" depends="initdirs, clean, build"
description="clean and create the war"/>

[ October 18, 2005: Message edited by: Kelly Loyd ]

[ October 18, 2005: Message edited by: Kelly Loyd ]
[ October 18, 2005: Message edited by: Kelly Loyd ]
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"all" does:
clean
init
initdirs
compile
war
in that order.

I'll add the mkdir for the build dir since it doesn't seem to work in all cases. However, resources are used by ant, not created by ant.
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably a stupid question, but which WEB-INF\lib folder should I be placing inside java\resources? I have a WEB-INF folder in orion, but there is no lib folder inside of it. Exactly where do I get the lib folder to put inside the WEB-INF folder? The web.xml file comes from where? Is that the DD that should go with this web app?
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carol,

You have to create the resources directory and then create WEB-INF inside resources and then create lib directory inside WEB-INF. Copy jr.jar and j2ee.jar into WEB-INF\lib. Create the src directory and copy the JSP and index.html into src. ant will populate the build and dist directories for you.

- like this
build
resources
-- WEB-INF
---- web.xml
---- lib
------ jr.jar
------ j2ee.jar
src
-- bee.jsp
-- index.html
-- com
---- javaranch
------ drive
-------- BeeServlet.java

Make sure that BeeServlet is in the com.javaranch.drive package. (package com.javaranch.drive; at the top of BeeServlet.java)

Hope this helps

Kelly

[ October 18, 2005: Message edited by: Kelly Loyd ]
[ October 18, 2005: Message edited by: Kelly Loyd ]
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Kelly, that makes much more sense to me now. I'm getting a little confused by all of the different directories in my java, orion, and ant directories and how they all relate to each other. For some reason I was thinking it would match a directory tree that already existed in one of those programs. Anyhoo, are you doing the drive? I don't recognize your name, but I'm at work and can't access my student files to double check.
Thanks for the info. I'm going to try it when I get home tonight.Bye! Gotta get back to work. The security camera is blinking at me......
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carol,

I was waiting for payday (comes once a month) to sign up, but while I was waiting I have tried all of the assignments up to Servlets 4a. My answers to all of the cattle drive assingments work, but I haven't had the nitpicking yet - I just sent the payment in today. Oh yeah, I'm in Newcastle, New South Wales, Australia and it's 10 am on Thursday morning.

Cheers,
Kelly
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome Kelly!
I worked with a couple Aussies in Reno in the 80's. don't know where they are now.
Looking forward to your first nitpick? Hang on to your hat!
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This will be off-topic, but my first programming course was Fortran 66 in 1978 - The instructor would give us assignments which we would complete on paper and hand in. If the instructor couldn't follow our code, he would get us to punch it on the card punch in the back of the classroom and he would take our deck out to the livestock sale yards - no joke! The livestock sale yards had an IBM 1130 for their sale reports. If the deck compiled successfully, then the instructor would grade you on the printed output. Every failed compile attempt would result in the loss of 1 point. Even if you mis-punched the cards! So a 10 point assingment that was to be 'graded' by the computer had to be perfect, otherwise you can see your score for the assignment rapidly becoming an 'F' ( 5 out of 10 points).

So yep, I reckon I can take nitpicking, if it improves the quality of my code

Cheers,
Kelly
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, created the directory structures and put everything where it belongs, with the exception of index.html because I didn't have one, and I got an error message regarding the build.properties file. It seems Windows appended a txt extension, so I'm thinking, it should be a properties extension, so I created a properties file type and tried ant all deploy again, and voila! I got a successful build. Now when I started orion I got this error message:Auto-unpacking C:\orion\applications\bee.war... Error unpacking: Web-Inf (bad sing)
Well, I know I can't sing, but that's just impolite.
I haven't tried to view the page yet. So here goes.......
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, created the directory structures and put everything where it belongs, with the exception of index.html because I didn't have one,

You shouldn't have one yet.

[/i]and I got an error message regarding the build.properties file. It seems Windows appended a txt extension[/i]

Are you using Notepad?

"WEB-INF" is case sensitive.
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marilyn de Queiroz:


Are you using Notepad?

"WEB-INF" is case sensitive.



Notepad is all I use for writing code. I have a copy of text pad, but I find it annoying, so I hardly ever use it. It's fun to look at code I've already written all nice and formatted, but I don't like to use it for writing code from scratch.
I tried to save the file AS WEB-INF, but it changed the all caps format to Web-Inf, of something like that. When that happened, I figured case didn't matter. Perhaps that's the problem?
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carol,

Yes - the WEB-INF must be in all caps. It is case-sensitive.

Cheers,
Kelly
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay,so I tried to change the name of the Web-Inf folder to WEB-INF, and windows keeps changing it back to Web-Inf. How do I make it stay all caps?
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh, good old windows. You will have to delete the directory and re-create it.

Kelly
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Poopy old windows. Grumble grumble grumble.......
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is weird. The folder is named Web-Inf but when I open it the name in the path shows as all caps. What's up with that? If case is important, why does it show one way under the folder, but the other way in the address bar?
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try creating the directory from the command prompt.

e.g.
<pre>
mkdir WEB-INF
</pre>
Make sure the directory name shows all caps using the 'dir' command'

<pre>
C:\develop\java\cattledrive\resources>dir
Volume in drive C has no label.
Volume Serial Number is C4A2-EC83

Directory of C:\develop\java\cattledrive\resources

23/10/2005 11:27 AM <DIR> .
23/10/2005 11:27 AM <DIR> ..
23/10/2005 11:27 AM <DIR> WEB-INF
0 File(s) 0 bytes
3 Dir(s) 192,358,494,208 bytes free
</pre>

When Ant makes the WAR file, this is what it does in the build.xml file.
<pre>
<target name="war" depends="compile">
<war destFile="${dist.dir}/${app.name}.war"
webxml="${resources.dir}/WEB-INF/web.xml">
<classes dir="${classes.dir}"/> < !-- the java classes -->
<zipfileset dir="${resources.dir}"
includes="**/jr.jar"/> < !-- WEB-INF/lib -->
<fileset dir="${src.dir}"
includes="**/*.jsp"/> < !-- web page stuff -->
</war>
</target>
</pre>

Ant is also expecting WEB-INF to be in upper case, but the build.xml already is right , because Ant isn't complaining.

And also - you might like to verify what was put into the war file. Change into the build\dist directory and do a jar -tvf bee.war. ( -t = show Table of contents, -v = Verbose -f = input file. you can really see the UN*X roots of the jar command )

<pre>
C:\develop\java\cattledrive>cd build\dist

C:\develop\java\cattledrive\build\dist>jar -tvf bee.war
0 Wed Oct 19 08:35:42 EST 2005 META-INF/
106 Wed Oct 19 08:35:40 EST 2005 META-INF/MANIFEST.MF
0 Wed Oct 19 08:35:42 EST 2005 WEB-INF/
0 Wed Oct 19 08:35:42 EST 2005 WEB-INF/classes/
0 Tue Oct 18 15:44:18 EST 2005 WEB-INF/classes/com/
0 Tue Oct 18 15:44:18 EST 2005 WEB-INF/classes/com/javaranch/
0 Wed Oct 19 08:35:42 EST 2005 WEB-INF/classes/com/javaranch/drive/
172 Wed Oct 19 08:35:42 EST 2005 WEB-INF/classes/com/javaranch/drive/BeeServl
et$1.class
969 Wed Oct 19 08:35:42 EST 2005 WEB-INF/classes/com/javaranch/drive/BeeServl
et$Default.class
622 Wed Oct 19 08:35:42 EST 2005 WEB-INF/classes/com/javaranch/drive/BeeServl
et.class
0 Wed Oct 19 08:20:44 EST 2005 WEB-INF/lib/
285003 Fri Oct 14 11:14:22 EST 2005 WEB-INF/lib/jr.jar
181 Tue Oct 18 14:43:42 EST 2005 bee.jsp
550 Tue Oct 18 15:44:52 EST 2005 WEB-INF/web.xml
</pre>

That is what is in my bee.war file looked like.

Cheers
Kelly
[ October 23, 2005: Message edited by: Kelly Loyd ]
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I ran that command, I got a lot more files that you had. I think all of the com.javaranch.common files got unzipped and listed separately. Do you think if I copied the contents of the folder Web-Inf to a new folder named WEB-INF and deleted the lower-case version it would solve the problem?
 
Kelly Loyd
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I would rename the existing web-inf folder (to preserve it's contents), then use the dos prompt (command window) to run the mkdir WEB-INF command. Then copy the contents of the old web-inf to the new WEB-INF.

Can you check to see if the jr.jar was extracted at all? (look for subdirectories under the WEB-INF\lib directory. It seems odd for jar to display its contents.

Oh yes, one more question - when you do the 'ant all deploy' command are any errors reported? I assumed that your ant build was 100% successful.

Kelly
[ October 24, 2005: Message edited by: Kelly Loyd ]
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Notice the orion\default-web-app\Web-inf directory on the left side of the image above is the same as the orion\default-web-app\WEB-INF directory in the address bar. So it looks like you should believe the one in the address bar.
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<pre>
C:\orion\default-web-app>dir

Volume in drive C is HARD_DRIVE
Volume Serial Number is 2F6B-17D3
Directory of C:\orion\default-web-app

EXAMPLES <DIR> 03-03-01 5:15a examples
WEB-INF <DIR> 03-03-01 5:15a WEB-INF
ADDVID~1 HTM 1,002 04-09-01 12:10a addvideo.html
INDEX~1 HTM 2,077 10-10-00 11:29p index.html
REVERS~1 HTM 414 04-20-01 10:00p reverse.html
REVERS~2 HTM 308 03-11-01 8:12a reverse2.html
VIDEOL~1 HTM 511 04-20-01 8:19a videologin.html
VIDEOS~1 HTM 258 04-09-01 12:10a videos.html
6 file(s) 4,570 bytes
4 dir(s) 992,808,960 bytes free

C:\orion\default-web-app>
</pre>
Notice that the "all-caps" shortened windows version of the name is on the left when I type "dir" at the C:\orion\default-web-app> prompt, and the long, full name is on the right. WEB-INF is all caps on both sides.

(I left out the dot directories because UBB was doing some funky thing with the formatting)
[ October 24, 2005: Message edited by: Marilyn de Queiroz ]
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ignoring the fact that this is not the windows explorer view of the directory structure that you are used to seeing, notice that the "build", "resources", and "src" directories are at the same level. This is also the level where build.xml lives. If you put these directories in C:\Java, you would see
C:\Java\build
C:\Java\resources
C:\Java\src
C:\Java\build.xml
(and, yes, they are case sensitive)

In this case, C:\Java is your "base directory". After you successfully run
ant build
you will see the classes directory and the dist directory in the build directory. Inside the dist directory you should see the reverse2.war file.

If you go to the dist directory (cd C:\Java\build\dist), and type
jar tvf reverse2.war
you should see:
<pre>
C:\Java\build\dist>jar tvf reverse2.war
0 Mon Oct 24 20:05:26 MDT 2005 META-INF/
106 Mon Oct 24 20:05:24 MDT 2005 META-INF/MANIFEST.MF
0 Mon Oct 24 20:05:26 MDT 2005 WEB-INF/
0 Mon Oct 24 20:05:26 MDT 2005 WEB-INF/classes/
0 Sat Jul 23 13:49:18 MDT 2005 WEB-INF/classes/com/
0 Sat Jul 23 13:49:18 MDT 2005 WEB-INF/classes/com/javaranch/
0 Sun Aug 07 20:46:16 MDT 2005 WEB-INF/classes/com/javaranch/drive/
182 Mon Oct 24 20:05:26 MDT 2005 WEB-INF/classes/com/javaranch/drive/Reverse2Servlet$1.class
1164 Mon Oct 24 20:05:26 MDT 2005 WEB-INF/classes/com/javaranch/drive/Reverse2Servlet$Default.class
1151 Mon Oct 24 20:05:26 MDT 2005 WEB-INF/classes/com/javaranch/drive/Reverse2Servlet.class
0 Sun Nov 28 19:51:12 MST 2004 WEB-INF/lib/
285003 Sat Nov 06 18:22:34 MST 2004 WEB-INF/lib/jr.jar
557 Sun Oct 09 20:54:40 MDT 2005 reverse.jsp
325 Sat Jul 23 14:18:56 MDT 2005 WEB-INF/web.xml
</pre>
You should not see any of the com.javaranch.common classes.
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Carol Murphy:
Okay, so I tried to change the name of the Web-Inf folder to WEB-INF, and windows keeps changing it back to Web-Inf. How do I make it stay all caps?


You can't change it. You need to rename it (to something like Web-Inf-2), create a new WEB-INF, and copy the contents (files and/or directories) you want to keep from Web-Inf-2 to WEB-INF. You should not be copying any files that you unjarred from jr.jar or you will completely confuse poor ant as well as the server.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic