Struts 2.0 error

Hi,

I was trying to run simple struts 2.0 example in RAD 7.0 with built in IBM websphere 6.1 server. This example has simple login page with simple validation and when user enters username, password it should give message like

"successfully logged in" message. When i run this example giving folowing error as in attachment (even after adding xworks 2 jar as well). Any suggestions, ideas, resources, links, sample code highly appreciated. Thanks in advance.
Conolse.txt
LVL 7
gudii9Asked:
Who is Participating?
 
gudii9Author Commented:
Hi,

I replaced struts core 2.0.11 with 2.0.14 as suggested in above link from
apache site
http://struts.apache.org/download.cgi.

I still see the error in validation login page as in screenshot. Please advise how can i resolve this issue.
ValidationError.JPG
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
cmalakarCommented:
I suspect there might be something wrong in validation.xml..

>> Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"


0
 
gudii9Author Commented:
I see there are only two xml files in this project.

a. struts.xml which looks fine to me
b. login.valication.xml which does not give any compilation error etc which looks like
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC
              "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
              "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
              
<validators>
      <field name="username">
            <field-validator type="requiredstring">
                  <param name="trim">true</param>
                  <message>Login name is required</message>
            </field-validator>
      </field>
      <field name="password">
            <field-validator type="requiredstring">
                  <param name="trim">true</param>
                  <message>Password is required</message>
            </field-validator>
      </field>
</validators>

I do not see any validation.xml at all.
I am not sure where the issue is or what it mean by
Caused by: java.lang.IllegalArgumentException: URI scheme is not "file"
Please advise
0
 
gudii9Author Commented:
The jars i have in project are like this. Not sure if i need to add or remove some jars
JARS.JPG
0
 
cmalakarCommented:
Why dont to  use higher version of struts 2.0 ?
0
 
gudii9Author Commented:
Hi,
I removed some duplicate jars still same issues.I am using struts2 core 2.0.14 jars. Are there are higher version than this. Please advise
0
 
gudii9Author Commented:
Hi,

I was going through index.jsp and i see broken links for all 3 link actions as in attachment.  I am not sure how to fix these broken link warning errors. Please advise.
struts2warning.JPG
0
 
gudii9Author Commented:
Hi,

I resolved all those errors by re adjusting file location etc. And also filter issue i resolved by putting cleanupfilter at top of web.xml like
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
   
    <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
    </filter>

    <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>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>


Now i am getting new error message like




[12/24/09 17:09:49:937 CST] 00000028 XmlConfigurat I org.apache.commons.logging.impl.Jdk14Logger info Parsing configuration file [struts-default.xml]
[12/24/09 17:09:49:953 CST] 00000028 WebApp        E   [Servlet Error]-[Filter [struts2]: could not be initialized]: Unable to load bean: type: class:com.opensymphony.xwork2.ObjectFactory - bean - wsjar:file:/D:/Documents%20and%20Settings/GANESH/code_ranch/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/Struts2FreshEAR.ear/Struts2Fresh.war/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:208)
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:101)
      at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:131)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
      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 com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:438)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:352)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:214)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:272)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:661)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
      at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:628)
      at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:145)
      at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:595)
      at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
      at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the name xwork has already been loaded by bean - wsjar:file:/D:/Documents%20and%20Settings/GANESH/code_ranch/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/Struts2FreshEAR.ear/Struts2Fresh.war/WEB-INF/lib/struts2-core-2.0.11.jar!/struts-default.xml:30:72 - bean - wsjar:file:/D:/Documents%20and%20Settings/GANESH/code_ranch/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/Struts2FreshEAR.ear/Struts2Fresh.war/WEB-INF/lib/struts2-core-2.0.14.jar!/struts-default.xml:30:72
      at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:193)
      ... 35 more









xwork jar not there or something.
somewhere i read i need to put xalan and serilizer jar. I put them as well but no use.
Please advise on how to resolve it
0
 
gudii9Author Commented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.