This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes I can't build??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "I can Watch "I can New topic
Author

I can't build???

Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1195
I started working on Servlets4b, and have run into some strange phenomenon. Now, I downloaded the most recent version of jr.jar and put j2ee.jar in the directory where they are supposed to go, but things are just....different. When I tried to run the ant all deploy command, I got the complaint that the directory C:\java\src\java didn't exist. so I created it and ran the command again. This time I got:

[war] Building war: C:\java\build\dist\videos.war
[war] Warning: selected war files include a WEB-INF/web.xml which will be
ignored (please use webxml attribute to war task)

I don't understand what I'm being told here. I'm thinking I need to change by build file in some way, but I'm not sure how. I opened up the videos.war file and it was pretty empty. It seems a lot of files are missing.

So I went ahead and started orion and got the login page to display, and upon typing in the password, the next page displays, but after that, nothing works. No matter which button is clicked, that same empty list page is all tah shows up. Weird.

This is from build.xml:

<target name="compile" depends="initdirs">
<javac srcdir="${src.dir}/java" destdir="${classes.dir}">
<classpath>
<fileset dir="${lib.dir}" includes="j2ee.jar jr.jar"/>
</classpath>
</javac>
</target>

<target name="war" depends="compile">
<war destFile="${dist.dir}/${app.name}.war" webxml="${src.dir}/web/WEB-INF/web.xml">
<classes dir="${classes.dir}"/>
<zipfileset dir="${lib.dir}" includes="jr.jar" prefix="WEB-INF/lib"/>
<fileset dir="${src.dir}/web" />
</war>
</target>

Now, above that, the target tag defines src.dir like this:

<target name="init">
<property file="${user.home}/build.properties"/>

<property name="src.dir" location="src"/>

<property name="classes.dir" location="${build.dir}/classes"/>

</target>
(I took some lines out)
Some of the files I need are not being compiled and put where they belong in orion. Did the build file get changed recently?
[ July 18, 2006: Message edited by: Marilyn de Queiroz ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
What's the date on the files inside video.zip?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1195
Unfortunately, I fixed the problem last night and I can't remember how. I'm a little doped-up on cold meds. I don't remember creating a java and web directory inside of my C:\java\src directory. That doesn't mean I didn't do it, I just don't remember doing it. I'm pretty sure that all of my java files were put directly inside the src file, and not inside another directory. but like I said, my memory could be faulty. When I created the java directory and put all the source files where they belonged, the build worked, but I'm still getting that message about a web.xml file that won't be used. When I deleted it from video.zip the build failed. When i put it back, it worked. So that file is being used.
Anyway, with exception of these two complaints:

compile:
[javac] Compiling 63 source files to C:\java\build\classes
[javac] Note: C:\java\src\java\com\javaranch\db\DBFacade.java uses or overr
des a deprecated API.
[javac] Note: Recompile with -deprecation for details.

war:
[war] Building war: C:\java\build\dist\videos.war
[war] Warning: selected war files include a WEB-INF/web.xml which will be
ignored (please use webxml attribute to war task)

everything is working now. All the buttons do what they're supposed to. Now I just have to figure out what to do with the Cookie stuff. I used a token in the original verson of this assignment. Is that still the approach, or should cookies be used by themselves?
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
No tokens. Just cookies.

I'll check on the web.xml warning. Perhaps I forgot a statement in build.xml.

Don't worry about the deprecated stuff. It has to do with some statements that had to be put into jr.jar that don't affect anything we're doing here on the Cattle Drive. Although I'm not sure I understand why you would be running javac on DBFacade.java ... Did you unjar jr.jar?
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1195
Originally posted by Marilyn de Queiroz:
I'm not sure I understand why you would be running javac on DBFacade.java ... Did you unjar jr.jar?


Not to my knowledge. I do have jr.jar in a few different locations, like a directory named resources/web-inf/lib/ as well as src/web/web-inf/lib/ both located in C:\java. I may have un-zipped it at some time in the past, and just don't remember doing so. I'm just running the ant all deploy command and for some reason it is giving me that message. It doesn't seem to interfere with anything, and I have been getting that message all along, even with Servlets 4a.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I can't build???