Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ActionServlet compilation error

 
soraya soch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Vishal Matere
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import org.apache.struts.action.ActionServlet;

Just curious, why are you importing ActionSevlet?
Are you using it for any reason?
 
soraya soch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope everything is working now ! ! !
 
soraya soch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic