Hi

When I try to use my Struts2 webapps project with M2Eclipse I do not
succeed. the error bellow is raised in console :

*08/04/10 17:06:56:751 CEST] 00000021 WebApp        E   [Servlet
Error]-[Filter [struts2]: could not be initialized]: Unable to load
configuration. - bean -
wsjar:file:/C:/Documents%20and%20Settings/user/.m2/repository/org/apache/struts/struts2-core/
2.1.8.1/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72<http://2.1.8.1/struts2-core-2.1.8.1.jar%21/struts-default.xml:29:72>
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:431)
    at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
    at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:472)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:386)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:245)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:303)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:797)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:747)
    at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:700)
    at
com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:115)
    at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:856)
    at
com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:792)
    at
com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3548)
    at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
    at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:818)
    at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
    at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:125)
    at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
    at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
    at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
    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:165)
    at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
    at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1497)
Caused by: Unable to load configuration. - bean -
wsjar:file:/C:/Documents%20and%20Settings/user/.m2/repository/org/apache/struts/struts2-core/
2.1.8.1/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72<http://2.1.8.1/struts2-core-2.1.8.1.jar%21/struts-default.xml:29:72>
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
    ... 32 more
Caused by: Unable to load bean: type:
class:com.opensymphony.xwork2.ObjectFactory - bean -
wsjar:file:/C:/Documents%20and%20Settings/user/.m2/repository/org/apache/struts/struts2-core/
2.1.8.1/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72<http://2.1.8.1/struts2-core-2.1.8.1.jar%21/struts-default.xml:29:72>
    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)
    ... 34 more
Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with the
name xwork has already been loaded by bean -
wsjar:file:/D:/workspace7.5/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/Struts2PrototypeApp/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72
- bean -
wsjar:file:/C:/Documents%20and%20Settings/user/.m2/repository/org/apache/struts/struts2-core/
2.1.8.1/struts2-core-2.1.8.1.jar!/struts-default.xml:29:72<http://2.1.8.1/struts2-core-2.1.8.1.jar%21/struts-default.xml:29:72>
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:205)
    ... 37 more*


I use debug mode in my RAD7.5 IDE to discover the IBM Classloader give me
resource twice. Inside the workspace and in the .m2 folder

In debug mode I can notice that in my method *loadConfigurationFiles* of the
class *com.opensymphony.xwork2.config.providers.XmlConfigurationProvider*
I get an iterator urls (in bold) with :
[wsjar:file:/D:/workspace7.5/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/Struts2PrototypeApp/WEB-INF/lib/struts2-core-2.1.8.1.jar!/struts-default.xml,
wsjar:file:/C:/Documents and
Settings/user/.m2/repository/org/apache/struts/struts2-core/
2.1.8.1/struts2-core-2.1.8.1.jar!/struts-default.xml<http://2.1.8.1/struts2-core-2.1.8.1.jar%21/struts-default.xml>
]

    private List<Document> loadConfigurationFiles(String fileName, Element
includeElement) {
        List<Document> docs = new ArrayList<Document>();
        List<Document> finalDocs = new ArrayList<Document>();
        if (!includedFileNames.contains(fileName)) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Loading action configurations from: " +
fileName);
            }

            includedFileNames.add(fileName);

            Iterator<URL> urls = null;
            InputStream is = null;

            IOException ioException = null;
            try {
                urls = getConfigurationUrls(fileName);
            } catch (IOException ex) {
                ioException = ex;
            }

          *  if (urls == null || !urls.hasNext()) *{


When in debug mode a set the path to .m2 to null it works nice. How could I
correct this error it is painfull for productivity !!
-- 
Cordialement / Best regards

Fabrice Mercier



-- 
Cordialement / Best regards

Fabrice Mercier

Reply via email to