首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在jar文件中集成wurfl

如何在jar文件中集成wurfl
EN

Stack Overflow用户
提问于 2012-04-11 20:23:09
回答 1查看 540关注 0票数 1

我为jar创建了一个类文件。并且这个类使用了wurfl。然后在javac中运行这段代码,输出就可以了。但是我生成了jar文件,然后给出了错误。

集成wurfl:

代码语言:javascript
复制
 ApplicationContext ctx = new ClassPathXmlApplicationContext("/resources/wurfl-standard-import-ctx.xml");
     WURFLManager wurflManager = (WURFLManager) ctx.getBean("wurflManager");

我生成了jar文件,并运行了.then错误:

代码语言:javascript
复制
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'wurflModel' defined in class path resource [resources/wurfl-standard-imp
ort-ctx.xml]: Error setting property values; nested exception is org.springframe
work.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are
:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException:
Property 'wurfl' threw exception; nested exception is net.sourceforge.wurfl.core
.resource.WURFLResourceException: WURFL unexpected exception
PropertyAccessException 2: org.springframework.beans.MethodInvocationException:
Property 'wurflPatch' threw exception; nested exception is net.sourceforge.wurfl
.core.resource.WURFLResourceException: WURFL unexpected exception
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:295)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:292)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:580)
        at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:900)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:455)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:139)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:83)
        at mwp.slktechlabs.cron.AnalyticsCron.setNewdataInUserResponseCollection
(AnalyticsCron.java:116)
        at mwp.slktechlabs.cron.AnalyticsCron.fillAnalyticsData(AnalyticsCron.ja
va:92)
        at mwp.slktechlabs.cron.AnalyticsCron.main(AnalyticsCron.java:44)
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested Proper
tyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException:
Property 'wurfl' threw exception; nested exception is net.sourceforge.wurfl.core
.resource.WURFLResourceException: WURFL unexpected exception
PropertyAccessException 2: org.springframework.beans.MethodInvocationException:
Property 'wurflPatch' threw exception; nested exception is net.sourceforge.wurfl
.core.resource.WURFLResourceException: WURFL unexpected exception
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(
AbstractPropertyAccessor.java:102)
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(
AbstractPropertyAccessor.java:58)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)
        ... 15 more
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-12 19:16:56

将资源包包含在jar中,并在此资源包静态文件中包含以下代码。

代码语言:javascript
复制
<property name="wurfl" value="file:./resources/wurfl-2.2.zip"/>
<property name="wurflPatch" value="file:./resources/web_browsers_patch.xml"/>

在此代码中,使用文件协议。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10105821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档