hi all,
spring-context-3.0.5.RELEASE.jar;spring-core-3.0.5.RELEASE.jar;TestApi.jar这三个jar在同一目录下,调用 ;spring-core-3.0.5.RELEASE.jar;TestApi.jar两个jar包都没有问题,但我调用spring-context-3.0.5.RELEASE.jar包里面的ClassPathXmlApplicationContext类提示如下错误,大侠帮忙看一下吧, 非常感谢:
Traceback (most recent call last):
File "D:\workspase7\LearnNose\src\testcases\callJava.py", line 28, in <module>
ClassPathXmlApplicationContext = JClass("org.springframework.context.support.AbstractApplicationContext")
File "C:\Python27\lib\site-packages\jpype\_jclass.py", line 54, in JClass
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.ExceptionPyRaisable: java.lang.Exception: Class org.springframework.context.support.AbstractApplicationContext not found
代码如下:
from jpype import *
import os
jarpath = os.path.join(os.path.abspath('.'), 'D:/workspase7/LearnNose/src/testcases/')
startJVM("C:/Program Files (x86)/Java/jre7/bin/client/jvm.dll","-ea", \
"-Djava.class.path=spring-context-3.0.5.RELEASE.jar;spring-core-3.0.5.RELEASE.jar;TestApi.jar")
ClassPathXmlApplicationContext = JClass("org.springframework.context.support.ClassPathXmlApplicationContext")
appContext = ClassPathXmlApplicationContext()
DefaultResourceLoader = JClass("org.springframework.core.io.DefaultResourceLoader")
appContext = DefaultResourceLoader()
shutdownJVM();