在创建SchemaFactory的新实例时出错

时间:2022-10-02 17:18:11

I am getting an exception while doing:

在做的时候我得到一个例外:

factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");

i am getting ileagal parameters, someone maybe know why?

我正在获得遗传参数,有人可能知道为什么?

Partial Stack Trace

部分堆栈跟踪

android.app.ActivityThread.access$1500(ActivityThread.java:117), android.app.ActivityThread$H.handleMessage(ActivityThread.java:935), android.os.Handler.dispatchMessage(Handler.java:99), android.os.Looper.loop(Looper.java:123), android.app.ActivityThread.main(ActivityThread.java:3691), java.lang.reflect.Method.invokeNative(Native Method), java.lang.reflect.Method.invoke(Method.java:507), com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847), com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605), dalvik.system.NativeStart.main(Native Method)]

android.app.ActivityThread.access $ 1500(ActivityThread.java:117),android.app.ActivityThread $ H.handleMessage(ActivityThread.java:935),android.os.Handler.dispatchMessage(Handler.java:99),android。 os.Looper.loop(Looper.java:123),android.app.ActivityThread.main(ActivityThread.java:3691),java.lang.reflect.Method.invokeNative(Native Method),java.lang.reflect.Method。 invoke(Method.java:507),com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:847),com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605),dalvik .system.NativeStart.main(Native Method)]

1 个解决方案

#1


-1  

You'll need to properly escape the colon, per http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String)

根据http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String),你需要正确地逃脱冒号。

Try factory = SchemaFactory.newInstance("http\://www.w3.org/2001/XMLSchema");

尝试factory = SchemaFactory.newInstance(“http \://www.w3.org/2001/XMLSchema”);

#1


-1  

You'll need to properly escape the colon, per http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String)

根据http://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String),你需要正确地逃脱冒号。

Try factory = SchemaFactory.newInstance("http\://www.w3.org/2001/XMLSchema");

尝试factory = SchemaFactory.newInstance(“http \://www.w3.org/2001/XMLSchema”);