You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by cfnz <re...@hill-labs.co.nz> on 2015/09/10 04:08:25 UTC
Java 8 Type Annotations cause error - is that expected?
Hi,
First up, I am new to Tomee and Java 8 too really ;-) (just trying out both)
I have a model which I have started annotating with Java 8 null type
annotations (org.eclipse.jdt.annotation.*)
I have read that Tomee 1.7 supports java 8 so thought I would give it a go.
I found that I got the following error as soon as I introduced one of the
previously mentioned annotations.
WARNING - Unable to scrape for @Stateful, @Stateless, @Singleton or
@MessageDriven annotations. AnnotationFinder failed.
java.lang.RuntimeException
at org.apache.xbean.asm5.MethodVisitor.visitTypeAnnotation(Unknown Source)
at org.apache.xbean.asm5.ClassReader.b(Unknown Source)
at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
etc...
Is this expected behaviour? I know there is a Tomee 2.0 in the works, but I
thought Java 8 features were supported in Tomee 1.7... or is it just that it
can run on a Java 8 runtime?
Thanks for any help
Regards
Colin
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Java-8-Type-Annotations-cause-error-is-that-expected-tp4676168.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Java 8 Type Annotations cause error - is that expected?
Posted by cfnz <re...@hill-labs.co.nz>.
Thanks for that...
Shall try again later.
Regards
Colin
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Java-8-Type-Annotations-cause-error-is-that-expected-tp4676168p4676176.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Java 8 Type Annotations cause error - is that expected?
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok,
issue is due to a solved xbean issue:
http://issues.apache.org/jira/browse/XBEAN-286
upgrading to xbean 4.4-SNAPSHOT makes it working, will try to release xbean
when I get few cycles to upgrade tomee
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-09-09 20:08 GMT-07:00 cfnz <re...@hill-labs.co.nz>:
> I am not sure...???
>
> Steps to reproduce...
>
> Checkout eclipse link example: svn co
> http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/jpa-eclipselink
> cd jpa-eclipselink
> mvn test
>
> >> All Good
>
> edit pom, update configuration source and target to java 1.8 and add
> following:
>
> <dependency>
> <groupId>org.eclipse.jdt</groupId>
> <artifactId>org.eclipse.jdt.annotation</artifactId>
> <version>2.0.0</version>
> <scope>compile</scope>
> </dependency>
>
> mvn test
>
> >> Still all good
>
> Edit Movie.java as follows:
>
> Add import org.eclipse.jdt.annotation.Nullable;
> Add @Nullable annotation to getDirector()
>
> mvn compile
>
> >> Still all Good
>
> mvn test
>
> >> Fail
> javax.naming.NameNotFoundException: Name "global/jpa-eclipselink/Movies"
> not
> found.
>
> And further up in the console output you can see why:
> WARNING - Unable to scrape for @Stateful, @Stateless, @Singleton or
> @MessageDriven annotations. AnnotationFinder failed.
> java.lang.RuntimeException
> at org.apache.xbean.asm5.MethodVisitor.visitTypeAnnotation(Unknown
> Source)
> at org.apache.xbean.asm5.ClassReader.b(Unknown Source)
> at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
> etc
>
> Regards
> Colin
>
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Java-8-Type-Annotations-cause-error-is-that-expected-tp4676168p4676170.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>
Re: Java 8 Type Annotations cause error - is that expected?
Posted by cfnz <re...@hill-labs.co.nz>.
I am not sure...???
Steps to reproduce...
Checkout eclipse link example: svn co
http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/jpa-eclipselink
cd jpa-eclipselink
mvn test
>> All Good
edit pom, update configuration source and target to java 1.8 and add
following:
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.annotation</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
mvn test
>> Still all good
Edit Movie.java as follows:
Add import org.eclipse.jdt.annotation.Nullable;
Add @Nullable annotation to getDirector()
mvn compile
>> Still all Good
mvn test
>> Fail
javax.naming.NameNotFoundException: Name "global/jpa-eclipselink/Movies" not
found.
And further up in the console output you can see why:
WARNING - Unable to scrape for @Stateful, @Stateless, @Singleton or
@MessageDriven annotations. AnnotationFinder failed.
java.lang.RuntimeException
at org.apache.xbean.asm5.MethodVisitor.visitTypeAnnotation(Unknown Source)
at org.apache.xbean.asm5.ClassReader.b(Unknown Source)
at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
etc
Regards
Colin
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Java-8-Type-Annotations-cause-error-is-that-expected-tp4676168p4676170.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: Java 8 Type Annotations cause error - is that expected?
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,
this looks like a classpath missing some dependencies rather than a java 8
issue
Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>
2015-09-09 19:08 GMT-07:00 cfnz <re...@hill-labs.co.nz>:
> Hi,
>
> First up, I am new to Tomee and Java 8 too really ;-) (just trying out
> both)
>
> I have a model which I have started annotating with Java 8 null type
> annotations (org.eclipse.jdt.annotation.*)
>
> I have read that Tomee 1.7 supports java 8 so thought I would give it a go.
>
> I found that I got the following error as soon as I introduced one of the
> previously mentioned annotations.
>
> WARNING - Unable to scrape for @Stateful, @Stateless, @Singleton or
> @MessageDriven annotations. AnnotationFinder failed.
> java.lang.RuntimeException
> at org.apache.xbean.asm5.MethodVisitor.visitTypeAnnotation(Unknown
> Source)
> at org.apache.xbean.asm5.ClassReader.b(Unknown Source)
> at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
> at org.apache.xbean.asm5.ClassReader.accept(Unknown Source)
> etc...
>
> Is this expected behaviour? I know there is a Tomee 2.0 in the works, but I
> thought Java 8 features were supported in Tomee 1.7... or is it just that
> it
> can run on a Java 8 runtime?
>
> Thanks for any help
> Regards
> Colin
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Java-8-Type-Annotations-cause-error-is-that-expected-tp4676168.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>