aspose file tools*
The moose likes Struts and the fly likes not able to run the most basic app... even basic than helloWorld.. please guide Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "not able to run the most basic app... even basic than helloWorld.. please guide" Watch "not able to run the most basic app... even basic than helloWorld.. please guide" New topic
Author

not able to run the most basic app... even basic than helloWorld.. please guide

Mayank Batra
Greenhorn

Joined: Sep 24, 2010
Posts: 6

I am 1 month old in struts2
trying to build a simple application that does absolutely no business . I am using ecllipse helios,Apache Tomcat v6.0 just want to run struts2 app.As I am here , Quite obviously m troubled which goes like this :-





Sep 24, 2010 12:19:07 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/F:/Mayank%20Batra/WORKSPACE2/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Example1/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:36:148
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: Unable to load bean: type:com.opensymphony.xwork2.util.ObjectTypeDeterminer class:com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer - bean - jar:file:/F:/Mayank%20Batra/WORKSPACE2/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Example1/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:36:148
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:221)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:169)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 21 more
Caused by: java.lang.ClassNotFoundException: com.opensymphony.xwork2.util.GenericsObjectTypeDeterminer
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:146)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:192)
... 24 more
Sep 24, 2010 12:19:07 PM org.apache.catalina.core.StandardContext start
SEVERE: Error filterStart
Sep 24, 2010 12:19:07 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Example1] startup failed due to previous errors


My app structure :-

SampleStruts
|
|---Java Resources: src
| |
| |---action
| | |
| | |---loginAction.java
| |
| |---struts.xml
|
|---WebContent
| |
| |---WEB-INF
| | |
| | |---lib
| | | |
| | | |---commons-beanutils-1.6.jar
| | | |---commons-fileupload-1.1.1.jar
| | | |---commons-io-1.2.jar
| | | |---commons-logging-1.1.jar
| | | |---ognl-2.6.11.jar
| | | |---struts2-core-2.0.11.jar
| | | |---xwork-2.0.4.jar
| | |---web.xml
| |
| |---login.jsp
|
|
|



my struts.xml : --


<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
<package name="default" namespace="/" extends="struts-default">

<action name="loginplz" class="/action.LoginAction">
<result name="success">/index.jsp</result>
</action>
</package>
</struts>
<br>



my web.xml : --


<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

<display-name>S2 HelloWorld (XML Based)</display-name>

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


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

<welcome-file-list>

<welcome-file>login.jsp</welcome-file>
</welcome-file-list>

</web-app>


login.jsp -

<br>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hi
</body>
</html>



LoginAction.java ---




package action;

public class LoginAction {

public String execute()
{
return "success";
}

}



Please guide i am not able to see Hi

I get-- >

The requested resource () is not available.


Please guide . I feel info given is sufficient



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Well, you're missing the Freemarker jar, but that shouldn't cause the error you're seeing. I'm a little puzzled by the app context, too, since it says "Example1" whereas your directory structure is "SampleStruts"--did you explicitly set the context path as different from your project name? Or project name different from the directory name?

Have you attempted to create multiple test projects? If so, delete them and just work on one at a time: the error is very clear, it's just a matter of understanding where the project with the missing libraries is coming from.
Mayank Batra
Greenhorn

Joined: Sep 24, 2010
Posts: 6
thanks for your reply david ..
The Example1 and SampleStruts issue is a Typo . I am executing Example1 only .
Yes,I had multiple test projects. But deleting them did not serve the cause either.
I would like to mention that the same code is working perfectly fine on one of my colleague's machine(I wrote the same code there.I have'nt deployed my war there)
I download a sample HelloWorld struts application,it is running properly on server on my machine.

MB
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

They'd need to be deleted from the server as well: right now it looks like there is a project that doesn't have all the appropriate dependencies.
Mayank Batra
Greenhorn

Joined: Sep 24, 2010
Posts: 6
actually what I did is I deleted the server itself and created a fresh one..
but still stuck
Mayank Batra
Greenhorn

Joined: Sep 24, 2010
Posts: 6
i got through..
the peroblem was :--
<action name="loginplz" class="/action.LoginAction">
i changed to :-
<action name="loginplz" class="action.LoginAction">

the app worked fine..

I did some jumbles after that :-
like.. i created a button on my login.jsp page which redirects me to another jsp-welcome.jsp
i changed in web.xml --
<filter-class>org.apache.struts2.filter.FilterDispatcher</filter-class>

i got following error ---

SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.filter.FilterDispatcher
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:249)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


quite obviously unable to locate filterdispatcher.

I changed it back to
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>

but surprise!! surprise ..
when I run the app it opens login.jsp
but submit button click changes the URL to
http://localhost:8081/Example1/loginAction.action;jsessionid=7BE514737190289748CD6B904AA5B078
but doesnt takes me to welcome.jsp(or for the sake goes away from login.jsp)
and diaplays the same error mentioned in this post reply...


SEVERE: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.filter.FilterDispatcher
bla bla bla..

please tell me where the problem is??



*** -- do i need to create a new thread for this???
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not able to run the most basic app... even basic than helloWorld.. please guide
 
Similar Threads
Error filterStart ... Struts2
Exception in Struts2
Exception in struts2 server startup
Error in Struts2 application
SEVERE: Exception starting filter struts2