Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse + struts2.0

 
guthula lakshman
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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
Pie
Posts: 65114
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"lakshman", please check your private messages for an important administrative matter. Again.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Harimohan Mohan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Harimohan" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
 
guthula lakshman
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic