亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

java.lang.IllegalArgumentException:錯誤

報錯內容:

D:\eclipse\workspace\Proxy/bin/com/sxw/simulationJdkProxy/$Proxy0.java

java.lang.IllegalArgumentException: argument type mismatch

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.sxw.simulationJdkProxy.Proxy.newProxyInstance(Proxy.java:77)

at com.sxw.simulationJdkProxy.Test.main(Test.java:7)

Exception in thread "main" java.lang.NullPointerException

at com.sxw.simulationJdkProxy.Test.main(Test.java:8)

代碼部分:

//編譯部分

//編譯器

JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();

//獲取文件管理器

StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);

//獲取文件

Iterable fileMag=fileManager.getJavaFileObjects(fileName);

//編譯任務

CompilationTask task=compiler.getTask(null, fileManager, null, null, null, fileMag);

//進行編譯

task.call();

fileManager.close();

//load到內存中

ClassLoader cl = ClassLoader.getSystemClassLoader();

Class class1 = cl.loadClass("com.sxw.simulationJdkProxy.$Proxy0");

//得到構造器,根據構造器創建對象

Constructor constructor =class1.getConstructor(interf);

return constructor.newInstance(new Car());


正在回答

1 回答

D:\eclipse\workspace\Proxy/bin/com/sxw/simulationJdkProxy/$Proxy0.java

這個目錄我感覺不大對

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

java.lang.IllegalArgumentException:錯誤

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號