Stax API conflicts with J2SE lib

I'm using Stax API ( http://stax.codehaus.org/) in my project. I'm using Eclipse IDE also. But I'm having a small issue. I have a  java file like below:

import  javax.xml.XMLConstants;

...
final private static  SchemaFactory SCHEMA_FACTORY =
SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI );
...

I want to use XMLConstants of J2SE lib. The problem is IDE just understands XMLConstants class here is of Stax API. XMLConstants class of Stax API doesn't have W3C_XML_SCHEMA_NS_URI property. That's why Eclipse can't compile my java file. I can't remove Stax API from my program because there are some others places I used it. 

====================================================

I have changed the order of JAR file in "Configure Build Path". It's ok now :-) 

解决方法: 将Stax API放在其他xml的api后面。

你可能感兴趣的:(Stax API conflicts with J2SE lib)