Foren: Offene Diskussion (Thread #38000)

TERASOLUNA Batch jar実行時のエラーについて (2016-09-02 13:14 by posi #78634)

はじめまして

TERASOLUNA Batch Framework for Java 3.3.1で開発を
初めてしました。

以下の操作によりjarを作成したのですが、
Jar実行時にエラーとなってしまいます。

以下等を調べたてみると、jar作成時に、xsdの情報が記述されている箇所が
上書きされてしまっているそうなのですが、肝心のpom.xmlが見つからず
悩んでおります。
http://devb.hatenablog.com/entry/20110626/1309103692

どなたかご教授をお願いします。

○jarファイル生成
<target name="createJar" description="jarファイル生成" depends="compile">
<delete dir="./dist" failonerror="false" />
<mkdir dir="./dist" />
<manifest file="./dist/MANIFEST.MF">
<attribute name="Main-Class" value="jp.terasoluna.fw.batch.executor.SyncBatchExecutor" />
<attribute name="Class-Path" value="
${lib.dir}/aopalliance-1.0.jar
${lib.dir}/aspectjweaver-1.7.4.jar
${lib.dir}/commons-beanutils-1.8.3.jar
${lib.dir}/commons-collections-3.2.1.jar
${lib.dir}/commons-dbcp-1.2.2.patch_DBCP264_DBCP372.jar
${lib.dir}/commons-digester-2.0.jar
${lib.dir}/commons-jxpath-1.3.jar
${lib.dir}/commons-lang-2.5.jar
${lib.dir}/commons-logging-1.1.3.jar
${lib.dir}/commons-pool-1.6.jar
${lib.dir}/commons-validator-1.3.1.jar
${lib.dir}/commons-net-3.5.jar
${lib.dir}/log4j-1.2.16.jar
${lib.dir}/mybatis-2.3.5.jar
${lib.dir}/oro-2.0.8.jar
${lib.dir}/spring-aop-3.2.13.RELEASE.jar
${lib.dir}/spring-beans-3.2.13.RELEASE.jar
${lib.dir}/spring-context-3.2.13.RELEASE.jar
${lib.dir}/spring-core-3.2.13.RELEASE.jar
${lib.dir}/spring-expression-3.2.13.RELEASE.jar
${lib.dir}/spring-jdbc-3.2.13.RELEASE.jar
${lib.dir}/spring-modules-validation-0.8.jar
${lib.dir}/spring-orm-3.2.13.RELEASE.jar
${lib.dir}/spring-tx-3.2.13.RELEASE.jar
${lib.dir}/terasoluna-batch-3.3.1.jar
${lib.dir}/terasoluna-batch-update-3.3.1.jar
${lib.dir}/terasoluna-collector-3.3.1.jar
${lib.dir}/terasoluna-commons-3.3.1.jar
${lib.dir}/terasoluna-dao-3.3.1.jar
${lib.dir}/terasoluna-filedao-3.3.1.jar
${lib.dir}/terasoluna-ibatis-3.3.1.jar
${lib.dir}/terasoluna-logger-3.3.1.jar
${lib.dir}/terasoluna-validator-3.3.1.jar"

/>
</manifest>
<jar destfile="${dist.dir}/${ant.project.name}.jar" manifest="./dist/MANIFEST.MF" basedir="./bin">
<zipgroupfileset dir="lib" includes="*.jar" />
<fileset dir="${root.dir}/bin"/>
</jar>
</target>

○実行コマンド
 java -jar TOGO_ESL_JOB.jar XXXXXXXX(引数)

○エラー
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at jp.terasoluna.fw.batch.executor.AbstractBatchExecutor.getApplicationC
ontext(AbstractBatchExecutor.java:893)
at jp.terasoluna.fw.batch.executor.AbstractBatchExecutor.initJobAppConte
xt(AbstractBatchExecutor.java:492)
at jp.terasoluna.fw.batch.executor.AbstractBatchExecutor.executeBatch(Ab
stractBatchExecutor.java:555)
at jp.terasoluna.fw.batch.executor.SyncBatchExecutor.main(SyncBatchExecu
tor.java:114)
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingExcept
ion: Configuration problem: Unable to locate Spring NamespaceHandler for XML sch
ema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [beansDef/XXXXXXXX.xml]

at org.springframework.beans.factory.parsing.FailFastProblemReporter.err
or(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderC
ontext.java:80)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.er
ror(BeanDefinitionParserDelegate.java:315)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseCustomElement(BeanDefinitionParserDelegate.java:1429)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.pa
rseCustomElement(BeanDefinitionParserDelegate.java:1422)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:187)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:147)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentRe
ader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:101)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registe
rBeanDefinitions(XmlBeanDefinitionReader.java:495)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:391)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:335)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:303)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)
at org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:127)
at org.springframework.context.support.AbstractXmlApplicationContext.loa
dBeanDefinitions(AbstractXmlApplicationContext.java:93)
at org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtain
FreshBeanFactory(AbstractApplicationContext.java:539)
at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:451)
at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<i
nit>(ClassPathXmlApplicationContext.java:93)
... 8 more

Reply to #78634×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden

Re: TERASOLUNA Batch jar実行時のエラーについて (2016-09-05 15:43 by posi #78652)

[メッセージ #78634 への返信]

自己解決しましたので自己レスです。
参考サイト通り、mavenに限らずjarでもSpring
勝手に以下の設定を上書きしているのが
原因でした。
<設定>
META-INF/spring.handlers
META-INF/spring.schemas

上記を踏まえ、
1.全Springのjarを全部解答
2.spring.handlersとspring.schemasの記載をマージしたファイルを作成
3.優先度で一番最後に読まれるであろう以下の内容を2.に差し替え
  ${lib.dir}/spring-tx-3.2.13.RELEASE.jar
4.${lib.dir}/spring-tx-3.2.13.RELEASE.jarを再度圧縮
5.再度jarコマンドにて構築
で解決しました。


Reply to #78634

Reply to #78652×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Anmelden