开发者

Eclipse Java Build Path does not find jars when launch with eclipse Helios

hope you can help me out with this problem, i have a web apps(JSF 2.0) in eclipse helios, i have created a class that uses apache.commons.validator because i need to validate a Url an开发者_如何学Cd some IPs addresses, everything compiles just find a launch it quite nicely but when it ccame the time to actually use the UrlValidator

java.lang.NoClassDefFoundError: org/apache/commons/validator/UrlValidator
at com.outboundfactory.bean.validator.UrlConverter.getAsObject(UrlConverter.java:34)
at com.icesoft.faces.renderkit.dom_html_basic.BaseRenderer.getConvertedValue(BaseRenderer.java:91)
at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1023)
at javax.faces.component.UIInput.validate(UIInput.java:953)

So a workaround that i found is to put the jakarta-oro and the apache-commons-validator into tomcat libs directly but thats no a solution either. Does anyone know if there is a special configuration to put the libs in Eclipse.

Here is a shot of how i have configured it

Eclipse Java Build Path does not find jars when launch with eclipse Helios


I you're using maven then mvn eclipse:eclipse will add in the jars.


you might try to add the external jars directly to the project build path instead of the general java build path. Right click on the project folder --> Build Path --> configure build path.


In a webapp, 3rd party JAR's needs to be placed in /WEB-INF/lib folder. No further actions needs to be take place. If it's a Dynamic Web Project, Eclipse will take care about them automagically.

Don't forget to undo the mess in build path. Remove the libraries you manually added there as external JARs from local disk file system while they belonged in /WEB-INF/lib folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜