• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Struts 2 "package com.opensymphony.xwork2" does not exist

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to compile a java code, the code was developed in struts 2, but iam getting error as "package com.opensymphony.xwork2" does not exist
insert.java


It is just login page with validation program. i wants to compile to get the class file.

In lib folder i have pasted jar files, commons-logging-1.0.4,freemarker-2.3.8,ognl-2.6.11,struts2-core-2.0.11,xwork-2.0.4,sqljdbc4.
Iam using eclipseIDE.

Please solve my issue.

Thanks in advance.
 
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The oldest version of Struts 2 that I have handy is 2.1.6, but the list of required jars in that release is:
commons-fileupload-1.2.1.jar
commons-logging-1.1.jar
junit-3.8.1.jar
spring-test-2.5.6.jar
xwork-2.1.2.jar
commons-io-1.3.2.jar
freemarker-2.3.13.jar
ognl-2.6.11.jar
struts2-core-2.1.6.jar

The Struts release comes with several example applications. There should be one called "struts2-blank-x.x.x.war". If you unzip that, you can grab the required files in WEB-INF/lib.
 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still iam facing the same issue. While compiling time in command prompt iam getting same error, how i can get the class file. if there is any other options to get class file. My problem is to get the class file only. i have taken some programs code it is running perfectly but if take the some java code from that program outside and try to compile its showing the same error. I think in class path issue or what please guide me to solve my issue.

Thanks in advance.
 
Joe Ess
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

P Arunkumar wrote: I think in class path issue or what please guide me to solve my issue.



so how are you building your application?
 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi


Iam building my application in Eclipse 3.2 with struts2 concept, iam having one java file to run the Application in eclipse we need to paste the class file in classes folder wile iam compiling my java file outside (ie) in desktop iam having the file iam trying in cmd prompt, and the original file is also in eclipse project folder,iam getting error like package com.opensymphony.xwork2 does not exist. i have pasted all jar files in WED-INF folder.

My Java File is :



Iam getting error in command prompt :

I have attached the document for overview of my project screen and error page please find the attachment.

Thanks in advance.

Filename: Error-struts2.bmp
Description: error while compailing time
File size: 1 megabytes
Filename: Eclipse-screen.bmp
Description: Ecipse Project Screen
File size: 901 Kbytes
 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PLEASE reply for my query, to solve this problem,its so urgent.

from past 3days iam facing this problem. iam using jdk1.6.0_23 , tomcat 6.0 , struts 2

please i wants to compile please guide me.


Thanks in advance.
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Provide libraries path when you are compiling your programme javac -cp "lib/*" my.package.MainClass I haven't tried it. But it should work.
 
P Arunkumar
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi


Thanks for your reply, i can't understand where i want to paste my jar files. i can't understand your answer please explain me.
 
Joe Ess
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

P Arunkumar wrote:PLEASE reply for my query, to solve this problem,its so urgent.



First off, EaseUp. We are all volunteers here, answering questions in our free time.

As for your previous post, I think you are missing some puncuation, because I'm having a hard time parsing what you are saying:

P Arunkumar wrote:Iam building my application in Eclipse 3.2 with struts2 concept, iam having one java file to run the Application in eclipse we need to paste the class file in classes folder wile iam compiling my java file outside (ie) in desktop iam having the file iam trying in cmd prompt, and the original file is also in eclipse project folder,iam getting error like package com.opensymphony.xwork2 does not exist. i have pasted all jar files in WED-INF folder.



 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I dont know if this thing is solved. (Cause I faced the same issue but this link did not help me)
Anyway the issue is resolved now.
All I had to do was include few JARs required for this in the referenced libraries.
- asm-3.3.jar
- asm-commons-3.3.jar
- commons-dbcp-1.2.1.jar
- commons-dbcp-1.2.1-sources.jar
- commons-dbcp-1.3.jar
- commons-fileupload-1.2.2.jar
- commons-io-2.0.1.jar
- commons-lang3-3.1.jar
- commons-pool-1.5.3.jar
- freemarker-2.3.19.jar
- javassist-3.11.0.GA.jar
- jxl-2.6.jar
- ognl-3.0.5.jar
- ojdbc14-10.2.0.1.0.jar
- spring-2.5.6.SEC01.jar
- spring-core-2.5.6.SEC01.jar
- xwork-core-2.3.4.jar

Cheers!
 
Joe Ess
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch. I sure hope P Arunkumar wasn't waiting a year and a half for that reply
You don't have a Struts JAR file in your application which makes me suspicious about your solution. Also, the version of your Xwork file is 2.3.4. The current version is 2.3.15.3 and I don't think Spring (or OJDBC or JXL) is a dependency unless one is using those libraries.
The dependencies for a particular version of Struts will vary so it is always best to go off the example applications included with the distribution.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic