aspose file tools*
The moose likes Struts and the fly likes Cant compile the struts application withEclispse 3.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

Cant compile the struts application withEclispse 3.4

Prasad Prabha
Greenhorn

Joined: Nov 26, 2008
Posts: 8
I have created a web application on struts..That was perfectly working,infact i was using Eclipse in developing the application...when i migrated the whole application into Eclipse 3.4..i am unable to compile the application using the build file...Does anyone give me an idea about the directory structure to be used in Eclipse...I have brought all the library files(jar) under the "Referenced Library" directory

The errors i am getting while compling the application is given below:

Buildfile: C:\workspace\sample\build.xml
compilesources:
[javac] Compiling 9 source files to C:\workspace\sample\WEB-INF\classes
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:5: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:6: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletRequest;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:7: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletResponse;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:8: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.Action;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:9: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForm;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:10: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForward;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:11: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionMapping;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:12: cannot find symbol
[javac] symbol: class Action
[javac] public class ChangeAction extends Action{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:13: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.ChangeAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:13: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.ChangeAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:13: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.ChangeAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:14: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.ChangeAction
[javac] req, HttpServletResponse res) throws ServletException,Exception{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:13: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.ChangeAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\ChangeAction.java:14: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.example.web.ChangeAction
[javac] req, HttpServletResponse res) throws ServletException,Exception{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:5: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:6: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletRequest;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:7: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletResponse;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:8: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.Action;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:9: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForm;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:10: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForward;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:11: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionMapping;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:12: cannot find symbol
[javac] symbol: class Action
[javac] public class LangAction extends Action{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:13: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.LangAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:13: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.LangAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:13: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.LangAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:14: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.LangAction
[javac] req, HttpServletResponse res) throws ServletException,IOException{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:13: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.LangAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LangAction.java:14: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.example.web.LangAction
[javac] req, HttpServletResponse res) throws ServletException,IOException{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:5: package org.apache.struts.upload does not exist
[javac] import org.apache.struts.upload.FormFile;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:6: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:7: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletRequest;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:8: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletResponse;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:9: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.*;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:10: package org.apache.struts.actions does not exist
[javac] import org.apache.struts.actions.DispatchAction;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:16: cannot find symbol
[javac] symbol: class DispatchAction
[javac] public class LoginAction extends DispatchAction{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:19: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward create(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:19: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward create(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:19: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward create(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:20: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.LoginAction
[javac] HttpServletResponse res) throws ServletException,IOException{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:19: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward create(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:20: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.example.web.LoginAction
[javac] HttpServletResponse res) throws ServletException,IOException{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:26: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward change(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:26: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward change(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:26: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward change(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:27: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.LoginAction
[javac] HttpServletResponse res) throws ServletException,IOException{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:26: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward change(ActionMapping map,ActionForm form,HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:27: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.example.web.LoginAction
[javac] HttpServletResponse res) throws ServletException,IOException{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:34: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward login(ActionMapping map,ActionForm
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:34: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward login(ActionMapping map,ActionForm
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:35: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.LoginAction
[javac] form,HttpServletRequest req, HttpServletResponse res) throws
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:35: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.LoginAction
[javac] form,HttpServletRequest req, HttpServletResponse res) throws
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:34: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.LoginAction
[javac] public ActionForward login(ActionMapping map,ActionForm
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginAction.java:36: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.example.web.LoginAction
[javac] ServletException,IOException,Exception{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginForm.java:2: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForm;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginForm.java:3: package org.apache.struts.upload does not exist
[javac] import org.apache.struts.upload.FormFile;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginForm.java:4: cannot find symbol
[javac] symbol: class ActionForm
[javac] public class LoginForm extends ActionForm{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginForm.java:9: cannot find symbol
[javac] symbol : class FormFile
[javac] location: class com.example.web.LoginForm
[javac] private FormFile theFile;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginForm.java:31: cannot find symbol
[javac] symbol : class FormFile
[javac] location: class com.example.web.LoginForm
[javac] public FormFile getTheFile() {
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\LoginForm.java:35: cannot find symbol
[javac] symbol : class FormFile
[javac] location: class com.example.web.LoginForm
[javac] public void setTheFile(FormFile theFile) {
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:5: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:6: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletRequest;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:7: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletResponse;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:8: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.Action;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:9: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForm;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:10: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionForward;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:11: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.ActionMapping;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:12: cannot find symbol
[javac] symbol: class Action
[javac] public class RegisterAction extends Action{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:13: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.RegisterAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:13: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.RegisterAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:13: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.RegisterAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:14: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.RegisterAction
[javac] req, HttpServletResponse res) throws ServletException,Exception{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:13: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.RegisterAction
[javac] public ActionForward execute(ActionMapping map,ActionForm form,HttpServletRequest
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\RegisterAction.java:14: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.example.web.RegisterAction
[javac] req, HttpServletResponse res) throws ServletException,Exception{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:4: package org.apache.struts.upload does not exist
[javac] import org.apache.struts.upload.FormFile;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:5: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:6: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletRequest;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:7: package javax.servlet.http does not exist
[javac] import javax.servlet.http.HttpServletResponse;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:8: package org.apache.struts.action does not exist
[javac] import org.apache.struts.action.*;
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:9: cannot find symbol
[javac] symbol: class Action
[javac] public class StrutsUploadAction extends Action
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:12: cannot find symbol
[javac] symbol : class ActionMapping
[javac] location: class com.example.web.StrutsUploadAction
[javac] ActionMapping map,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:13: cannot find symbol
[javac] symbol : class ActionForm
[javac] location: class com.example.web.StrutsUploadAction
[javac] ActionForm form,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:14: cannot find symbol
[javac] symbol : class HttpServletRequest
[javac] location: class com.example.web.StrutsUploadAction
[javac] HttpServletRequest req,
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:15: cannot find symbol
[javac] symbol : class HttpServletResponse
[javac] location: class com.example.web.StrutsUploadAction
[javac] HttpServletResponse response) throws Exception{
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:11: cannot find symbol
[javac] symbol : class ActionForward
[javac] location: class com.example.web.StrutsUploadAction
[javac] public ActionForward execute(
[javac] ^
[javac] C:\workspace\sample\WEB-INF\src\com\example\web\StrutsUploadAction.java:20: cannot find symbol
[javac] symbol : class FormFile
[javac] location: class com.example.web.StrutsUploadAction
[javac] FormFile myFile = myForm.getTheFile();
[javac] ^
[javac] 85 errors

BUILD FAILED
C:\workspace\sample\build.xml:9: Compile failed; see the compiler error output for details.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not a Struts question.

If you're building using an Ant file then you need to correct your Ant file; your classpath isn't correct.
Prasad Prabha
Greenhorn

Joined: Nov 26, 2008
Posts: 8
Hi David,

In that case how do I set my class path??...
My build file is written as...

<project name="BANK" default="copywar" basedir=".">

<!-- compiling the code -->
<target name="compilesources">
<javac srcdir="./WEB-INF/src" destdir="./WEB-INF/classes" includes="**/*.java" />
</target>

<!-- creating war file -->
<target name="createwar" depends="compilesources">
<jar jarfile="sample.war" basedir="." includes="WEB-INF/,jsp/" excludes="WEB-INF/src/" />
</target>

<!-- copying the ear file to jboss directory -->
<target name="copywar" depends="createwar">
<copy file="sample.war" todir="C:\Tomcat 5.5\webapps" overwrite="true"/>
</target>
</project>


I will also give my directory structure....

-sample(Project name)
-JRE System Library
-Referenced Libraries(contains all jar files for the app)
-JSP (Contains all the jsp files)
-WEB-INF
-classes
-lib
-src(all the java files)
-struts-config.xml
-struts-bean.tld(and all the tld files)
-web.xml
-build.xml
Could you pleases help me in sorting out in this issue??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60059
    
  65

"Prasad", having ignored multiple warnings to change your display name to comply with JavaRanch requirements, your account has been closed. Should you wish for your account to be re-instated, you must contact me via email.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cant compile the struts application withEclispse 3.4
 
Similar Threads
Whats wrong here? 'PACKAGE'
Compiling Struts from CMD.
LoginBean doesn't compile
package org.apache.struts.action does not exists
Problem with LoginAction.java