Ed Connery

Ranch Hand
+ Follow
since Mar 11, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ed Connery

Submitted Assignment Servlets-4a, attempt 0.5
10 years ago
ant clean did the trick! (Now of course I have to get it to WORK now that I can get it to compile. Details, details.)

For future reference, JAVA_HOME does point to the same version.

gyan: No IDE involved here. Just to keep life simple, I have the Cattle Drive with no IDE, a Sun Java course using NetBeans, and a work project using Eclipse. Three different web servers, too. No, I don't know which way is up!
10 years ago
Good question! I was compiling through ant. Simplifying to javac VideoData.java, the compilation works. Retrying via ant fails, so maybe I was focusing on the wrong part of the error messages. Let's give more complete text:

10 years ago
Yes, both give me version 1.5.0_12 (build 1.5.0_12-b04).
10 years ago
I'm working on Servlets-4a and trying to compile VideoData.java. The compiler is complaining, specifically:

"class file has wrong version 50.0, should be 49.0"

So I know that means the version is for 1.6 when I need 1.5, but my javac version is 1.5.0_12.

What have I done this time?
10 years ago
Thank you. I could have looked at that for (several more) hours without ever seeing what wasn't there. So to speak.

This is from a Sun Learning CD-ROM called Web Component Development with Java Technology. The copyright is 2009, and I bought it in 2010. It's part of a library of 9 or 10 course CDs that came in one box with the appalling original price of about $4000, marked down 50% <wow>, and then I got my company to pay half, so I'm only out $1000 for these. Naturally I want to "get my money's worth" as best I can. [The Sun website showed the Java Programming Language course in this set as the logical preparation for the SCJP. Silly me. It wasn't even adequate preparation for the Sierra/Bates book.] Let's just say that their sales materials were misleading and leave it at that. The kicker is that the materials seem to assume that you have teammates to work with and an instructor to answer questions. "None of the above." Naturally the instructor-led versions of these courses were far more expensive than the CD versions. That must have been a hell of a racket.
10 years ago
I'm going on my own through the CD version of the Sun Web Application Development course, and I just reached the point where they introduce Struts. The exercises use NetBeans, and my deployment attempt is failing. The first error message is simple enough:

Hopefully the error is just as simple, but to my inexperienced eye it looks like the end-tag ends with a '>' delimiter:

There are later errors such as the following, but those may occur because of the earlier errors.

So, what did I do wrong?
10 years ago
Thank you very much! It's very confusing blundering around in a complex tool like Eclipse. I couldn't even find General/Preferences except by clicking on it in the help system, and I couldn't find it at the build level at all (or perhaps I failed to find the build level). The warnings remain in the display of build.xml, but in fact the build worked, the war file deployed, and the application will launch properly. Magic, perhaps?

In any case, thanks again. -- Ed
10 years ago
I don't know if this is an Ant problem or an Eclipse problem, but I thought I'd start here. As background, a web app project got dumped into my lap when it was abruptly un-outsourced when the consultants walked off in a huff. They are emphatically not available for questions. The app was developed under using Eclipse and Java 5 to run under Tomcat. There are many, many problems but the one right now is getting the project set up under my copy of Eclipse. I followed their instructions up to the point where I attempt the Ant Build, and I get the following:

BUILD FAILED
C:\Java\PGME\build\build.xml:208: taskdef class org.apache.catalina.ant.InstallTask cannot be found

Looking at build.xml in Eclipse I see that it will also fail to find ReloadTask, ListTask, StartTask, and StopTask. All of those classes are present in catalina-ant.jar, so the jar file must not be in the expected location. Here's a fragment of build.xml:


ANT_HOME is
C:\Program Files\apache-ant-1.8.2 (I installed that this afternoon, previously trying 1.6.5)

I copied catalina-ant.jar to the lib folder of both 1.8.2 and 1.6.5.

CATALINA_HOME is
C:\Program Files\Apache Software Foundation\jakarta-tomcat-5.0.28

CLASSPATH is
.;C:\orion\orion.jar;C:\Program Files\Java\jdk1.5.0_12\lib\dt.jar;C:\Program Files\Java\jdk1.5.0_12\lib\tools.jar;C:\Program Files\glassfish-v2ur1\lib\javaee.jar;C:\Java;C:\Java\RanchCommon\jr.jar

Path is
C:\PROGRA~1\Borland\Delphi5\Projects\Bpl;C:\PROGRA~1\Borland\vbroker\jre\Bin;C:\PROGRA~1\Borland\vbroker\Bin;C:\PROGRA~1\Borland\Delphi5\Bin;C:\Program Files\Borland\Delphi7\Bin;C:\Program Files\Borland\Delphi7\Projects\Bpl\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files\jEdit;C:\Program Files\Java\jdk1.5.0_12\bin;C:\Program Files\apache-ant-1.8.2\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\

I'm hoping that I'm merely making an ignorant mistake. A few months ago I was able to build the project on this computer . . . before the hard drive got blown away, taking with it the tweaks that got it "buildable" last time (and which I unfortunately didn't write down).

I'm happy to provide any additional information.

-- Desperate in Hoboken
10 years ago
Stefan,

Thank you very much, that did the trick (so now hopefully I will know the trick).

-- Ed
10 years ago
JSP
Let me give a code fragment. The lower code works fine, but obviously ties this to the very specific configuration of my computer. I have tried many variations of the code commented out, such as "/WEB-INF/data/new.txt" I had naively thought that one or another of these would define the path relative to the context root. So here I sit with a dreadful example of hard coding. I think I may need a little spoon feeding here. Thanks!


10 years ago
JSP
OK, forgive the ignorant question, but how do I set/determine the path to the files?
10 years ago
JSP
OK, I didn't mean to be cryptic. The idea is to read from two text files, one containing categories and one containing numbers in text form. These values are displayed by the app. New values are entered in a third column, and those values get written to a third text file. All three files are in the data directory. Does that clarify the situation?
10 years ago
JSP
Hi.

Assume that I have a file /WEB-INF/data/categories.txt

For obvious reasons I don't want to hard-code a path to the data, but instead want to use a path relative to the application directory. How do I specify that relative path, either within the JSP or within web.xml?

Thanks!

[Edit]It would help if I specified that the app is running under Tomcat 6, but I can't use CATALINA_HOME since that is pointing to Tomcat 5.
10 years ago
JSP
As per Seetharaman Venkatasamy's suggestion, I'm starting a new thread with my question from the Regarding Package thread.

I'm going through the walkthrough in Chapter 3 of Head First Servlets & JSP. It works up to a point (and I can work around that point), but it looks like I should not have to.

The following works:

Directory structure:
C:\Java\HF\bV1\src\com\example\model
C:\Java\HF\bV1\src\com\example\web

From C:\Java\HF\bV1\src:

javac com\example\model\BE.java
javac com\example\web\BS.java
java com.example.model.BE

And this works:

From C:\Java\HF\bV1:

javac -classpath "C:\Program Files\Apache Software Foundation\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar";classes:. -d classes src\com\example\model\BE.java

But this does not, yielding "package com.example.model does not exist" (and note that without the import statement it DOES work):

javac -classpath "C:\Program Files\Apache Software Foundation\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar";classes:. -d classes src\com\example\web\BS.java

I can get the sample to run if I compile locally and then manually deploy the resulting class file, but it doesn't appear that should be necessary.

What am I doing wrong?
10 years ago