×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

commons-service.jar and can't compile

commons-service.jar and can't compile

commons-service.jar and can't compile

(OP)
Hi,
   I have 2 issues.  
1. I am following the  'Mastering Jakarta Struts" book. (I downloaded the struts v. 1.1. I am using Tomcat.)  On page 60 it listed which .jar files to move to the lib directory.  The only one that I couldn't find was commons-service.jar.  Also it mentioned xerces.jar but i only found xercesImpl.jar so I used that .jar.  I went to the struts site again but couldn't find the commons-service.jar file. Have things changed since publication and I don't need it?

2. Also, I can't seem to compile my form.  I get errors that it can't find the HttpServeletRequest and other imports.  Is this related to the .jar's that i am missing? my directory structure (if it helps) is a struts folder with my jsp files off that is webapps->WEB-INF->xml files and my classes & lib folders. Inside lib I put my jars.  In classes I have my classname folder where I would put my compiled java classes if I could. : )
Thanks!

RE: commons-service.jar and can't compile

(OP)
note: I just found a service-commons.jar so I am hoping that is the missing file.  I still can't compile though...

RE: commons-service.jar and can't compile

(OP)
forget that last message.
: P

RE: commons-service.jar and can't compile

Hi,

I am not sure about the .jar file you are looking for and I haven't used that .jar file in any of my projects.

HttpServeletRequest error might occur when you donot have servlet.jar in your classpath while compileing the java files.

Just make sure you have those jar files in your classpath.

Cheers,
Venu

RE: commons-service.jar and can't compile

(OP)
In my jdk classpath?  sorry, I am still pretty new and have never been able to compile on my pc. : P
thanks!

RE: commons-service.jar and can't compile

(OP)
Hi I think that i am goinng to post in the java forum bacause maybe that is a more relavant forum!  Just in case, I have servlet.jar in my tomact/common/lib folder and here are my errors from the commandline:

C:\Tomcat_4_1\webapps\pixieapp>javac GuestbookForm.java
GuestbookForm.java:16: illegal start of expression
        public String setGuestName(String guestname){
        ^
GuestbookForm.java:33: ';' expected
}
 ^
GuestbookForm.java:3: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
                          ^
GuestbookForm.java:4: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionForm;
                                ^
GuestbookForm.java:5: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMapping;
                                ^
GuestbookForm.java:7: cannot resolve symbol
symbol  : class ActionForm
location: class pixie.GuestbookForm
public class GuestbookForm extends ActionForm {
                                   ^
6 errors
------------------------

I have checked to see what it want's the ';' but can see no errors in my code!
---------------------

package pixie;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public class GuestbookForm extends ActionForm {

    private String guestname = null;
    private String comment = null;    

    public String getGuestName(){
       return (guestname);
    {

    public String setGuestName(String guestname){
       this.guestname = guestname;
    {

    public void getGuestComment(){
       return (comment);
    {

    public void setGuestComment(String comment){
       this.comment = comment;
    {    

    public void reset(ActionMapping mapping,HttpServeletRequest request) {

       this.guestname = null;
       this.comment = null;
    }
}

RE: commons-service.jar and can't compile

Hi,

Make sure your classpath is set properly before you compile the Java File. I changed the GuestbookForm try the below code.

Classpath should have jdk,serlvet.jar,struts.jar before you compile this

package pixie;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * User: vreddy
 * Date: Jan 19, 2004
 * Time: 10:58:42 AM
 * Java: ${filename}
 */
public class GuestbookForm extends ActionForm {

    private String guestname = null;
    private String comment = null;

    public String getGuestname() {
        return guestname;
    }

    public void setGuestname(String guestname) {
        this.guestname = guestname;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public void reset(ActionMapping mapping, HttpServletRequest request) {

       this.guestname = null;
       this.comment = null;
    }
}

Cheers
Venu

RE: commons-service.jar and can't compile

(OP)
Hi,
Thanks,
  I did notice those problems right after I posted!  Ialso put my struts.jar into the jdk../jre/lib/ext folder and that was fixed.
thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close