• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

ActionServlet compilation error

 
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
 
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.
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!