google-code-export / protostuff

Automatically exported from code.google.com/p/protostuff
Apache License 2.0
1 stars 1 forks source link

Compilation issues when the projects are loaded. "mvn clean install" also same error. #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download the jar.
2. Unzip.
3. run mvn install. compilation error.

The compilation error seen when I loaded the projects in eclipse. Importing the 
maven projects.

What is the expected output? What do you see instead?
Should build fine.

What version of the product are you using? On what operating system?
latest. 1.0.0 Windows 7

Please provide any additional information below.

Attaching an example of surefire report.

-------------------------------------------------------------------------------
Test set: com.dyuproject.protostuff.runtime.RuntimePipeTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.008 sec <<< 
FAILURE!
testFoo(com.dyuproject.protostuff.runtime.RuntimePipeTest)  Time elapsed: 0.001 
sec  <<< ERROR!
java.lang.Error: Unresolved compilation problems: 
    The type EnumIO<E>.ByName<E> must implement the inherited abstract method MapSchema.MessageFactory.newMessage()
    Name clash: The method newMessage() of type EnumIO<E>.ByName<E> has the same erasure as newMessage() of type MapSchema<K,V>.MessageFactory but does not override it
    The type EnumIO<E>.ByNumber<E> must implement the inherited abstract method CollectionSchema.MessageFactory.newMessage()
    Duplicate method newMessage() in type EnumIO<E>.ByNumber<E>
    Name clash: The method newMessage() of type EnumIO<E>.ByNumber<E> has the same erasure as newMessage() of type CollectionSchema<V>.MessageFactory but does not override it
    Duplicate method newMessage() in type EnumIO<E>.ByNumber<E>

    at com.dyuproject.protostuff.runtime.EnumIO$ByNumber.<init>(EnumIO.java:237)
    at com.dyuproject.protostuff.runtime.EnumIO.get(EnumIO.java:139)
    at com.dyuproject.protostuff.runtime.RuntimeRepeatedFieldFactory.createCollectionEnumV(RuntimeRepeatedFieldFactory.java:120)
    at com.dyuproject.protostuff.runtime.RuntimeRepeatedFieldFactory.access$1(RuntimeRepeatedFieldFactory.java:116)
    at com.dyuproject.protostuff.runtime.RuntimeRepeatedFieldFactory$1.create(RuntimeRepeatedFieldFactory.java:498)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:323)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:280)
    at com.dyuproject.protostuff.runtime.RuntimeSchema$Lazy.getSchema(RuntimeSchema.java:532)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.getSchema(RuntimeSchema.java:203)
    at com.dyuproject.protostuff.runtime.RuntimePipeTest.getSchema(RuntimePipeTest.java:33)
    at com.dyuproject.protostuff.runtime.RuntimePipeTest.testFoo(RuntimePipeTest.java:38)

testBar(com.dyuproject.protostuff.runtime.RuntimePipeTest)  Time elapsed: 0.001 
sec  <<< ERROR!
java.lang.Error: Unresolved compilation problems: 
    The type EnumIO<E>.ByName<E> must implement the inherited abstract method MapSchema.MessageFactory.newMessage()
    Name clash: The method newMessage() of type EnumIO<E>.ByName<E> has the same erasure as newMessage() of type MapSchema<K,V>.MessageFactory but does not override it
    The type EnumIO<E>.ByNumber<E> must implement the inherited abstract method CollectionSchema.MessageFactory.newMessage()
    Duplicate method newMessage() in type EnumIO<E>.ByNumber<E>
    Name clash: The method newMessage() of type EnumIO<E>.ByNumber<E> has the same erasure as newMessage() of type CollectionSchema<V>.MessageFactory but does not override it
    Duplicate method newMessage() in type EnumIO<E>.ByNumber<E>

    at com.dyuproject.protostuff.runtime.EnumIO$ByNumber.<init>(EnumIO.java:237)
    at com.dyuproject.protostuff.runtime.EnumIO.get(EnumIO.java:139)
    at com.dyuproject.protostuff.runtime.RuntimeFieldFactory$12.create(RuntimeFieldFactory.java:1026)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:323)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:280)
    at com.dyuproject.protostuff.runtime.RuntimeSchema$Lazy.getSchema(RuntimeSchema.java:532)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.getSchema(RuntimeSchema.java:203)
    at com.dyuproject.protostuff.runtime.RuntimePipeTest.getSchema(RuntimePipeTest.java:33)
    at com.dyuproject.protostuff.runtime.RuntimePipeTest.testBar(RuntimePipeTest.java:47)

testPojoWithArrayAndSet(com.dyuproject.protostuff.runtime.RuntimePipeTest)  
Time elapsed: 0.002 sec  <<< ERROR!
java.lang.Error: Unresolved compilation problems: 
    The type EnumIO<E>.ByName<E> must implement the inherited abstract method MapSchema.MessageFactory.newMessage()
    Name clash: The method newMessage() of type EnumIO<E>.ByName<E> has the same erasure as newMessage() of type MapSchema<K,V>.MessageFactory but does not override it
    The type EnumIO<E>.ByNumber<E> must implement the inherited abstract method CollectionSchema.MessageFactory.newMessage()
    Duplicate method newMessage() in type EnumIO<E>.ByNumber<E>
    Name clash: The method newMessage() of type EnumIO<E>.ByNumber<E> has the same erasure as newMessage() of type CollectionSchema<V>.MessageFactory but does not override it
    Duplicate method newMessage() in type EnumIO<E>.ByNumber<E>

    at com.dyuproject.protostuff.runtime.EnumIO$ByNumber.<init>(EnumIO.java:237)
    at com.dyuproject.protostuff.runtime.EnumIO.get(EnumIO.java:139)
    at com.dyuproject.protostuff.runtime.RuntimeRepeatedFieldFactory.createCollectionEnumV(RuntimeRepeatedFieldFactory.java:120)
    at com.dyuproject.protostuff.runtime.RuntimeRepeatedFieldFactory.access$1(RuntimeRepeatedFieldFactory.java:116)
    at com.dyuproject.protostuff.runtime.RuntimeRepeatedFieldFactory$1.create(RuntimeRepeatedFieldFactory.java:498)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:323)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.createFrom(RuntimeSchema.java:280)
    at com.dyuproject.protostuff.runtime.RuntimeSchema$Lazy.getSchema(RuntimeSchema.java:532)
    at com.dyuproject.protostuff.runtime.RuntimeSchema.getSchema(RuntimeSchema.java:203)
    at com.dyuproject.protostuff.runtime.RuntimePipeTest.getSchema(RuntimePipeTest.java:33)
    at com.dyuproject.protostuff.runtime.RuntimePipeTest.testPojoWithArrayAndSet(RuntimePipeTest.java:92)

Original issue reported on code.google.com by prabhak...@gmail.com on 15 Mar 2011 at 4:31

Attachments:

GoogleCodeExporter commented 9 years ago
I'm assuming you're not using jdk 1.6 yes?
I will have to try compiling on a different machine with jdk 1.5.

Original comment by david.yu...@gmail.com on 15 Mar 2011 at 6:27

GoogleCodeExporter commented 9 years ago
I am using JDK 1.6. the issue in Mac OS X also. Windows 7 also same issue with 
jdk 1.6

Volcano:surefire-reports Blackbird$ mvn --version
Apache Maven 3.0.2 (r1056850; 2011-01-08 16:58:10-0800)
Java version: 1.6.0_24, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x", version: "10.6.6", arch: "x86_64", family: "mac"
Volcano:surefire-reports Blackbird$ 

Original comment by prabhak...@gmail.com on 15 Mar 2011 at 5:07

GoogleCodeExporter commented 9 years ago
I'm on both ubuntu 10.4 (jdk1.6.0_24) and win32 xp (1.6.0_22).
Didn't get any compilation errors.
I'll try to test on a mac os x.

Btw, my maven is 2.2.1.  The maven project build has a compile target for 1.5.

Original comment by david.yu...@gmail.com on 16 Mar 2011 at 8:08

GoogleCodeExporter commented 9 years ago
Don't have any issues on Windows 7 x32 and x64, JDK 1.6.0_24 x64, server and 
client Vms. Maven 3.0.3. All compiles fine.

Original comment by Vladisla...@gmail.com on 10 Apr 2011 at 5:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
.. but isn't there a real problem in the source, a name clash, that should be 
fixed:

public static final class ByNumber<E extends Enum<E>> extends EnumIO<E>{
...
        @SuppressWarnings("unchecked")
        public <K, V> Map<K, V> newMessage()
...

        @SuppressWarnings("unchecked")
        public <V> Collection<V> newMessage()
...
}

Original comment by thomas.r...@gmail.com on 21 Apr 2011 at 2:10

GoogleCodeExporter commented 9 years ago
1.
mvn test 
worked in protostuff-runtime

2.
I cleared .m2-repository

3.
mvn test 
failed in protostuff-runtime

Original comment by thomas.r...@gmail.com on 21 Apr 2011 at 2:17

GoogleCodeExporter commented 9 years ago
I am seeing this issue too - in Eclipse.
Eclipse Version: Helios Service Release 2
Build id: 20110301-1815

JDK version: 1.6.0_22. If I delete those two methods, Eclipse offers to "add 
the missing methods". As soon as it adds them, the name clash shows up again. 
Eh?

Original comment by matyas.b...@gmail.com on 7 Jun 2011 at 12:05

GoogleCodeExporter commented 9 years ago
I just built protostuff on a fresh machine (ubuntu 11.04) with no maven 
whatsoever.  I did not get any errors building.  
I'm using jdk 1.6_24 and 1.6._26.
So far I've already tested on both windows xp and ubuntu 10.04 and 11.04.

Alexander (deployed to maven central) didn't have any problems as well.
I'll try to follow thomas' steps tomorrow to see if it fails on win 7.

Original comment by david.yu...@gmail.com on 27 Jun 2011 at 2:02

GoogleCodeExporter commented 9 years ago
Just to complete the picture: I am having this problem under linux (Ubuntu 
11.04). But I doubt this is OS dependent. Maven is not installed.

Original comment by matyas.b...@gmail.com on 27 Jun 2011 at 2:55

GoogleCodeExporter commented 9 years ago
Here's my environment:
Ubuntu 11.04 x64
maven 2.2.1
jdk 1.6_26 x64

Matyas, do we have same environment?
If you can, please try compiling with maven 2.2.1 to check?
All my machines have maven 2.2.1.

P.S what I meant last time was that there was no maven repository yet (since it 
was fresh) .. but certainly maven had been installed.

Original comment by david.yu...@gmail.com on 27 Jun 2011 at 3:10

GoogleCodeExporter commented 9 years ago
I have Ubuntu 11.04 x86_32 with java 1.6.0_22 (32 bit version, certainly).
I can't install maven right now, but Eclipse is throwing still this error for 
me for the com.dyuproject.protostuff.runtime.EnumIO.java file with the 
mentioned JDK.

Original comment by matyas.b...@gmail.com on 27 Jun 2011 at 3:14

GoogleCodeExporter commented 9 years ago
I've fixed this issue anyway (even though I never got an error on windows,mac 
and ubuntu) at rev 1332.

Cheers

Original comment by david.yu...@gmail.com on 7 Jul 2011 at 8:54

GoogleCodeExporter commented 9 years ago
Fix confirmed. Thank you.

Original comment by matyas.b...@gmail.com on 7 Jul 2011 at 9:18