aspose file tools*
The moose likes Struts and the fly likes ActionServlet compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ActionServlet compilation error" Watch "ActionServlet compilation error" New topic
Author

ActionServlet compilation error

soraya soch
Greenhorn

Joined: May 05, 2008
Posts: 3
Hi, I'm new at struts, and have been battling all day with the a basic test (nice start!)

I can't seem to be able to compile it, javac can't seem to find xwork2.

I'm running java 1.5 with tomcat 6 and struts2.

The error I get is:
Test/HelloStruts.java:5: package org.apache.struts.action does not exist
import org.apache.struts.action.ActionServlet;
^
Test/HelloStruts.java:7: cannot find symbol

Any hints?


Thanks in advance,

S.

The following dump is my path:

/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices:/usr/local/ant/apache-ant-1.7.0/bin:/usr/local/tomcat/apache-tomcat-6.0.16/lib/struts-core-1.3.5.jar:/usr/local/tomcat/apache-tomcat-6.0.16/lib/xwork-2.0.4.jar:/usr/local/tomcat/apache-tomcat-6.0.16/lib/tiles-api-2.0.4.jar:/usr/local/tomcat/apache-tomcat-6.0.16/lib/tiles-core-2.0.4.jar:/usr/local/tomcat/apache-tomcat-6.0.16/lib/tiles-jsp-2.0.4.jar:/usr/local/tomcat/apache-tomcat-6.0.16/lib/ognl-2.6.11.jar:/usr/local/tomcat/a pache-tomcat-6.0.16/lib/freemarker-2.3.8.jar
Vishal Matere
Ranch Hand

Joined: Jan 22, 2008
Posts: 81
package org.apache.struts.action does not exist
Update to

make sure that struts jar file are in CLASSPATH also.

HTH
V
[ May 05, 2008: Message edited by: Vishal Matere ]

SCJP <br />SCWCD <br />SCBCD <br />SCEA-1
Vishal Matere
Ranch Hand

Joined: Jan 22, 2008
Posts: 81
import org.apache.struts.action.ActionServlet;

Just curious, why are you importing ActionSevlet?
Are you using it for any reason?
soraya soch
Greenhorn

Joined: May 05, 2008
Posts: 3
Thank you for the feedback, that import was a testing remnant... oops..
I was actually importing :

import com.opensymphony.xwork2.ActionSupport;

The purpose was to compile with javac (as opposed to ant or mvn) for a quick test, but I've been (shamefully) stuck all day...

I was trying to compile a version of the HelloWorld (http://struts.apache.org/2.0.11.1/docs/hello-world.html) by hand, but to no avail...
Vishal Matere
Ranch Hand

Joined: Jan 22, 2008
Posts: 81
I hope everything is working now ! ! !
soraya soch
Greenhorn

Joined: May 05, 2008
Posts: 3
Yes... that did the trick... I was so focused on the multi-relationships between tomcat-struts-ants-etc... that I missed out on the most obvious... ;-)

Thank you so much !

S.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ActionServlet compilation error