Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes Error running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error running "Struts 2 Application" with "Tomcat 6.0" in Eclipse Helios" Watch "Error running "Struts 2 Application" with "Tomcat 6.0" in Eclipse Helios" New topic
Author

Error running "Struts 2 Application" with "Tomcat 6.0" in Eclipse Helios

Nilesh Bond
Greenhorn

Joined: Aug 18, 2010
Posts: 11
Hello All,

I am new to Struts 2.
I am trying to run the Struts 2 simple application.
this application has simple Login jsp page and one action.

Following are the Jar files I have included in the "WEB-INF/lib" folder.
1) struts2-core-2.2.1.jar
2) xwork-core-2.2.1.jar
3) commons-fileupload-1.2.1.jar
4) commons-io-1.3.2.jar
5) commons-logging-1.0.4.jar
6) freemarker-2.3.16.jar
7) ognl-3.0.jar

While starting the application, I am getting following exception.

----------------------------------------------------------------------------------------------------------------------



----------------------------------------------------------------------------------------------------------------------

Can anyone please help me out finding the cause of it?
Am I using the right versions of Jar files?
Any help will be greatly appreciated.



Many Thanks,
Nilesh
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

You are getting error of missing javassist library but its not given on dependencies list. On the dependency list OGNL 2.7.3 is given and you are using OGNL 3, try to use 2.7.3 version to see if it works...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

How are you managing your dependencies? It looks like you're missing the OGNL dependency on Javassist... which actually confuses me, because S2.1.8.1 also uses an OGNL that has a runtime dependency on Javassist, but I'm not deploying Javassist, and it still works.

Hmm, in S2.1.8.1 there's a specific POM exclusion of Javassist which is not present in the S2.2.1 POM, so I guess the dependency is now more absolute. Looking in the S2.2.1 download I see it's in the struts2-blank app, so it's now a hard dependency. You'll need it.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@Ankit: It's a runtime dependency; you shouldn't need it to compile S2 itself. It's a dependency of OGNL, not S2.
Nilesh Bond
Greenhorn

Joined: Aug 18, 2010
Posts: 11
Thanks for Replying and suggesting the solutions!!!

I have downloaded the
struts-2.2.1-all.zip

from
[i.e. from http://struts.apache.org/download.cgi site]

I got the list of Jar file after downloading this ZIP. Out of which for creating this application I have used the jar files that are underlined in the attached image.


So I thought that directly using these jar files will help me run my application.

Please let me know if there is any specific dependency list for Struts2-2.2.1 version.
And how to get the depend JAR files. [As per Ankit suggestion I tried downloading the OGNL 2.7.3 version but was not able to.]

Thanks in advance.


[Thumbnail for Files_Used.png]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Include the javassist jar; it's in the struts2-blank app. The dependencies are in the Maven poms, but the OGNL pom says that javassist is provided.

We're discussing it on the dev list right now.

Please don't post a picture for something that's just text: cut and paste the text directly. I'm not going to download an image just to look at some text.
Nilesh Bond
Greenhorn

Joined: Aug 18, 2010
Posts: 11
Thanks David and Ankit, for helping me out. Finally got the application running.

I have done following changes as per the suggestion:

1) Added javaassit.jar
2) Replaced ognl-3.0.jar with ognl-2.7.3.jar

I was getting other errors after making the changes.
Pl Note : Earlier I was using web module version "2.5". I modified it to "2.4". This fixed the problem.

The javaassit.jar should be included in the
struts-2.2.1-all.zip
as it has the dependency.

Quick Question : What changes i will have to make for running the Struts2 on Web Module "2.5"?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It *is* included in S2.2.1-all, in the blank application. As I said, we've brought it up on the dev list.

It's a bad Idea to downgrade OGNL, and there's no need to if you added the missing dependency.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's a "PI" note? In any case, I'm running under 2.5 with no issues. Without knowing more about what's going wrong for you with that it's impossible to help.
Nilesh Bond
Greenhorn

Joined: Aug 18, 2010
Posts: 11
"Pl Note" means "Please Note"
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Oh, okay. Please UseRealWords when posting. Using abbreviations makes your writing much harder to understand, especially for the many Ranchers for whom English isn't their native language. You can edit your post by using the button.
Nilesh Bond
Greenhorn

Joined: Aug 18, 2010
Posts: 11
Thanks David for guiding me.
I will follow these suggestions.

One query, what is this dev list you were talking about in your previous reply
we've brought it up on the dev list.


Thanks in advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The Struts 2 developer's list. You do know there's a Struts 2 user email list, right?
Nilesh Bond
Greenhorn

Joined: Aug 18, 2010
Posts: 11
Thanks David for clearing the concepts and answering my queries.
Darshan Shroff
Greenhorn

Joined: Nov 25, 2009
Posts: 12

This post was helpful. Thanks David, Nilesh.


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error running "Struts 2 Application" with "Tomcat 6.0" in Eclipse Helios
 
Similar Threads
Could not find a suitable constructor in com.opensymphony.xwork2.conversion
Sending a mail from struts application using the Spring Framework utility library
SEVERE: Dispatcher initialization failed
populate items using struts2 <s:select>
sample struts helloworld not working on eclipse