facebook

Tomcat question – Excluding xerces jars at deployment

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #326976 Reply

    Hi,

    What is the right way to tell MyEclipse to not include specific jar files in the WEB-INF of the web application during deployment?

    I am getting a deployment error for a Struts 2 application in Tomcat 5.5. I am using Java 1.6.0_26 and MyEclipse 9. Please see stack track extracts at the end of this message.

    This problem seems to come because of the conflicts between different Xerces versions. The solution is to not include the xerces and xml-api jars in the application’s WEB-INF. This works fine when I deploy in Tomcat externally.

    However, when I deploy to Tomcat through MyEclipse by using the “Manage Deployments” functionality, MyEclipse includes the Xerces and other jar files in the WEB-INF of the web application, causing the conflict.

    So I need a mechanism to tell MyEclipse to not include these specific jars in the WEB-INF of the web application. How can I do that?

    Note that these specific jars are included as “External Jars” in the build path (“Libraries” tab). They are deselected in the “Order and Export” tab.

    Thanks in advance.
    Unmesh

    Stack trace:

    SEVERE: Dispatcher initialization failed
    Unable to load configuration. – [unknown location]
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)

    This can be traced to the following exception:

    … 17 more

    Caused by: java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
    at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)

    #326984 Reply

    support-swapna
    Moderator

    unmeshdev,

    You can have the libraries that you want to omit on the project build path. You can then go to Windows > Pref > MyEclipse > Java Enterprise Project > Web Project > Deployment and uncheck “JARS on web-project build path” under library deployment policy.

    The libraries that you want to deploy can be placed in a user library and the user library can be added to the project.

    You can check this tutorial for detailed information of deployment policies :
    http://www.myeclipseide.com/documentation/quickstarts/webprojects/index.html#external_libraries

    Let us know how it works for you.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Tomcat question – Excluding xerces jars at deployment

You must be logged in to post in the forum log in