user2245151
user2245151

Reputation: 67

Struts error - can not find package

Having the error:

 com.opensymphony.xwork2.ActionSupport; package does not exist

I am using struts2.3.8 and Not using eclipse or net beans, But have made this directory structure:

Code\Chapter\Struts2Application\WEB-INF\src\comm\kognet\action\ClientAction.java

and Unzipped struts2 and copied and stored jar files in:

Code\Chapter\Struts2Application\WEB-INF\lib

common-logging1-1-1
freemarker-2.3.19
ognl3.0.6
xwork core-2.3.8
struts2 core-2.3.8

I have set catalina_home as:

C:\Program Files\Java\jdk1.7.0_07\apache-tomcat-7.0.37

Path as:

C:\Program Files\Java\jdk1.7.0_07

classpath as .

I am New to Struts and this is my first program. Please Help

Upvotes: 0

Views: 1303

Answers (2)

rudy
rudy

Reputation: 1

Just go to your project name, right-click on it, select properties then select again libraries and classpath. There, you've just either add library or add jar/directory and voila!

Upvotes: -1

Dave Newton
Dave Newton

Reputation: 160191

  1. You're missing commons-io and commons-fileupload, and...
  2. ...please don't try to do dependency management by hand: use Maven, Ivy, etc. and...
  3. ...please don't do builds by hand, use Maven, Ant, etc.
  4. Setting the classpath (using either the preferred -classpath or -cp or the CLASSPATH environment variable, which IMO should be avoided) to . is insufficient. You need to add all your dependent jars explicitly, or via a wildcard, and...
  5. ...you should add the output directory of your compilation so your own classes are available as well.
  6. Don't put source into WEB-INF, use a directory outside of deployable artifacts. For toy development it's okay, but IMO it's a bad habit.

Upvotes: 2

Related Questions