为了账号安全,请及时绑定邮箱和手机立即绑定

老报java.lang.IllegalArgumentException,这个是什么问题啊

配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"    
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
xmlns:context="http://www.springframework.org/schema/context"     
xsi:schemaLocation="http://www.springframework.org/schema/beans          
                    http://www.springframework.org/schema/beans/spring-beans.xsd            
                    http://www.springframework.org/schema/context             
                    http://www.springframework.org/schema/context/spring-context.xsd"> 
                    
 <context:component-scan base-package="com.zhujie"></context:component-scan>
 </beans>
Java文件
package com.zhujie;
import org.springframework.stereotype.Component;
@Component
public class ZhujieDemo { 
public void say() {      
        System.out.println("hello");     
    }
}
package com.zhujie;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import com.zhuru.UnitTestBase;
@RunWith(BlockJUnit4ClassRunner.class)
public class TestDemo extends UnitTestBase{
 public TestDemo() {      
     super("zhujie.xml"); 
 }  
@Test public void testdemo() {      
    ZhujieDemo demo = super.getBean("zhujieDemo");      
    demo.say();     
    }    
}

错误:

java.lang.IllegalArgumentException
 at org.springframework.asm.ClassReader.<init>(Unknown Source)
 at org.springframework.asm.ClassReader.<init>(Unknown Source)
 at org.springframework.asm.ClassReader.<init>(Unknown Source)
 at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)
 at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
 at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
 at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
 at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)
 at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
 at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)
 at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)
 at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)
 at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)
 at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)
 at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)
 at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
 at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
 at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
 at com.zhuru.UnitTestBase.before(UnitTestBase.java:25)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.base/java.lang.reflect.Method.invoke(Unknown Source)
 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.RunBefores.evaluate(RunBefores.java:27)
 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

之前报了次这个,百度了说换jdk1.7就好了。现在又出来了,版本还是1.7

正在回答

1 回答

异常不合法,查看异常是否捕获,再看jdk的 版本


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

举报

0/150
提交
取消

老报java.lang.IllegalArgumentException,这个是什么问题啊

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信