我正在使用Apache Commons HTTP Client,我在类路径中包含了所有必需的jar文件(即commons-httpclient-3.0.1.jar和commons-httpclient-3.1.jar)。
此代码的目的是在网站用户创建并保存新图像文章时将文件(在本例中为图像)发送到内容管理系统。当文件管理器尝试将图像从Tomcat临时文件夹传输到CMS时,文件发送器窗口中会出现异常。这会导致进程失败,并且图像仍然卡在临时文件夹中。
导致此错误的原因是什么?
SEVERE: Policy class "uk.co.content.article.MoodboardArticlePolicy" spec
ified by input template MoodboardArticle as top policy has a dependency
on some class where runtime version is incompatible with the version compiled ag
ainst
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEnt
ity
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.polopoly.cm.policy.PolicyFactoryDependencyInjecting$DependencyInj
ectionPolicyInstantiator.createInstance(PolicyFactoryDependencyInjecting.java:71
)
at com.polopoly.cm.policy.PolicyFactory.createPolicyInstance(PolicyFacto
ry.java:141)
at com.polopoly.cm.policy.PolicyFactoryDependencyInjecting.createPolicyI
nstance(PolicyFactoryDependencyInjecting.java:49)
at com.polopoly.cm.policy.PolicyFactory.createPolicy(PolicyFactory.java:
103)
at com.polopoly.cm.policy.PolicyCMServerBase.getPolicyFor(PolicyCMServer
Base.java:1046)
at com.polopoly.cm.policy.PolicyCMServerBase.getPolicyFor(PolicyCMServer
Base.java:972)
at com.polopoly.cm.policy.PolicyCMServerBase.createNewVersion(PolicyCMSe
rverBase.java:177)
at com.polopoly.cm.policy.PolicyCMServerBase.createNewVersion(PolicyCMSe
rverBase.java:157)
at com.polopoly.cm.policy.PolicyCMServerBase.createContentVersion(Policy
CMServerBase.java:740)
at com.polopoly.cm.policy.PolicyCMServerBase.createContentVersion(Policy
CMServerBase.java:754)
at uk.co.prestige.ftpclient.FileSender.updatePolopolyContent(Fil
eSender.java:244)
at uk.co.prestige.ftpclient.FileSender.sendFile(FileSender.java:
194)
at uk.co.prestige.ftpclient.HotFolderWorker.notifyFileProcessLis
teners(HotFolderWorker.java:61)
at uk.co.prestige.ftpclient.DirectoryScanner.scanNow(DirectorySc
anner.java:79)
at uk.co.prestige.ftpclient.HotFolderWorker.run(HotFolderWorker.
java:88)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.metho
ds.RequestEntity
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 17 more