Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semirings.java: "name clash, have the same erasure" problem #2

Closed
jiehanzheng opened this issue Jul 29, 2013 · 6 comments
Closed

Semirings.java: "name clash, have the same erasure" problem #2

jiehanzheng opened this issue Jul 29, 2013 · 6 comments

Comments

@jiehanzheng
Copy link

So I just checked out semafor and tried to build it using Maven:

jiehan@tpx1c /m/d/j/D/w/semafor> git log -1
commit a25f817027463923ea21166b2f43464722273fe8
Author: Sam Thomson <sammthomson@gmail.com>
Date:   Fri Jul 26 16:44:39 2013 -0400

    better workaround for Morpha bug (turns "null" into "")
jiehan@tpx1c /m/d/j/D/w/semafor> mvn package
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Semafor 3.0-alpha-04
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ Semafor ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ Semafor ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 164 source files to /mnt/docs/jiehan/Dropbox/workspace/semafor/target/classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING : 
[INFO] -------------------------------------------------------------
[WARNING] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/XmlUtils.java:[43,41] com.sun.org.apache.xpath.internal.XPathAPI is internal proprietary API and may be removed in a future release
[WARNING] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/XmlUtils.java:[107,45] com.sun.org.apache.xpath.internal.XPathAPI is internal proprietary API and may be removed in a future release
[WARNING] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/XmlUtils.java:[145,45] com.sun.org.apache.xpath.internal.XPathAPI is internal proprietary API and may be removed in a future release
[WARNING] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/XmlUtils.java:[167,45] com.sun.org.apache.xpath.internal.XPathAPI is internal proprietary API and may be removed in a future release
[WARNING] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/Semirings.java: Some input files use unchecked or unsafe operations.
[WARNING] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/Semirings.java: Recompile with -Xlint:unchecked for details.
[INFO] 6 warnings 
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/Semirings.java:[196,56] name clash: $(java.util.Collection<java.util.Set<edu.cmu.cs.lti.ark.util.ds.Pair<java.lang.Double,edu.cmu.cs.lti.ark.util.ds.path.Path<T>>>>) and $(java.util.Collection<edu.cmu.cs.lti.ark.util.ds.Pair<java.lang.Double,edu.cmu.cs.lti.ark.util.ds.path.Path<T>>>) have the same erasure
[ERROR] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/Semirings.java:[183,51] name clash: $(java.util.Collection<edu.cmu.cs.lti.ark.util.ds.Pair<java.lang.Double,edu.cmu.cs.lti.ark.util.ds.path.Path<T>>>) in edu.cmu.cs.lti.ark.util.Semirings.MaxPath and $(java.util.Collection<V>) in edu.cmu.cs.lti.ark.util.Semirings.Operation have the same erasure, yet neither overrides the other
[INFO] 2 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.245s
[INFO] Finished at: Mon Jul 29 01:52:47 EDT 2013
[INFO] Final Memory: 16M/205M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project Semafor: Compilation failure: Compilation failure:
[ERROR] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/Semirings.java:[196,56] name clash: $(java.util.Collection<java.util.Set<edu.cmu.cs.lti.ark.util.ds.Pair<java.lang.Double,edu.cmu.cs.lti.ark.util.ds.path.Path<T>>>>) and $(java.util.Collection<edu.cmu.cs.lti.ark.util.ds.Pair<java.lang.Double,edu.cmu.cs.lti.ark.util.ds.path.Path<T>>>) have the same erasure
[ERROR] /mnt/docs/jiehan/Dropbox/workspace/semafor/src/main/java/edu/cmu/cs/lti/ark/util/Semirings.java:[183,51] name clash: $(java.util.Collection<edu.cmu.cs.lti.ark.util.ds.Pair<java.lang.Double,edu.cmu.cs.lti.ark.util.ds.path.Path<T>>>) in edu.cmu.cs.lti.ark.util.Semirings.MaxPath and $(java.util.Collection<V>) in edu.cmu.cs.lti.ark.util.Semirings.Operation have the same erasure, yet neither overrides the other
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Could this be a JDK incompatibility?

jiehan@tpx1c /m/d/j/D/w/semafor> java -version
java version "1.7.0_40"
OpenJDK Runtime Environment (IcedTea 2.4.1) (ArchLinux build 7.u40_2.4.1-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.0-b50, mixed mode)

I am new to Java, so maybe I am doing something wrong here. If anyone could point out the problem (or share a compiled JAR with me for now first) that would be wonderful! Thanks!

@sammthomson
Copy link
Contributor

I think this is indeed a JDK (or maybe java version) incompatibility.
I use:

java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-10M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

Looking into it...

In the meantime, here's a jar built from https://github.com/sammthomson/semafor/tree/a25f817027463923ea21166b2f43464722273fe8 :

https://www.dropbox.com/s/73xpcra0w3w0oyt/Semafor-3.0-alpha-04.jar

@jiehanzheng
Copy link
Author

@sammthomson Thanks for the JAR file! Let me know if I can help on testing / debugging.

@sammthomson
Copy link
Contributor

fixed in 7c9d2df

@jiehanzheng
Copy link
Author

Cool. That was fast. Thank you!

@arisagithub
Copy link

when I try to run semafor with this jar file it stops in the Converting postagged input to conll phase.

Environment variables:
SEMAFOR_HOME=/opt/semafor
CLASSPATH=.:/opt/semafor/target/Semafor-3.0-alpha-04.jar
JAVA_HOME_BIN=/usr/lib/jvm/java-6-oracle/bin
MALT_MODEL_DIR=/opt/semafor_malt_model_20121129
TEMP_DIR: /tmp/semafor.oHswfdoPiw
Environment variables:
SEMAFOR_HOME=/opt/semafor
CLASSPATH=.:/opt/semafor/target/Semafor-3.0-alpha-04.jar
JAVA_HOME_BIN=/usr/lib/jvm/java-6-oracle/bin
MALT_MODEL_DIR=/opt/semafor_malt_model_20121129
Environment variables:
SEMAFOR_HOME=/opt/semafor
CLASSPATH=.:/opt/semafor/target/Semafor-3.0-alpha-04.jar
JAVA_HOME_BIN=/usr/lib/jvm/java-6-oracle/bin
MALT_MODEL_DIR=/opt/semafor_malt_model_20121129


Tokenizing file: Data/Cause.txt

real 0m0.039s
user 0m0.000s
sys 0m0.000s
Finished tokenization.



Part-of-speech tagging tokenized data....
/opt/semafor/scripts/jmx /opt/semafor/bin
Read 11692 items from tagger.project/word.voc
Read 45 items from tagger.project/tag.voc
Read 42680 items from tagger.project/tagfeatures.contexts
Read 42680 contexts, 117558 numFeatures from tagger.project/tagfeatures.fmap
Read model tagger.project/model : numPredictions=45, numParams=117558
Read tagdict from tagger.project/tagdict
This is MXPOST (Version 1.0)
Copyright (c) 1997 Adwait Ratnaparkhi
Sentence: 0 Length: 1 Elapsed Time: 0.024 seconds.
Sentence: 1 Length: 0 Elapsed Time: 0.0 seconds.

real 0m1.937s
user 0m0.800s
sys 0m0.048s
/opt/semafor/bin
Finished part-of-speech tagging tokenized data.



Converting postagged input to conll.
Exception in thread "main" java.lang.IllegalArgumentException:
at edu.cmu.cs.lti.ark.fn.data.prep.formats.SentenceCodec.decode(SentenceCodec.java:83)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.SentenceCodec$SentenceIterator.computeNext(SentenceCodec.java:115)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.SentenceCodec$SentenceIterator.computeNext(SentenceCodec.java:100)
at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.ConvertFormat.convertStream(ConvertFormat.java:94)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.ConvertFormat.main(ConvertFormat.java:76)
Caused by: java.lang.IllegalArgumentException: PosToken must have 2 "_"-separated fields
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.Token.fromPosTagged(Token.java:248)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.SentenceCodec$2.decodeToken(SentenceCodec.java:28)
at edu.cmu.cs.lti.ark.fn.data.prep.formats.SentenceCodec.decode(SentenceCodec.java:79)
... 6 more

Any help you can give will be greatly appreciated.

@sammthomson
Copy link
Contributor

This comment is a duplicate of #20, let's discuss over there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants