How to override server jar with ones from WEB-INF/

2019-02-28 18:35发布

问题:

i have Web Application which should use JSF 2.0 libraries included in WEB-INF/lib... but it does not... instead of i'm getting exception because my server (JBoss 4.2) also provides JSF libraries...

How can i force my application to use .jar's from WEB-INF/lib ?

Note: When i removed JSF libs from server, my application runs as it should.

回答1:

Tell JBoss that your WAR already bundles JSF by the following entry in your webapp's web.xml.

<context-param>
    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
</context-param>


回答2:

Why can't you use the server versions of those JARs?

You should be writing and testing your application using the same versions of the JARs that the server you deploy to is using. Synch up....I'd either upgrade JBOSS or downgrade your app.

But, if you must, perhaps this document can tell you how:

http://www.datadisk.co.uk/html_docs/java_app/jboss5/jboss5_deployment.htm



标签: jsf jsf-2 jboss