来自注释处理器的支持源版本RELEASE_6 org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor小于source1.7 [英] Supported source version RELEASE_6 from annotation processor org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor less than source1.7

查看:860
本文介绍了来自注释处理器的支持源版本RELEASE_6 org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor小于source1.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在以下环境中运行的企业应用程序。

I have an enterprise application running in the following environment.


  • Mojarra 2.2.7

  • PrimeFaces 5.0 final

  • PrimeFaces Extension 2.0 final

  • OmniFaces 1.8.1

  • EclipseLink 2.5.2拥有JPA 2.1

  • GlashFish 4.0

  • NetBeans IDE 8.0

  • JDK 1.7

  • Mojarra 2.2.7
  • PrimeFaces 5.0 final
  • PrimeFaces Extension 2.0 final
  • OmniFaces 1.8.1
  • EclipseLink 2.5.2 having JPA 2.1
  • GlashFish 4.0
  • NetBeans IDE 8.0
  • JDK 1.7

我已经在 project.properties 文件中将源级别从1.6更改为1.7所有三个模块(Java EE模块,EJB模块和WAR模块)中的> nbproject 都支持Java EE 7.它是 Maven项目。

I have changed the source levels to 1.7 from 1.6 in the project.properties file under nbproject in all three modules (Java EE module, EJB module and WAR module) to have support for Java EE 7. It is not a Maven project.


  • j2ee.platform = 1.7

  • javac.source = 1.7

  • javac.target = 1.7

  • j2ee.platform=1.7
  • javac.source=1.7
  • javac.target=1.7

早些时候他们都是1.6。

Earlier they all were 1.6.

之后这些更改,清除项目时出现以下警告。

After these changes, the following warning appears while cleaning the project.


警告:来自注释的支持源版本'RELEASE_6'
处理器
'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor'
小于-source'1.7'

warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' less than -source '1.7'

我正在使用 EclipseLink元模型生成器 1.3.0 最终以生成静态元模型。

除了将源级别降级到1.6之外,有没有办法摆脱这个警告?是否与此警告不兼容?

Is there a way to get rid of this warning other than downgrading the source level to 1.6? Is there any incompatibility with this warning?

更新:

此警告在EclipseLink 2.6.1 中不再可再现(自此以后可用) 2015年10月15日,星期四)与捆绑包提供的相应元模型生成器 - org.eclipse.persistence.jpa.modelgen_2.6.1.v20150916-55dc7c3.jar

This warning is no longer reproducible in EclipseLink 2.6.1 (available since Thursday, October 15, 2015) with the respective metamodel generator provided by the bundle - org.eclipse.persistence.jpa.modelgen_2.6.1.v20150916-55dc7c3.jar.

目前在GlassFish 4.1 / Java EE 7上使用EclipseLink 2.6.1(JPA 2.1)和JDK 8u45进行了测试。

Currently tested using EclipseLink 2.6.1 (JPA 2.1) and JDK 8u45 on GlassFish 4.1 / Java EE 7.

我认为它是固定的。

推荐答案

根据 Java API规范,@ SupportedSourceVersion注释(这是日志的起源) )指定注释处理器支持的最新源版本,而不是最小值。

According to the Java API specification, the @SupportedSourceVersion annotation (which is the origin of the log) specifies "the latest source version an annotation processor supports", not the minimum.

阅读讨论NetBeans关于这个主题的论坛,它表明你的解决方案很少。我想唯一的解决方案是更改 CanonicalModelProcessor

Reading a discussion on the NetBeans forum on this topic, it suggests you have few solutions. I guess the only solution is to change the code in CanonicalModelProcessor:

为了使EclipseLink运行时符合Java 6,你需要
@SupportedSourceVersion(RELEASE_6)

In order for the EclipseLink runtime to be compliant with Java 6, you have @SupportedSourceVersion(RELEASE_6)

要适当地适应Java 7编译,你应该有
@ SupportedSourceVersion(RELEASE_7)

To be properly adapted for a Java 7 compilation, you should have @SupportedSourceVersion(RELEASE_7)

但是我了解您并不是自己编译EclipseLink。主要问题(以及警告的原因)是软件提供程序(即Eclipse基础)保证在Java SE 6环境中正确处理代码。

But as I understand you are not compiling EclipseLink on your own. The main problem (and the reason of the warning) is that the software provider (i.e. the Eclipse foundation) guarantees a proper processing of the code in a Java SE 6 environment.

问题是报告为JDK 错误。结论是没有其他明确的解决方法。

The problem was reported as a JDK bug. The conclusion is that there is no other clear workaround.

解决方案是指定RELEASE7常量(至少根据API的说法)。但是如果EclipseLink团队这样做,他们就无法在Java 6环境中编译。

The solution would be to specify the RELEASE7 constant (at least according to what the API says). But if EclipseLink team do, they can't compile in a Java 6 environment.

所以,无论你是否使用适当的常量自己编译EclipseLink,警告......

So whether you compile EclipseLink on your own with the proper constant, whether you live with the warning...

这篇关于来自注释处理器的支持源版本RELEASE_6 org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor小于source1.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆