?
Solved

Struts 2.0 error

Posted on 2009-12-21
11
Medium Priority
?
838 Views
Last Modified: 2013-11-24
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
0
Comment
Question by:gudii9
  • 7
  • 4
11 Comments
 
LVL 23

Expert Comment

by:cmalakar
ID: 26097475
0
 
LVL 7

Author Comment

by:gudii9
ID: 26098081
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
 
LVL 23

Expert Comment

by:cmalakar
ID: 26098157
I suspect there might be something wrong in validation.xml..

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


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Author Comment

by:gudii9
ID: 26099144
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
 
LVL 23

Accepted Solution

by:
cmalakar earned 2000 total points
ID: 26101585
0
 
LVL 7

Author Comment

by:gudii9
ID: 26108231
The jars i have in project are like this. Not sure if i need to add or remove some jars
JARS.JPG
0
 
LVL 23

Expert Comment

by:cmalakar
ID: 26109507
Why dont to  use higher version of struts 2.0 ?
0
 
LVL 7

Author Comment

by:gudii9
ID: 26119638
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
 
LVL 7

Author Comment

by:gudii9
ID: 26120486
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
 
LVL 7

Author Comment

by:gudii9
ID: 26121024
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
 
LVL 7

Author Closing Comment

by:gudii9
ID: 31668594
thank you
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question