java - How to reference class from external jar file in spring.xml -
this bean define in spring.xml
<bean id="hello" class="test.hello" />
i export class hello
hello.jar
, place c:\customjar
.
, set folder windows classpath.
this output
caused by: org.springframework.beans.factory.cannotloadbeanclassexception: cannot find class [test.hello] bean name 'hello' defined in class path resource [spring.xml]; nested exception java.lang.classnotfoundexception: test.hello
for xml file can reference classpath use this
<import resource="classpath:xxxxxx.xml"/>
but doesn't work in case.
edit
this class sourcecode.
package test; public class hello { public void somemethod() { // here } }
and classpath setting.
%classpath% = xxxxxxxx;c:\customjar\hello.jar;
spring can load classes different jars, without configuration. - me looks hello class not in running application.
Comments
Post a Comment