iReport的一個錯誤與json的衝突有關問題

tags:    時間:2013-12-13 18:43:54
iReport的一個異常與json的衝突問題
今天在調試iReport 3.7.5時,忽然報這樣一個錯:
 java.lang.VerifyError: (class: groovy/runtime/metaclass/java/util/HashMapMetaClass, method: super$2$invokeMethod signature: (Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;ZZ)Ljava/lang/Object;) Illegal use of nonvirtual function call 	at java.lang.Class.forName0(Native Method) 	at java.lang.Class.forName(Class.java:164) 	at groovy.lang.MetaClassRegistry$MetaClassCreationHandle.create(MetaClassRegistry.java:81) 	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getGlobalMetaClass(MetaClassRegistryImpl.java:252) 	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.access$100(MetaClassRegistryImpl.java:45) 	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getFromGlobal(MetaClassRegistryImpl.java:112) 	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$LocallyKnownClasses.getMetaClass(MetaClassRegistryImpl.java:88) 	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl$MyThreadLocal.getMetaClass(MetaClassRegistryImpl.java:361) 	at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:265) 	at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:764) 	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:753) 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167) 	at cps_ticket_1288087273585_76608.initParams(calculator_cps_ticket_1288087273585_76608:89) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 	at java.lang.reflect.Method.invoke(Method.java:585) 	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) 	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226) 	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:910) 	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77) 	at cps_ticket_1288087273585_76608.customizedInit(calculator_cps_ticket_1288087273585_76608:78) 	at net.sf.jasperreports.engine.fill.JREvaluator.init(JREvaluator.java:83) 	at net.sf.jasperreports.engine.fill.JRCalculator.init(JRCalculator.java:109) 	at net.sf.jasperreports.engine.fill.JRFillDataset.initCalculator(JRFillDataset.java:432) 	at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:589) 	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77) 	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:87) 	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57) 	at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:142) 	at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:78) 	at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624) 	at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:605) 	at com.bill99.cps.rat.srv.report.jasper.impl.AbstractJasperReportExporter.export(AbstractJasperReportExporter.java:88) 	at com.bill99.cps.rat.srv.report.jasper.impl.ReportGeneratorImpl.generateReport(ReportGeneratorImpl.java:53) 	at com.bill99.cps.rat.srv.report.impl.PortalReportServiceImpl.generateTicketReport(PortalReportServiceImpl.java:213) 	at com.bill99.cps.rat.srv.report.impl.PortalReportServiceImpl.generateReport(PortalReportServiceImpl.java:87) 	at com.bill99.cps.rat.srv.report.PortalReportServiceTest.persistReportPersistBill(PortalReportServiceTest.java:51) 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 	at java.lang.reflect.Method.invoke(Method.java:585) 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) 	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) 	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) 	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) 	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) 	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) 	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) 	at org.junit.runners.ParentRunner.run(ParentRunner.java:236) 	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)   

以調試后才知道maven的pom文件被同事增加一了些其它依賴,而其它依賴又間接地依賴較低版本的json版本(2.1),而iReport3.7.卻要求2.1以上版本的json。問題既然找到,在那個依賴中把較低版本的joson排除即可,如下:
		<dependency> 			<groupId>com.bill99.steel</groupId> 			<artifactId>steel-old-comp</artifactId> 			<version>1.0.0-SNAPSHOT</version> [color=red]			<exclusions> 				<exclusion> 				    <groupId>net.sf.json-lib</groupId> 				    <artifactId>json-lib</artifactId> 				</exclusion> 			</exclusions>[/color] 		</dependency>
1 樓 w156445045 2012-03-13  
刪除了低版本的json 咋還是報這個錯誤呢?

推薦閱讀文章

Bookmark the permalink ,來源:互聯網