文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>关于spring中commons-attributes-co..

关于spring中commons-attributes-co..

时间:2010-10-10  来源:NightWolves

   昨天用spring做了个定时器,用于定时扫描某通讯公司外网ftp服务器的约定路径下是否有我需要的文件并下载到本公司服务器上。记得以前做过类似的一个定时器,觉得手到擒来的事情,没想到又折腾了大半天,就是因为spring中commons-attributes-compiler.jar的使用问题。    问题是这样的:扫面和下载程序,触发类和函数,web.xml和spring配置文件,这些准备工作都已经完成,就是在服务器启动的时候报错:
INFO: Deploying web application archive GRCC.war 
Sep 14, 2007 13:22:18 AM org.apache.catalina.util.ExtensionValidator validateManifestResources 
INFO: ExtensionValidator[/GRCC][commons-attributes-api.jar]: Required extension "ant" not found. 
Sep 14, 2007 13:22:18 AM org.apache.catalina.util.ExtensionValidator validateManifestResources 
INFO: ExtensionValidator[/GRCC][commons-attributes-compiler.jar]: Required extension "ant" not found. 
Sep 14, 2007 13:22:18 AM org.apache.catalina.util.ExtensionValidator validateManifestResources 
INFO: ExtensionValidator[/GRCC][commons-attributes-compiler.jar]: Required extension "javadoc" not found. 
Sep 14, 2007 13:22:18 AM org.apache.catalina.util.ExtensionValidator validateManifestResources 
INFO: ExtensionValidator[/GRCC]: Failure to find 3 required extension(s). 
   Sep 14, 2007 13:22:18 AM org.apache.catalina.core.StandardContext start 
SEVERE: Error getConfigured 
Sep 14, 2007 13:22:18 AM org.apache.catalina.core.StandardContext start 
SEVERE: Context [/GRCC startup failed due to previous errors 
Sep 14, 2007 13:22:18 AM org.apache.catalina.core.StandardContext stop 
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/GRCC] has not been started

并导致本项目无法启动!     从错误可以看出,commons-attributes-compiler.jar需要的"ant","qdox"无法找到,我又检查了数遍,ant和qdox这些jar包我都已经加lib里了,可spring就是视而不见!我郁闷了好久,最后实在不行了,我决定解压commons-attributes-compiler.jar,看看它的庐山真面目,里面还真不复杂:META-INF\MANIFEST.MF,compile\org\apache\commons\attributes\anttasks.properties,LICENSE.txt,, NOTICE.txt,后两个肯定是说明性的文件,我没有理会;第二个是属性文件,我看格式和注释都没有什么不妥;就MANIFEST.MF里面内容较多,并且有异常之处(我标出了):
Manifest-Version: 1.0  Ant-Version: Apache Ant 1.5.3 
Created-By: Apache Maven 
Built-By: hen 
Package: org.apache.commons.attributes 
Build-Jdk: 1.4.2_05 
Extension-Name: commons-attributes-api 
Specification-Title: Client API for Jakarta Commons Attributes. 
Specification-Vendor: The Apache Software Foundation 
Implementation-Title: org.apache.commons.attributes 
Implementation-Vendor: The Apache Software Foundation 
Implementation-Version: 2.2 
Extension-List: ant qdox 
ant-Extension-Name: ant 
ant-Implementation-Version: 1.5 
ant-Implementation-URL: http://www.ibiblio.org/maven/ant/jars/ant-1.5. 
jar 
qdox-Extension-Name: qdox 
qdox-Implementation-Version: 1.5 
qdox-Implementation-URL: http://www.ibiblio.org/maven/qdox/jars/qdox-1 
.5.jar 
Implementation-Vendor-Id: org.apache 
X-Compile-Source-JDK: 1.4 
X-Compile-Target-JDK: 1.4 
这里的URL后面的值被换行符隔开了,显然,如果让我们自己,是不会这么干的。于是,做修改如下:
Manifest-Version: 1.0  Ant-Version: Apache Ant 1.5.3 
Created-By: Apache Maven 
Built-By: hen 
Package: org.apache.commons.attributes 
Build-Jdk: 1.4.2_05 
Extension-Name: commons-attributes-api 
Specification-Title: Client API for Jakarta Commons Attributes. 
Specification-Vendor: The Apache Software Foundation 
Implementation-Title: org.apache.commons.attributes 
Implementation-Vendor: The Apache Software Foundation 
Implementation-Version: 2.2 
Extension-List: ant qdox 
ant-Extension-Name: ant 
ant-Implementation-Version: 1.5 
ant-Implementation-URL: http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar 
qdox-Extension-Name: qdox 
qdox-Implementation-Version: 1.5 
qdox-Implementation-URL: http://www.ibiblio.org/maven/qdox/jars/qdox-1.5.jar 
Implementation-Vendor-Id: org.apache 

X-Compile-Source-JDK: 1.4 
X-Compile-Target-JDK: 1.4
重新打成jar包,添加到项目lib中,启动运行,一切OK!
     可是,以前写定时器也没遇到这种情况啊,我想这跟spring的版本有关系吧;今天用的spring2.0,可是谁把MANIFEST.MF中的URL弄错的呢?我想不应该是官方的bug吧,可能是我不是在官网上下的spring开发包,有机会看看官网上是否也是这个样子。不管怎么说,项目还是在波澜不惊中顺利进行。。。
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载