Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 22nd, 2004, 03:27 PM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default cannot resolve symbol (struts)

hello all...
firstly i would like to apologize for my bad english:P but lets get down to buissness...
i have problem with compiling my java files... i think that it cant see my jar files... but i dunno know why... i tried to find something about it without any results...

it is some lines from my build.xml file:

<path id="classpath">
    <fileset dir="${basedir}/lib">
        <include name="*.jar"/>
    </fileset>
</path>

<javac srcdir="${basedir}" destdir="${tomcat.webapps}/${app.name}/classes" debug="on">
    <include name="*.java"/>
    <classpath refid="classpath"/>
</javac>

in lib i have this jar files:
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-fileupload.jar
commons-logging.jar
commons-validator.jar
jakarta-oro.jar
jstl.jar
servlet-api.jar
standard.jar
struts.jar

and 2 java files are in basedir

when im trying to compile it...

Buildfile: build.xml

clean:
[delete] Deleting directory C:\java\jwsdp\webapps\pb\web
[delete] Deleting directory C:\java\jwsdp\webapps\pb\WEB-INF
[delete] Deleting directory C:\java\jwsdp\webapps\pb\classes
[delete] Deleting directory C:\java\jwsdp\webapps\pb\src

init:

prepare:
    [mkdir] Created dir: C:\java\jwsdp\webapps\pb\web
    [mkdir] Created dir: C:\java\jwsdp\webapps\pb\WEB-INF
    [mkdir] Created dir: C:\java\jwsdp\webapps\pb\classes
    [mkdir] Created dir: C:\java\jwsdp\webapps\pb\src

build:
    [javac] Compiling 2 source files to C:\java\jwsdp\webapps\pb\classes
    [javac] C:\java\projects\portal bankowy\UserLoginAction.java:9: cannot resol
ve symbol
    [javac] symbol : class Action
    [javac] location: class src.actions.UserLoginAction
    [javac] public class UserLoginAction extends Action{
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginAction.java:11: cannot reso
lve symbol
    [javac] symbol : class ActionMapping
    [javac] location: class src.actions.UserLoginAction
    [javac] public ActionForward execute(ActionMapping mapping , ActionForm
form ,
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginAction.java:11: cannot reso
lve symbol
    [javac] symbol : class ActionForm
    [javac] location: class src.actions.UserLoginAction
    [javac] public ActionForward execute(ActionMapping mapping , ActionForm
form ,
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginAction.java:11: cannot reso
lve symbol
    [javac] symbol : class ActionForward
    [javac] location: class src.actions.UserLoginAction
    [javac] public ActionForward execute(ActionMapping mapping , ActionForm
form ,
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginForm.java:5: cannot resolve
symbol
    [javac] symbol : class ActionForm
    [javac] location: class src.forms.UserLoginForm
    [javac] public class UserLoginForm extends ActionForm{
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginForm.java:14: cannot resolv
e symbol
    [javac] symbol : class ActionErrors
    [javac] location: class src.forms.UserLoginForm
    [javac] public ActionErrors validate(){
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginAction.java:14: cannot reso
lve symbol
    [javac] symbol : class UserLoginFrom
    [javac] location: class src.actions.UserLoginAction
    [javac] String usr = ((UserLoginFrom)form).getUser();
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginAction.java:15: cannot reso
lve symbol
    [javac] symbol : class UserLoginFrom
    [javac] location: class src.actions.UserLoginAction
    [javac] String pss = ((UserLoginFrom)form).getPassword();
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginForm.java:17: cannot resolv
e symbol
    [javac] symbol : class ActionError
    [javac] location: class src.forms.UserLoginForm
    [javac] return new ActionError(error.loginOrPassword.req
uired);
    [javac] ^
    [javac] C:\java\projects\portal bankowy\UserLoginForm.java:17: package error
does not exist
    [javac] return new ActionError(error.loginOrPassword.req
uired);
    [javac] ^
    [javac] 10 errors

BUILD FAILED
C:\java\projects\portal bankowy\build.xml:33: Compile failed; see the compiler e
rror output for details.

Total time: 15 seconds

can anybody help me? it is my project to school and i need it pretty fast...:/

and one more question.. my friend said that eclipse generate all imorts... i tried to use it but i got message "the resource is not on the build path Java project" someone have any idea why does it happen?:/
 
Old November 23rd, 2004, 11:52 AM
Registered User
 
Join Date: Nov 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anirbanbasuz
Default

Hello,

Use the following in your build file. In the classpath settings(where I have refred to weblogic.jar, you give explicit path to the jar files.
It will work. If any developments, let me know.

Anirban
<path id="libs">
<pathelement path="${java.home}/lib/tools.jar;${weblogic.lib}/weblogic.jar;"/>
</path>
</target>

<target name="javacexample">
<javac srcdir="${src.dir}/example" destdir="${class.dir}/example">
<classpath refid="libs"/>
</javac>
</target>


Anirban Basu
 
Old November 23rd, 2004, 01:19 PM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thx for reply but it didnt change anything (maybe there is 7 errors more:P)

im not sure if i understood u... if u mean that i should change mine

<path id="classpath">
    <fileset dir="${basedir}/lib">
        <include name="*.jar"/>
    </fileset>
</path>

to

<path id="classpath">
<pathelement path="${java.home}/lib/tools.jar;${basedir}/lib;"/>
</path>

(+adding java.home as env.JAVA_HOME)

if i did that what u thinking about it didnt help...:/ anyway thx again for replying and im w8ing for other ideas...






Similar Threads
Thread Thread Starter Forum Replies Last Post
struts actions package: "struts", other packages? ojasrege Struts 1 July 21st, 2007 06:02 AM
java bean file not found / cannot resolve symbol r Calverstine JSP Basics 4 July 3rd, 2006 05:38 AM
Error-cannot resolve symbol Rusk JSP Basics 1 February 18th, 2004 09:20 AM
cannot resolve symbol problem ioda006 JSP Basics 2 July 28th, 2003 06:04 AM
Error: Cannot resolve symbol "Beginning JSP" amcp2002 Wrox Book Feedback 2 July 22nd, 2003 03:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.