- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我启动我的应用程序时,virgo 会抛出这样的异常:
[2015-09-05 11:27:53.254] TCP Connection(2)-127.0.0.1 <DE0002E> Installation of bundle 'com.onboard.web.api' version '3.0.0.SNAPSHOT' failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.onboard.web.api' at version '3.0.0.SNAPSHOT': Cannot resolve: com.onboard.web.api
Resolver report:
Uses violation: <Import-Package: org.springframework.format.datetime.joda; version="0.0.0"> in bundle <com.onboard.web.api_3.0.0.SNAPSHOT[1441423661083]>
Found conflicts:
package 'org.joda.time_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[60]'
conflicts with 'org.joda.time_2.3.0' in bundle 'joda-time_2.3.0[147]' used by 'com.onboard.service.github_3.0.0.SNAPSHOT' in bundle 'com.onboard.service.github_3.0.0.SNAPSHOT[189]'
package 'org.joda.time_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[60]'
conflicts with 'org.joda.time_2.3.0' in bundle 'joda-time_2.3.0[147]' used by 'com.onboard.service.github_3.0.0.SNAPSHOT' in bundle 'com.onboard.service.github_3.0.0.SNAPSHOT[189]'
package 'org.joda.time.format_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[60]'
conflicts with 'org.joda.time.format_2.3.0' in bundle 'joda-time_2.3.0[147]' imported by bundle 'com.onboard.web.api_3.0.0.SNAPSHOT[1441423661083]'
package 'org.joda.time.format_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[60]'
conflicts with 'org.joda.time.format_2.3.0' in bundle 'joda-time_2.3.0[147]' imported by bundle 'com.onboard.web.api_3.0.0.SNAPSHOT[1441423661083]'
package 'org.springframework.core.convert.converter_3.1.0.RELEASE' in bundle 'org.springframework.core_3.1.0.RELEASE[61]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[60]'
conflicts with 'org.springframework.core.convert.converter_3.1.0.RELEASE' in bundle 'org.springframework.core_3.1.0.RELEASE[112]' used by 'org.springframework.web.servlet.tags_3.1.0.RELEASE' in bundle 'org.springframework.web.servlet_3.1.0.RELEASE[168]'
package 'org.springframework.core.convert.converter_3.1.0.RELEASE' in bundle 'org.springframework.core_3.1.0.RELEASE[61]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[60]'
conflicts with 'org.springframework.core.convert.converter_3.1.0.RELEASE' in bundle 'org.springframework.core_3.1.0.RELEASE[112]' used by 'org.springframework.web.servlet.config.annotation_3.1.0.RELEASE' in bundle 'org.springframework.web.servlet_3.1.0.RELEASE[168]'
package 'org.joda.time_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[111]'
conflicts with 'org.joda.time_2.3.0' in bundle 'joda-time_2.3.0[147]' used by 'com.onboard.service.github_3.0.0.SNAPSHOT' in bundle 'com.onboard.service.github_3.0.0.SNAPSHOT[189]'
package 'org.joda.time_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[111]'
conflicts with 'org.joda.time_2.3.0' in bundle 'joda-time_2.3.0[147]' used by 'com.onboard.service.github_3.0.0.SNAPSHOT' in bundle 'com.onboard.service.github_3.0.0.SNAPSHOT[189]'
package 'org.joda.time.format_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[111]'
conflicts with 'org.joda.time.format_2.3.0' in bundle 'joda-time_2.3.0[147]' imported by bundle 'com.onboard.web.api_3.0.0.SNAPSHOT[1441423661083]'
package 'org.joda.time.format_1.6.0' in bundle 'com.springsource.org.joda.time_1.6.0[89]' used by 'org.springframework.format.datetime.joda_3.1.0.RELEASE' in bundle 'org.springframework.context_3.1.0.RELEASE[111]'
conflicts with 'org.joda.time.format_2.3.0' in bundle 'joda-time_2.3.0[147]' imported by bundle 'com.onboard.web.api_3.0.0.SNAPSHOT[1441423661083]'
Uses violation: <Import-Package: org.hibernate.validator.constraints.impl; version="0.0.0"> in bundle <com.onboard.web.api_3.0.0.SNAPSHOT[1441423661083]>
Resolver reported uses conflict for import constrained to bundle <com.springsource.org.hibernate.validator> constrained bundle version range "[4.2.0.Final,4.2.0.Final]"
at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(QuasiResolveStage.java:46)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.internal.CompensatingPipeline.doProcessGraph(CompensatingPipeline.java:73)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.install.pipeline.internal.StandardPipeline.doProcessGraph(StandardPipeline.java:62)
at org.eclipse.virgo.kernel.install.pipeline.stage.AbstractPipelineStage.process(AbstractPipelineStage.java:41)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.driveInstallPipeline(PipelinedApplicationDeployer.java:359)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.doInstall(PipelinedApplicationDeployer.java:185)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.install(PipelinedApplicationDeployer.java:140)
at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:253)
at org.eclipse.virgo.kernel.deployer.management.StandardDeployer.deploy(StandardDeployer.java:52)
at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1487)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:97)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1328)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1420)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:848)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
我发现我有两个依赖:
<dependency>
<groupId>com.onboard</groupId>
<artifactId>com.onboard.domain.model</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>com.springsource.org.hibernate.validator</artifactId>
<version>4.2.0.Final</version>
</dependency>
模型依赖joda-time:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
</dependency>
和hibernate.validator依赖org.joda:
<dependency>
<groupId>org.joda</groupId>
<artifactId>com.springsource.org.joda.time</artifactId>
<version>1.6.0</version>
<scope>compile</scope>
</dependency>
Joda-time的版本是2.3,org.joda的版本是1.6.0。 Joda-time 和 org.joda 都提供包 org.joda.time...
。但是构建 MANIFEST.MF
的 Maven bundle 插件只有这样的 joda 时间包:
org.joda.time;version="[2.3,3)",org.joda.time.format;version="[2.3,3)"
所以当应用程序启动时,它们会发生冲突。
最佳答案
为什么需要这两个包?我尝试使用 joda-time 安装 com.springsource.org.hibernate.validator,它看起来像预期的那样工作。另一方面,如果您认为删除 com.springsource.org.joda.time 是个坏主意,您可以删除 joda-time 并仅使用 com.springsource.org.joda.time。
或者,您可以制作一个包含 joda-time 和 com.springsource.org.joda.time 的包。使用BND捆绑插件你可以做这样的事情:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.joda</groupId>
<artifactId>com.springsource.org.joda.time</artifactId>
<version>1.6.0</version>
<scope>compile</scope>
</dependency>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${bundle-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<_failok>true</_failok>
...
<Export-Package>org.joda.time*</Export-Package>
<Embed-Dependency>*;scope=compile</Embed-Dependency>
...
</instructions>
</configuration>
</plugin>
希望对您有所帮助!
关于java - 如何解决 joda-time 和 org.joda 之间的包冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32409338/
我是 grails 的新手。我正在使用 joda 插件来获取日期和时间。所以我在单独的列中显示日期和时间。现在我想使用条件搜索日期。 我在 gsp 页面中使用以下代码来搜索日期。
我试图在执行更多计算之前简单地将 TimeZone 信息添加回 LocalDate。 LocalDate 来自使用 ObjectLab LocalDateCalculator 将天数添加到现有 Dat
所以我在使用 JodaTime 年表 IslamicChronology 解析日期时遇到问题,因此编写了一个小示例来演示我的问题。 代码如下: import org.joda.time.Chronol
当我启动我的应用程序时,virgo 会抛出这样的异常: [2015-09-05 11:27:53.254] TCP Connection(2)-127.0.0.1 Installation of
我使用 Spring 从 Web API rest API 检索 JSON 数据,使用 Jackson Joda 模块反序列化 ISO 日期,并将其转换为 Joda DateTime。 Spring
在 Android 设备 (7.0) 上,出现此崩溃: Fatal Exception: org.joda.time.IllegalInstantException: Illegal instant
我需要将 GMT 转换为亚利桑那时间。亚利桑那州目前有 MST(夏令时关闭)。 但是在 Joda Time DateTimeZone 代码中,MST 已映射到 America/Denver: map.
大家早上好。 我想帮助您了解如何使用 1.2.1.1 版本的 Joda Time 完成 org.joda.time.DateTime 到 java.util.Date 的转换。 为什么选择 Joda
试试这个: @Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyAmountAndCurrency") pri
尝试使用 Joda 将包含日期字符串的 JSON 字符串反序列化为 POJO 时遇到异常。 我将 Jackson2 与 Spring 和 Robospice 一起使用。 我遇到以下异常: Could
我有一个招摇的OpenAPI YAML文件,我想使用gradle-swagger-generator-plugin生成Java 这是我的config.json { "useRxJava2": tr
我想使用以下 MDX 语句: with member [x] as now()->plusMonths(1)->withDayOfMonth(1)->minusDay(1) select [x] on
System.out.println( PeriodFormat.getDefault().print(Period.hours(1).plusMinutes(30).plusSeconds(60))
我正在使用 Joda-Time Duration 来获取两个 DateTime 之间的持续时间: DateTime startTimeDate = new DateTime(startTimeDate
当我运行以下代码片段时: import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import java.sql.Times
我正在尝试在 Joda DateTime 中转换毫秒。米利斯是 1338501600000我使用了在线转换器和其他库,所有结果都是 1338501600000 millis 是 Fri Jun 01
我尝试使用以下代码,但收到错误格式无效:“12/11/2013”: String dFrom = ps.utils.gv(request, "dFrom"); String dTo = ps.ut
我正在尝试使用 Joda-Time 的持续时间类来计算两天之间的确切天数差异。这意味着我希望结果是 25.48 天,而不是仅仅 25 天。现在我有: private static final doub
有没有隐藏的方法来获得 Joda-Time以分钟为单位的时间段(或任何其他) 现在我做的是: (period.getHours()*60 + period.getMinutes() + roundTw
有谁知道如何解析日期,例如:Mon Aug 04 16:07:00 CEST 2014使用 Joda 的 DateTime 格式化程序转换为 dd/MM/YYYY HH:MM:SS。我已经尝试过了:
我是一名优秀的程序员,十分优秀!