2012年5月19日土曜日

xuggleではまりました。

xuggleを利用して、java上でコーデック変換をやろうと必死になっていました。

ちょっと長いですが・・・

Exception in thread "Launcher:/test" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Cannot resolve reference to bean 'web.handler' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ttProject.Application]: Constructor threw exception; nested exception is java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.ICodec_CODEC_ID_FFMETADATA_get()I
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.red5.server.tomcat.TomcatLoader$1.run(TomcatLoader.java:594)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'web.handler' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ttProject.Application]: Constructor threw exception; nested exception is java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.ICodec_CODEC_ID_FFMETADATA_get()I
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 13 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.ttProject.Application]: Constructor threw exception; nested exception is java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.ICodec_CODEC_ID_FFMETADATA_get()I
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
... 21 more
Caused by: java.lang.UnsatisfiedLinkError: com.xuggle.xuggler.XugglerJNI.ICodec_CODEC_ID_FFMETADATA_get()I
at com.xuggle.xuggler.XugglerJNI.ICodec_CODEC_ID_FFMETADATA_get(Native Method)
at com.xuggle.xuggler.ICodec$ID.<clinit>(ICodec.java:877)
at com.xuggle.xuggler.SimpleMediaFile.<init>(SimpleMediaFile.java:46)
at com.ttProject.Application.<init>(Application.java:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
... 23 more

というエラーがどうしても解決できない。jarファイルの取得にも特に問題なさそうだが・・・はて・・・とおもっていました。

原因は・・・
xuggle/java/xuggle-xuggler/dist/libにあるjarファイルをつかっていたのですが、これは環境にインストールされた正しいjarファイルではなく本来は
xuggle/java/xuggle-xuggler/dist/stage/usr/local/share/java/jars/に「生成された」jarファイルをつかわないとだめだったようです。

似たような名前のライブラリをそれっぽいところに生成(もしくは配置)しないでもらいたいものである。気づかねーよ。

0 件のコメント:

コメントを投稿