Re-compiling class files...

Let me start by explaining everything i can from an 'Java-idiot's' point of view.

A fellow co-worker of mine wrote an app using Java that runs on jakarta-tomcat-3.3.1a. The program does the following: Anyone from within the LAB logs in to the server, gets a few calculations done, then has the results entered in an Oracle DB (8i).

Up until recently, the application has run perfectly. That was until my Lab has decided to change some components that were used in the calculations. I have located all the .*.java files and made what i believe were the necessary corrections and tried to compile them using javac.exe. I get a slew of errors that i have no idea what they mean. I only made 1 or 2 minor corrections to the code and being a PL/SQL developer, I paid extra attention to the syntax. If I could compile this 1 file I believe it would fix my application.

I have read extensive tutorials but cannot subsitute real-world experience for 'learning on the fly'.

What does the Tomcat server run? *.jar files? *.war files?

I can ALT-PRNTSCREEN any screensfor whoever helps me decipher what I am doing wrong.

Would anyone be willing to work with me via email/phone to help me solve this issue?

I would be willing to send the code, settings, whatever...

Any and ALL help is much appreciated...

Thank you for your consideration..

Mike Mullowney

[1419 byte] By [Ignoramusa] at [2007-11-27 9:08:08]
# 1
You have a big learning curve. You should hire a professional. I'm available.
sabre150a at 2007-7-12 21:45:46 > top of Java-index,Java Essentials,New To Java...
# 2

The *.java is already corrected.Just need help recompiling the package.Don't need someone to help me with the code.

already basically figured out how to compile, i dont understand why javac.exe wont compile a clean class file.

I actually tried compiling a non-edited *.java file and it still gave me same error msgs.

Thanks anyway...

Ignoramusa at 2007-7-12 21:45:46 > top of Java-index,Java Essentials,New To Java...
# 3
Just saying you are getting a bunch of error messages isn't very helpful.Try posting the errors here. Chances are however that you are missing some libraries you need, or that you classpath is incorrect, and those are finicky issues to fix, usually.~Tim
SomeoneElsea at 2007-7-12 21:45:46 > top of Java-index,Java Essentials,New To Java...
# 4

28 errors

C:\j2sdk1.4.1_01\bin>javac GetSampleInfoServlet.java

GetSampleInfoServlet.java:2: package javax.servlet does not exist

import javax.servlet.*;

^

GetSampleInfoServlet.java:3: package javax.servlet.http does not exist

import javax.servlet.http.*;

^

GetSampleInfoServlet.java:7: cannot resolve symbol

symbol : class HttpServlet

location: class GetSampleInfoServlet

public class GetSampleInfoServlet extends HttpServlet {

^

GetSampleInfoServlet.java:114: cannot resolve symbol

symbol : class HttpServletRequest

location: class GetSampleInfoServlet

public void doGet(HttpServletRequest req, HttpServletResponse res) throw

s

^

GetSampleInfoServlet.java:114: cannot resolve symbol

symbol : class HttpServletResponse

location: class GetSampleInfoServlet

public void doGet(HttpServletRequest req, HttpServletResponse res) throw

s

^

GetSampleInfoServlet.java:115: cannot resolve symbol

symbol : class ServletException

location: class GetSampleInfoServlet

ServletException, IOException {

^

GetSampleInfoServlet.java:133: cannot resolve symbol

symbol : class ServletOutputStream

location: class GetSampleInfoServlet

public void gimmeDaStuff(String inSampleId, ServletOutputStream out, Use

rObject user) throws IOException, SQLException {

^

GetSampleInfoServlet.java:272: cannot resolve symbol

symbol : class ServletOutputStream

location: class GetSampleInfoServlet

public void showMeDaLoot(ServletOutputStream out, String inSampleId, String

userName) throws IOException {

^

GetSampleInfoServlet.java:565: cannot resolve symbol

symbol : class ServletOutputStream

location: class GetSampleInfoServlet

private void negativeOnTheActiveSession(ServletOutputStream out) throws

IOException {

^

GetSampleInfoServlet.java:606: cannot resolve symbol

symbol : class HttpServletRequest

location: class GetSampleInfoServlet

public void doPost(HttpServletRequest req, HttpServletResponse res) thr

ows

^

GetSampleInfoServlet.java:606: cannot resolve symbol

symbol : class HttpServletResponse

location: class GetSampleInfoServlet

public void doPost(HttpServletRequest req, HttpServletResponse res) thr

ows

^

GetSampleInfoServlet.java:607: cannot resolve symbol

symbol : class ServletException

location: class GetSampleInfoServlet

ServletException, IOException {

^

GetSampleInfoServlet.java:117: cannot resolve symbol

symbol : class HttpSession

location: class GetSampleInfoServlet

HttpSession session = req.getSession (true);

^

GetSampleInfoServlet.java:119: cannot resolve symbol

symbol : class ServletOutputStream

location: class GetSampleInfoServlet

ServletOutputStream out = res.getOutputStream();

^

.\LoginServlet.java:1: package javax.servlet does not exist

import javax.servlet.*;

^

.\LoginServlet.java:2: package javax.servlet.http does not exist

import javax.servlet.http.*;

^

.\LoginServlet.java:6: cannot resolve symbol

symbol : class HttpServlet

location: class LoginServlet

public class LoginServlet extends HttpServlet{

^

.\LoginServlet.java:8: cannot resolve symbol

symbol : class HttpServletRequest

location: class LoginServlet

public void doGet(HttpServletRequest req, HttpServletResponse res) throws

^

.\LoginServlet.java:8: cannot resolve symbol

symbol : class HttpServletResponse

location: class LoginServlet

public void doGet(HttpServletRequest req, HttpServletResponse res) throws

^

.\LoginServlet.java:9: cannot resolve symbol

symbol : class ServletException

location: class LoginServlet

ServletException, IOException {

^

.\LoginServlet.java:46: cannot resolve symbol

symbol : class ServletOutputStream

location: class LoginServlet

public static void rogerOnTheInside(ServletOutputStream out, String name

, int shouldIGo) throws IOException {

^

.\LoginServlet.java:89: cannot resolve symbol

symbol : class ServletOutputStream

location: class LoginServlet

public static void negativeEntry(ServletOutputStream out) throws IOExce

ption {

^

.\LoginServlet.java:131: cannot resolve symbol

symbol : class HttpServletRequest

location: class LoginServlet

public void doPost(HttpServletRequest req, HttpServletResponse res) thr

ows

^

.\LoginServlet.java:131: cannot resolve symbol

symbol : class HttpServletResponse

location: class LoginServlet

public void doPost(HttpServletRequest req, HttpServletResponse res) thr

ows

^

.\LoginServlet.java:132: cannot resolve symbol

symbol : class ServletException

location: class LoginServlet

ServletException, IOException {

^

.\ConnManager.java:8: package oracle.jdbc.driver does not exist

DriverManager.registerDriver ( new oracle.jdbc.driver.OracleDriv

er());

^

.\LoginServlet.java:14: cannot resolve symbol

symbol : class HttpSession

location: class LoginServlet

HttpSession session;

^

.\LoginServlet.java:16: cannot resolve symbol

symbol : class ServletOutputStream

location: class LoginServlet

ServletOutputStream out = res.getOutputStream();

^

28 errors

=

I'd be happy to rar all files and send also if that helps....

Ignoramusa at 2007-7-12 21:45:46 > top of Java-index,Java Essentials,New To Java...
# 5

At least one required jar file is not on your classpath. I didn't look at all the error messages, so there may be more.

The one that I know is missing is called j2ee.jar, or servlet-api.jar, or something like that.

javac -classpath some_directory;a.jar;b.jar;c.jar x.java y.java z.java

jverda at 2007-7-12 21:45:46 > top of Java-index,Java Essentials,New To Java...
# 6
thanks.....I set the classpath to where all the classfiles are. I will put the .jar files i believe that are associated in the same directory as the class files. I'll post again tomorrow morning. Have to leave work for wifes DR. appt.Thank you for your help and
Ignoramusa at 2007-7-12 21:45:47 > top of Java-index,Java Essentials,New To Java...
# 7

> thanks.....I set the classpath to where all the

> classfiles are. I will put the .jar files i believe

> that are associated in the same directory as the

> class files.

Just putting the jar files there won't work. You have to explicitly specify the jar files. A jar file is equivalent to a directory in this way.

jverda at 2007-7-12 21:45:47 > top of Java-index,Java Essentials,New To Java...