尝试将Spring Batch Admin添加到现有的Spring Batch项目中.
我已经使用spring-batch-admin-resources和spring-batch-admin-manager更新了web.xml
我的设置:
在src/main/resources /下
我添加了2个属性文件.1是batch-default-properties,它是一个空文件,另一个是batch-sqlserver.properties,其中包含以下内容:
batch.jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver batch.jdbc.url=jdbc:sqlserver://xxx.xxx.xxx:1433;DatabaseName=SpringBatch
batch.jdbc.user=user
batch.jdbc.password=password
batch.jdbc.testWhileIdle=false
batch.jdbc.validationQuery=
batch.drop.script=/org/springframework/batch/core/schema-drop-sqlserver.sql
batch.schema.script=/org/springframework/batch/core/schema-sqlserver.sql
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.SqlServerMaxValueIncrementer
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.business.schema.script=business-schema-sqlserver.sql
batch.database.incrementer.parent=columnIncrementerParent
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE
batch.table.prefix=BATCH_
batch.data.source.init=false
Run Code Online (Sandbox Code Playgroud)
在webapp/META-INF/spring/batch/override /下,我添加了带内容的data-source-context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:jboss/datasources/springBatchDB</value>
</property>
</bean>
</beans>
Run Code Online (Sandbox Code Playgroud)
这是在JBoss EAP 6.3中运行的.每次我启动服务器时,都会出现以下异常:
11:58:36,116 WARN [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 112) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'org.springframework.jdbc.datasource.init.DataSourceInitializer#0' defined in null: Could …Run Code Online (Sandbox Code Playgroud) 在 IntelliJ IDEA 15 中,项目窗口中文件的拖放重构移动对我不起作用。 如果我右键单击项目窗口中的文件,请Refactor -> Move...从菜单中选择并更改那里的包/文件夹它有效,但如果我尝试将文件从一个包拖放到另一个包,则无效。
会发生什么是对话框出现,但对话框上的所有内容都被禁用,我可以关闭它的唯一方法是退出(甚至关闭按钮似乎被禁用)。
这个特殊的 IDEA 安装非常简单,(没有花哨的插件)但也许有一些插件交互在起作用。但是,我在本地确实有其他一些 intelliJ 安装(社区版cursive和较旧的 14 Ultimate)。
我已经确保Enable Drag'n'Drop Functionality in editor在编辑器设置下进行了检查,如文档中所示。
我在这里遗漏了什么还是这是一个错误?粗略的谷歌搜索和 SO 搜索没有显示任何内容。
Java 6的原始版本附带了JAXB 2,但我被告知"后来的"Java 6版本随JAXB 2.1发布.
有谁知道JAXB 2.1附带的第一个Java 6版本是什么?
我想在Spring启动应用程序中访问配置中的事务管理器和数据源.我正在使用spring-boot-starter-data-jpa神器.
是否可以在配置中自动装配并获取其访问权限?
我有一个Spring Batch作业现在给我一个错误:无法序列化类型的对象:class org.springframework.batch.core.StepExecution Job Listener正在打印以下异常:
org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:140) ~[FlowJob.class:3.0.6.RELEASE]
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:306) ~[AbstractJob.class:3.0.6.RELEASE]
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135) [SimpleJobLauncher$1.class:3.0.6.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_51]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]
Run Code Online (Sandbox Code Playgroud)
配置如下:
<job id="job2" restartable="false" job-repository="jobRepository" parent="baseJob">
<step id="job2StepBootstrap" parent="parentJobStep">
<tasklet ref="job2TaskBootstrap" transaction-manager="jobsTransactionManager" />
</step>
<listeners>
<listener ref="job2JobListener"/>
</listeners>
Run Code Online (Sandbox Code Playgroud)
更多
<bean id="jobsTransactionManager"
class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
<property name="transactionManager" ref="jobsTransactionManager" />
<property name="isolationLevelForCreate" value="ISOLATION_SERIALIZABLE" />
<property name="validateTransactionState" value="false"/>
Run Code Online (Sandbox Code Playgroud)
对我来说不是很明显有什么不对,我非常感谢你的帮助.我根本不想保存作业元数据.
public class BatchDeploymentTaskBootstrap implements Tasklet, Serializable{
@Override
public …Run Code Online (Sandbox Code Playgroud) 我正在研究一个处理数据的项目.每隔5分钟,cron执行go脚本,这是完成所有工作.工作的一部分是采取更多的性能,更重要的是,它花费了很多时间,所以我想采取这部分过程并放入单独的脚本.这个脚本将接收proccess_id并执行那些东西,而主要工作可以继续并且很重要,它不会等待那个背景去脚本完成.后台工作完成时不需要后台工作(该信息将保存在db中).
PHP中的那种情况可以通过齿轮工人来解决,你可以调用,发送数据,你可以在你的工作中继续工作,同时齿轮工在后台自己处理数据
go lang中是否有类似的东西也可以调用而不是http?
谢谢
我正在编写一个宏来实现when内置宏,这里是代码:
(defmacro when-valid
"Macro that does a series of actions if the condition
is true"
[condition & actions]
`(if ~condition (~cons 'do ~actions) nil))
Run Code Online (Sandbox Code Playgroud)
但当我评估它时:
(when-valid (< 1 2) (println "hello") (println "dear"))
Run Code Online (Sandbox Code Playgroud)
我得到输出:
hello
dear
clojure-noob.core=> NullPointerException
clojure-noob.core/eval17411
Run Code Online (Sandbox Code Playgroud)
我应该nil而不是NullPointerException.有谁知道我做错了什么?
谢谢.
关于这个问题,以及那里引用的博客文章,有没有理由prop/for-all不直接推出这种功能?例如:
(require '[clojure.test.check.generators :as gen])
(require '[clojure.test.check.properties :as prop])
(require '[clojure.test.check.clojure-test :refer :all])
(defspec some-props-test
(prop/for-all [n (gen/choose 1 10)
v (gen/vector gen/int n) ;; treat n like its produced value
e (gen/element v)]
... do stuff with n, v & e ...
))
Run Code Online (Sandbox Code Playgroud)
基本上,我想重新使用产生的值通过在另一发电机一个发电机,然后引用二者实际测试码内产生的值.这实际上将糖/魔法扩展for-all为允许引用由宏提供的let-like块内的生成值,因为它在下面的表达式块中起作用.
如果我遗漏了其他可能使其成为可能的内容,或者由于某种原因而无法实施,请告诉我.
java ×4
spring ×3
clojure ×2
spring-batch ×2
gearman ×1
go ×1
intellij-15 ×1
java-6 ×1
jaxb ×1
jaxb2 ×1
monads ×1
php ×1
refactoring ×1
spring-boot ×1
test.check ×1