Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

new to STRUTS

Thread view: 
roohbir - 17 Mar 2007 11:53 GMT
Hello,

I have just started Struts and am trying to run a simple application
on my machine. However when I try to compile the java files it, the
following error comes up on the command-prompt:
===============================================================
C:\java\login>javac -classpath WEB-INF\lib\commons-
beanutils-1.7.0.jar;WEB-INF
\lib\commons-validator-1.3.1.jar;WEB-INF\lib\commons-
digester-1.8.jar;WEB-INF\li
b\oro-2.0.8.jar;WEB-INF\lib\struts-core-1.3.8.jar;WEB-INF\lib
\standard-1.0.2.jar
;WEB-INF\lib\struts-extras-1.3.8;WEB-INF\lib\struts-
scripting-1.3.8.jar;C:\Sun\S
DK\lib\j2ee.jar;"C:\Program Files\Apache Group\Tomcat 5.5\common\lib
\servlet-api
.jar" WEB-INF\src\com\hold\login\*.java -d WEB-INF\classes
WEB-INF\src\com\hold\login\MyForm.java:4: cannot find symbol
symbol  : class ActionError
location: package org.apache.struts.action
import org.apache.struts.action.ActionError;
                               ^
WEB-INF\src\com\hold\login\MyForm.java:50: cannot find symbol
symbol  : class ActionError
location: class com.hold.login.MyForm
           errors.add("password", new
ActionError("error.login.password.invalid
"));
                                                    ^
2 errors
================================================================

I copied and pasted all the jar files that came with the download of
struts-1.3.8 into my lib directory. Am I missing any file or something
else?

Would be really grateful if somebody could advise me.

ros
lukasz.kalek@gmail.com - 17 Mar 2007 12:26 GMT
> Hello,
>
[quoted text clipped - 35 lines]
>
> ros

Hi,

class ActionError has been deprecated since struts 1.2.0 and replaced
with ActionMessage. You should try to use the latter one.

Regards,
Bigos
ck - 17 Mar 2007 12:44 GMT
On Mar 17, 4:26 pm, lukasz.ka...@gmail.com wrote:

> > Hello,
>
[quoted text clipped - 43 lines]
> Regards,
> Bigos

ActionError is deprecated that does not imply that the class would not
compile, it should compile with warnings.
Could you just try to compile by adding struts.jar file in environment
variable classpath instead of javac -classpath option. You probably
are not providing the correct classpath options in

> > C:\java\login>javac -classpath WEB-INF\lib\commons-
> > beanutils-1.7.0.jar;WEB-INF
[quoted text clipped - 7 lines]
> > \servlet-api
> > .jar"

This is just such a confusing way of compiling. Try compiling with
complete path instead of relative path like "c:\struts\struts.jar"

--
Ck
http://www.gfour.net
lukasz.kalek@gmail.com - 17 Mar 2007 13:45 GMT
> ActionError is deprecated that does not imply that the class would not
> compile, it should compile with warnings.
> Could you just try to compile by adding struts.jar file in environment
> variable classpath instead of javac -classpath option. You probably
> are not providing the correct classpath options in

Right, it should compile with warnings with Struts 1.2.0 - but
ActionError class does not exist in Struts 1.3.8 at all - so it's not
a problem of CLASSPATH.

Regards,
Bigos
Lew - 17 Mar 2007 16:26 GMT
>> ActionError is deprecated that does not imply that the class would not
>> compile, it should compile with warnings.
[quoted text clipped - 5 lines]
> ActionError class does not exist in Struts 1.3.8 at all - so it's not
> a problem of CLASSPATH.

Besides, it's usually better to specify classpath in the compile command
rather than in an envar, and there is absolutely nothing wrong with using
relative paths in the classpath. In fact, relative classpaths are a great way
to ensure portability of your build script.

-- Lew
ck - 17 Mar 2007 16:59 GMT
> Besides, it's usually better to specify classpath in the compile command
> rather than in an envar, and there is absolutely nothing wrong with using

Certainly right

> relative paths in the classpath. In fact, relative classpaths are a great way
> to ensure portability of your build script.

If at all you call this a build script how do you ensure portability?

> C:\java\login>javac -classpath WEB-INF\lib\commons-
> beanutils-1.7.0.jar;WEB-INF
[quoted text clipped - 6 lines]
> DK\lib\j2ee.jar;"C:\Program Files\Apache Group\Tomcat 5.5\common\lib
> \servlet-api.jar"

I would certainly not call it a script, I would rather like to set
Environment variable or use ANT script than to type something so messy
every time(In windows once you close command prompt you cant get
the history of commands) or at least use a batch file.

--
Ck
http://www.gfour.net
Lew - 17 Mar 2007 20:03 GMT
Lew <l...@nospam.lewscanon.com> wrote:
>> relative paths in the classpath. In fact, relative classpaths are a great way
>> to ensure portability of your build script.

> If at all you call this a build script how do you ensure portability?

I never called this a build script.

>> C:\java\login>javac -classpath WEB-INF\lib\commons-
>> beanutils-1.7.0.jar;WEB-INF
[quoted text clipped - 8 lines]
>
> I would certainly not call it a script,

No one would, unless, of course, those commands were issued from a batch file
and what the OP gave us was the echo of that run.

> I would rather like to set Environment variable or use ANT script than to type something so messy
> every time(In windows once you close command prompt you cant get
> the history of commands) or at least use a batch file.

envars are not the way to go unless you only use your computer from one
project. Ant is definitely the way to go.

My use of the term "build script" was meant to be a big, fat hint to the OP
that if they weren't using a build script, they should. The notion that the
original process was not scripted was meant to be highlighted through irony.
Glad you caught it. (Surely you didn't think I was being anything but ironic?)

-- Lew
ck - 18 Mar 2007 21:07 GMT
> My use of the term "build script" was meant to be a big, fat hint to the OP
> that if they weren't using a build script, they should. The notion that the
> original process was not scripted was meant to be highlighted through irony.
> Glad you caught it. (Surely you didn't think I was being anything but ironic?)
>
> -- Lew

LOL, I know probably I over reacted. Thats first symptom of
inexperience.

--
Ck
http://www.gfour.net
Lew - 18 Mar 2007 21:42 GMT
> LOL, I know probably I over reacted. Thats first symptom of
> inexperience.

I'm glad you chuckled. Actually, you deserve credit for spotting exactly what
the issue was.

-- Lew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.