RussellSpitzer / snakeyaml

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

Issue67 test failing with "Can't construct a java object for tag" #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build on Fedora 14/15

What is the expected output?
No error

What do you see instead?
  testLoad(org.yaml.snakeyaml.issues.issue67.NonAsciiCharsInClassNameTest): null; Can't construct a java object for tag:yaml.org,2002:org.yaml.snakeyaml.issues.issue67.NonAsciiCharsInClassNameTest$Acad%C3%A9mico; exception=Class not found: org.yaml.snakeyaml.issues.issue67.NonAsciiCharsInClassNameTest$Acad?mico
  testDump(org.yaml.snakeyaml.issues.issue67.NonAsciiCharsInClassNameTest): org/yaml/snakeyaml/issues/issue67/NonAsciiCharsInClassNameTest$Acad?mico
  testDumpCustomTag(org.yaml.snakeyaml.issues.issue67.NonAsciiCharsInClassNameTest): org/yaml/snakeyaml/issues/issue67/NonAsciiCharsInClassNameTest$Acad?mico
  testDumpEscapedTag(org.yaml.snakeyaml.issues.issue67.NonAsciiCharsInClassNameTest): org/yaml/snakeyaml/issues/issue67/NonAsciiCharsInClassNameTest$Acad?mico

What version of SnakeYAML are you using?
1.8

On what Java version?
Apache Maven 3.0.3 (rNON-CANONICAL_2011-04-18_12-36_mockbuild; 2011-04-18 
14:36:06+0200)
Maven home: /usr/share/maven
Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.38.6-27.fc15.x86_64", arch: "amd64", family: 
"unix"

Original issue reported on code.google.com by jcapik%r...@gtempaccount.com on 9 Jun 2011 at 9:14

Attachments:

GoogleCodeExporter commented 9 years ago
As you can see by the wrong name "NonAsciiCharsInClassNameTest$Acad?mico" the 
problem may be related to incorrect encoding. Since UTF-8 is explicitly defined 
in POM, it looks like this information is not respected during the build. The 
problem may be related to Maven 3. Please try Maven 2. SnakeYAML is build with 
Maven 2.

Original comment by py4fun@gmail.com on 9 Jun 2011 at 10:09

GoogleCodeExporter commented 9 years ago
I could build SnakeYAML with Maven 3.0.3 without any problems. It must be 
something else.

Original comment by py4fun@gmail.com on 10 Jun 2011 at 7:21

GoogleCodeExporter commented 9 years ago
do not forget important thing there: 
   java-1.6.0-openjdk-1.6.0.0.x86_64

I can build without problems on FC14 maven 2.2.1 openjdk-1.6.0.0

need to try under FC15

btw I have same problem in Eclipse under OSX if I use OpenJDK :) (for a long 
time)

Original comment by alexande...@gmail.com on 10 Jun 2011 at 7:32

GoogleCodeExporter commented 9 years ago
I can't reproduce it

FC 15
---------------
$ mvn3 -version
/usr/lib/jvm/java
Apache Maven 3.0.3 (rNON-CANONICAL_2011-04-18_12-36_mockbuild; 2011-04-18 
15:36:06+0300)
Maven home: /usr/share/maven
Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
Java home: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.38.6-27.fc15.x86_64", arch: "amd64", family: 
"unix"
----------------

$mvn3 clean package
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3:13.867s
[INFO] Finished at: Fri Jun 10 11:21:22 EEST 2011
[INFO] Final Memory: 17M/44M
[INFO] ------------------------------------------------------------------------

This is done in VM (OSX vmware Fusion). 

As you can see only difference is "platform encoding: ANSI_X3.4-1968" and mine 
is UTF-8
I think this is something to do with maven or java. It seems like 
maven-compile-plugin does not take sources as UTF-8 even if there are settings 
for this.

Original comment by alexande...@gmail.com on 10 Jun 2011 at 8:31

GoogleCodeExporter commented 9 years ago
Strange! ... today I can reproduce it neither on my workstation, nor on the 
build systems even if the platform encoding is still ANSI_X3.4-1968. I'm not 
aware of any changes/updates since I observed the failure. I agree, that this 
behavior doesn't seem to look like a problem of the snakeyaml. I'm gonna let 
the patch removed and wait if the issue appears again.

You can close this case if You want. It's at least tracked for those ones, 
who'll possibly experience the same issue in the future.

Thank You.

BR, J.

Original comment by jcapik%r...@gtempaccount.com on 10 Jun 2011 at 12:04

GoogleCodeExporter commented 9 years ago

Original comment by py4fun@gmail.com on 10 Jun 2011 at 1:13