栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

无法找到XML模式名称空间的Spring NamespaceHandler [http://www.springframework.org/schema/batch]

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

无法找到XML模式名称空间的Spring NamespaceHandler [http://www.springframework.org/schema/batch]

通过CommandLineJobRunner运行作业:java -jar batchprimer-1.0.jar meta-INF / spring / module-context.xml job1

即使具有完整的目标文件夹,你也必须提供java命令的类路径信息,以简化配置,你可以使用多合一可执行jar(例如,使用maven-shade-plugin或可执行shell脚本(.bat /.sh)和所有需要的库,例如,使用appassembler-maven-plugin

maven-shade-plugin示例配置(创建其他jar):

<plugin>    <!-- create an all-in-one executable jar with maven-shade-plugin         bound to phase:package          special handling for spring.handlers/spring.schemas files         to prevent overwriting (maven-shade-plugin joins them to         one file)          usage:         cd to <project>/target         java -jar hello-world-java-1.0-SNAPSHOT-executable.jar spring/batch/job/hello-world-job.xml helloWorldJob         -->   <artifactId>maven-shade-plugin</artifactId>    <version>1.5</version>    <executions>        <execution> <phase>package</phase> <goals>     <goal>shade</goal> </goals> <configuration>     <transformers>         <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  <mainClass>org.springframework.batch.core.launch.support.CommandLineJobRunner</mainClass>         </transformer>         <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  <resource>meta-INF/spring.handlers</resource>         </transformer>         <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  <resource>meta-INF/spring.schemas</resource>         </transformer>     </transformers>     <shadedArtifactAttached>true</shadedArtifactAttached>     <!-- configures the suffix name for the executable jar          here it will be '<project.artifact>-<project.version>-executable.jar'-->     <shadedClassifierName>executable</shadedClassifierName> </configuration>        </execution>    </executions></plugin>

示例应用程序组装程序配置(创建子文件夹结构和.bat / .sh):

<plugin>    <artifactId>appassembler-maven-plugin</artifactId>    <groupId>org.prehaus.mojo</groupId>    <version>1.1.1</version>    <configuration>        <repositoryLayout>flat</repositoryLayout>        <installArtifacts>false</installArtifacts>        <target>${project.build.directory}/appassembler</target>        <defaultJvmSettings> <initialMemorySize>512M</initialMemorySize> <maxMemorySize>1024M</maxMemorySize> <extraArguments>     <extraArgument>-Dlog4j.configuration=../etc/log4j/log4j.properties</extraArgument> </extraArguments>        </defaultJvmSettings>        <configurationDirectory>etc</configurationDirectory>        <daemons> <daemon>     <id>applicationName</id>     <mainClass>org.springframework.batch.core.launch.support.CommandLineJobRunner</mainClass>     <commandLineArguments>         <commandLineArgument>spring/job-runner.xml</commandLineArgument>         <commandLineArgument>helloWorldJob</commandLineArgument>         <commandLineArgument>input.file.pattern=file:...*.txt</commandLineArgument>     </commandLineArguments>     <platforms>         <platform>booter-unix</platform>         <platform>booter-windows</platform>     </platforms> </daemon>        </daemons>    </configuration>    <executions>        <execution> <phase>package</phase> <goals>     <goal>generate-daemons</goal>     <goal>create-repository</goal> </goals>        </execution>    </executions></plugin>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/404930.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号