- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在Gradle项目中使用Camel 3.5使用OpenJDK8作为下一个计时器
from("timer://watchexpiration?fixedRate=true&period=600000&delay=0")...
但是,在使用
./gradlew build
构建胖 jar 并作为
java -jar build/libs/app.jar
运行之后
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: timer://watchexpiration?delay=0&fixedRate=true&period=600000 due to: Error binding property (delay=0) with name: delay on bean: timer://watchexpiration?delay=0&fixedRate=true&period=600000 with value: 0
at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:888)
at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:777)
at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:58)
at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:177)
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:250)
at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:112)
但是,如果我使用
./gradlew run
运行,那么
可以按我期望的那样正常工作。
plugins {
id 'java'
id 'application'
id 'com.github.sherter.google-java-format' version '0.8'
}
repositories {
jcenter()
}
dependencies {
implementation 'com.google.guava:guava:29.0-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.2'
// Camel
compile group: 'org.apache.camel', name: 'camel-core', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-file', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-file-watch', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-xstream', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-gson', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-rest', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-servlet', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-http', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-jackson', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-quartz', version: '3.5.0'
compile group: 'org.apache.camel', name: 'camel-timer', version: '3.5.0'
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.30'
// Dev Libs
compileOnly("org.projectlombok:lombok:1.18.12")
annotationProcessor("org.projectlombok:lombok:1.18.12")
compile group: 'org.apache.commons', name: 'commons-csv', version: '1.4'
}
application {
mainClassName = 'com.eip.App'
}
configurations {
// configuration that holds jars to include in the jar
extraLibs
}
jar {
manifest {
attributes(
'Main-Class': 'com.beam.agent.App'
)
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
test {
useJUnitPlatform()
}
googleJavaFormat {
exclude '**/App.java'
}
最佳答案
阴影 jar 可能很棘手,因为您需要处理重复的条目。在Apache Camel中,有许多META-INF
服务文件,这些文件已被您的简单jar
方法覆盖。使用 com.github.johnrengelman.shadow
,它允许您自定义合并过程。
plugins {
id 'java'
id 'application'
id 'com.github.sherter.google-java-format' version '0.8'
id "com.github.johnrengelman.shadow" version "6.0.0" // Added plugin
}
repositories {
jcenter()
}
dependencies {
// ...
}
application {
mainClassName = 'com.eip.App'
}
// Removed jar step
test {
useJUnitPlatform()
}
googleJavaFormat {
exclude '**/App.java'
}
// Added shadow plugin configuration
shadowJar {
mergeServiceFiles() // Tell plugin to merge duplicate service files
manifest {
attributes 'Main-Class': 'com.eip.App'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
带阴影的可执行jar将带有后缀
-all.jar
java -jar build/libs/app-all.jar
关于java - Fat Jar中的Apache Camel Timer Nullpointer异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64015236/
当在类的开头使用上下文和资源初始化 MediaPlayer 对象时,它会抛出 NullPointer 异常,但是当在类的开头声明它时(因此它是 null),然后以相同的方式初始化它在onCreate方
在这个问题中NullPointer when call entity Manager建议将 @Autowire DAO 添加到 Controller 中。我做到了并且工作正常。然后我在 DaoImpl
我被分配了一个项目,我必须在java中创建一个登录系统,使用filein将帐户写入数组,并通过确认输入用户名与中的用户名相同来使用该数组进行登录数组。我的用户名和密码位于正在读取的 .txt 文件中的
我得到了以下代码: - (void) hide_waiting_activity { [UIView beginAnimations:nil context:NULL]; {
在为学校开发一个程序时,我创建了一个方法,该方法根据您为该方法提供的值返回数组的索引。该方法抛出 NullPointerException 但数组的每个索引都已被实例化。为了说明这一点,我创建了一个执
在我的 JSP 页面上,我需要显示一个列表,其中包含/public 文件夹中当前存在的所有文件。 这是一个带有 spring 和 hibernate 的 j2ee 项目。在我的用于获取包含所有文件的列
当我更新大量 JavaFX 图表时,我收到以下 NullpointerException: java.lang.NullPointerException at com.sun.scenario
我是 android 编程的新手,但不是 Java。 我在以下位置收到有关 NPE 的错误消息: 12-09 10:29:58.247: D/dalvikvm(471): GC freed 711 o
我有两个 java 类。 Schedule 是使用名为 deadline 的作业数组的主要类。我在将任何东西放入数组时遇到问题。我有一个 for 循环,它从文本文件中读取数据(它工作正常)并将某些数据
我正在尝试从我的项目目录访问一个文件,我们称它为 src/main/project/foo/bar.txt 在类MyClass 但是当我这样做的时候: InputStream is = MyClass
您好,在我的应用程序中实现搜索小部件时遇到问题。它似乎无法找到菜单项的“actionview”,但它可以很好地找到该项目。 我四处寻找答案,但没有看到明确的解决方案。 这是我用 XML 声明的菜单
我不确定为什么会收到此错误,它以前是有效的,我们将不胜感激。尝试在微调器选择时产生一个新 Activity (我有一个内部有 ListView 的工作版本,我决定分支尝试微调器,走了很远然后迷路了试图
我得到一个 NullPointerException在我第一次使用 createEntityManager() 连接到数据库时,在我的 tomcat 控制台上.我正在使用: apache tomcat
我目前正在处理一个项目,该项目使用 JFrame 在 GUI 上运行。 我想尽可能清楚我的问题是什么,我正在使用 3 个包(实体、控制(管理器)、边界(GUI))。 边界进口控制,控制进口实体。 在
我正在将S3的 Parquet 文件加载到在EMR机器中运行的Hive数据仓库中: Release: emr-5.1.0Hadoop distribution: Amazon 2.7.3Applica
我有一个如下所示的方法: try { doStuff(); } catch (Exception ex) { logger.error(ex); } (我并没有真正使用像 doStuff 这样
谁能告诉我这段代码有什么问题 我得到空指针异常,我假设是因为多个请求 @Service public class GernericMockingServiceImpl implements Gener
首先感谢您指出我在创建这篇文章时所犯的错误。 我尽可能缩小了代码范围,希望现在更清楚了。 因此,发生的问题是 NullPointer Exception 例如,当我尝试从一个场景(根)切换到另一个场景
我已经遇到这个非常烦人的问题几天了,而且我似乎无法完全解决它。我正在尝试打开 .csv 文件,因此我将其导入到项目的 res/raw/ 文件夹中。然后我尝试通过 getResources() 方法打开
我想做一个简单的java应用程序来播放视频。我特别希望它能够播放 mpeg4 和 mov 格式。 JMF 是我开始的地方,我有一个很好的工作示例。但是,不支持 mov 或 mpeg4 格式。我看过 X
我是一名优秀的程序员,十分优秀!