aspose file tools*
The moose likes Struts and the fly likes package org.apache.struts.action does not exists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "package org.apache.struts.action does not exists" Watch "package org.apache.struts.action does not exists" New topic
Author

package org.apache.struts.action does not exists

shilpa.bspl jain
Greenhorn

Joined: Jul 29, 2006
Posts: 3
Hello All!

I have been tryign simple struts application based on the code provided in Struts the complete reference.

i have installed and configured tomcat successfully
i m using jdk version 1.5
i have downloaded the source code from the complete reference
but when i try implement the java source code files i got the following compile error:



D:\java\MiniHR\WEB-INF\src\com\jamesholmes\minihr>javac *.java
SearchAction.java:8: package org.apache.struts.action does not exist
import org.apache.struts.action.Action;
^
SearchAction.java:9: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionForm;
^
SearchAction.java:10: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionForward;
^
SearchAction.java:11: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMapping;
^
SearchAction.java:13: cannot find symbol
symbol: class Action
public final class SearchAction extends Action
^
SearchAction.java:15: cannot find symbol
symbol : class ActionMapping
location: class com.jamesholmes.minihr.SearchAction
public ActionForward execute(ActionMapping mapping,
^
SearchAction.java:16: cannot find symbol
symbol : class ActionForm
location: class com.jamesholmes.minihr.SearchAction
ActionForm form,
^
SearchAction.java:15: cannot find symbol
symbol : class ActionForward
location: class com.jamesholmes.minihr.SearchAction
public ActionForward execute(ActionMapping mapping,
^
SearchForm.java:7: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMessage;
^
SearchForm.java:8: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMessages;
^
SearchForm.java:9: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionForm;
^
SearchForm.java:10: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionMapping;
^
SearchForm.java:12: cannot find symbol
symbol: class ActionForm
public class SearchForm extends ActionForm
^
SearchForm.java:43: cannot find symbol
symbol : class ActionMapping
location: class com.jamesholmes.minihr.SearchForm
public void reset(ActionMapping mapping, HttpServletRequest request)
^
SearchForm.java:51: cannot find symbol
symbol : class ActionMapping
location: class com.jamesholmes.minihr.SearchForm
public ActionErrors validate(ActionMapping mapping,
^
SearchForm.java:51: cannot find symbol
symbol : class ActionErrors
location: class com.jamesholmes.minihr.SearchForm
public ActionErrors validate(ActionMapping mapping,
^
SearchForm.java:54: cannot find symbol
symbol : class ActionMessages
location: class com.jamesholmes.minihr.SearchForm
ActionMessages errors = new ActionMessages();
^
SearchForm.java:54: cannot find symbol
symbol : class ActionMessages
location: class com.jamesholmes.minihr.SearchForm
ActionMessages errors = new ActionMessages();
^
SearchForm.java:73: cannot find symbol
symbol : class ActionError
location: class com.jamesholmes.minihr.SearchForm
new ActionError("error.search.criteria.missing"));
^
SearchForm.java:80: cannot find symbol
symbol : class ActionError
location: class com.jamesholmes.minihr.SearchForm
new ActionError("error.search.ssNum.invalid"));
^
Note: EmployeeSearchService.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
20 errors


please provide help

i hve copied the jar files into the lib directory of the miniHR application as well

i have set the classpath environment variable to point to the jar files
still getting errors
please suggest
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It appears that although you may have tried to set the classpath to include the struts.jar file, you did not succeed in doing so. If the struts.jar file and the other jar files that come with the Struts download were in your classpath, you would not be getting these errors. Double check the classpath you're using to compile your classes.


Merrill
Consultant, Sima Solutions
shilpa.bspl jain
Greenhorn

Joined: Jul 29, 2006
Posts: 3
Hello !!

Thanks for reply ..now I am making sure that the jar files are on the classpath.... I am using the classpath option from the command prompt as specified in Struts- The Complete Reference book .....
Now I am attempting to compile the struts application using the following command at the command prompt and getting the following errors:

D:\java\MiniHR>javac -classpath "WEB-INF\lib\commons-beanutils.jar;WEB-INF\lib\c
ommons-collections.jar;WEB-INF\lib\commons-lang.jar;WEB-INF\lib\commons-logging.
jar;WEB-INF\lib\commons-validator.jar;WEB-INF\lib\commons-digester.jar;WEB-INF\l
ib\commons-fileupload.jar;WEB-INF\lib\jakarta-oro.jar;WEB-INF\lib\struts.jar;D:\
java\apache-tomcat-5.5.16\common\lib\servlet-api.jar" WEB-INF\src\com\jamesholme
s\miniHR\*.java -d WEB-INF\classes
WEB-INF\src\com\jamesholmes\miniHR\SearchForm.java:51: cannot find symbol
symbol : class ActionErrors
location: class com.jamesholmes.minihr.SearchForm
public ActionErrors validate(ActionMapping mapping,
^
WEB-INF\src\com\jamesholmes\miniHR\SearchForm.java:73: cannot find symbol
symbol : class ActionError
location: class com.jamesholmes.minihr.SearchForm
new ActionError("error.search.criteria.missing"));
^
WEB-INF\src\com\jamesholmes\miniHR\SearchForm.java:80: cannot find symbol
symbol : class ActionError
location: class com.jamesholmes.minihr.SearchForm
new ActionError("error.search.ssNum.invalid"));
^
Note: WEB-INF\src\com\jamesholmes\miniHR\EmployeeSearchService.java uses uncheck
ed or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

D:\java\MiniHR>


Please provide help to remove these errors!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It looks like you may have forgotten to include import statements for ActionError and ActionErrors:

import org.apache.srtuts.action.ActionError;
import org.apache.struts.action.ActionErrors;

Also, be aware that the book you are using was written for an earlier version of Struts. For Struts 1.2.9, you should be using ActionMessages instead of ActionErrors and ActionMessage instead of ActionError.
[ July 31, 2006: Message edited by: Merrill Higginson ]
shilpa.bspl jain
Greenhorn

Joined: Jul 29, 2006
Posts: 3
Hello Merill!!

Thanks for your support all the time.....I have successfully implemented the Struts application.

Thanks a lot!!!
 
 
subject: package org.apache.struts.action does not exists