File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Eclipse + struts2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Eclipse + struts2.0" Watch "Eclipse + struts2.0" New topic
Author

Eclipse + struts2.0

guthula lakshman
Greenhorn

Joined: Sep 24, 2007
Posts: 21
i created the struts2.0 application . i created the login.jsp and home.jsp and i placed it in web-inf folder
2) i placed struts.xml and web.xml under web-inf and i created the packgae i placed it in src directory

and i imported all the neccessary jar files for both struts2.o and tomcat6.0 but i getting the

warning "Description Resource Path Location Type
Classpath entry E:/struts-lib/xwork-2.1.1.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. "

and when i run the application i geeting the error
"The requested resource () is not available." 404 status error.

could any body solve my error.


Thanks for advance


Regards
Lakshman
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294

and i imported all the neccessary jar files for both struts2.o and tomcat6.0 but i getting the


I don't know if my situation helps or not, but I use tomcat5.5 and I did what you said before, I imported all the necessary Jar files for struts 2 to the Tomcat 5.5/common/lib directory and my app couldn't work. because I was getting error in the log/localhost saying that struts 2 core jar file was loaded somewhere already, so what I did was reinstall Tomcat 5.5 and don't put the jar file in common/lib only include the jar file in Eclipse, and it worked for me. I hope this helps
Stephanie Dutcheson
Greenhorn

Joined: Dec 07, 2008
Posts: 17
[Blatant advertising removed. Please contribute to the discussion rather than just divert traffic to your own site.]
[ December 29, 2008: Message edited by: Bear Bibeault ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

"lakshman", please check your private messages for an important administrative matter. Again.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689

Hi,

Please Make sure you have include six jar for basic Struts 2.0 Application.
1 ) struts2-core-2.1.2
2 ) xwork-2.1.1
3 ) freemarker-2.3.12
4 ) ognl-2.6.11
5 ) commons-collections-3.2
6 ) commons-logging-1.1

Use this web.xml instead of above mention.


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>Struts Hibernate</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

And it is in your WEB-INF directory.


Your struts.xml is in the src folder.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Harimohan Mohan
Greenhorn

Joined: Dec 07, 2008
Posts: 6
Hi lakshman,

While deploying (inside tomcat) put all the JSP's in context root. Your struts.xml must be in classes directory and web.xml should be in WEB-INF directory. Also make sure that the lib directory contains all the 6 necessary .jar files
[ January 01, 2009: Message edited by: Harimohan ]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2718
    
    6

"Harimohan" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.


SCJP, SCWCD.
|Asking Good Questions|
guthula lakshman
Greenhorn

Joined: Sep 24, 2007
Posts: 21
Hi thanks for post,

i placed all the necessary jar files and current staging directory is correct even though i am getting the error.

i checked the error log it getting the following error.

SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:207)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 2, 2009 10:48:55 AM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart

i placed all necessary jars files. but even i didn't the Result. if any body get the application please send me to my gmail id :- lakshman.guthula@gmail.com or send me the solution for my application



Regards
Lakshman
aparna aigal
Greenhorn

Joined: Oct 10, 2010
Posts: 5
I am also facing same problem for creating new project.

java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher.

but for the project by importing struts2-blank-2.0.14.war is working fine.

Can any one help?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse + struts2.0