You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Thomas Fischer <fi...@aon.at> on 2013/01/07 11:10:33 UTC
Re: Can't Compile: cannot find symbol method getSpaceMapping()
Hello,
I'm still stuck with the compilation of PDFBox 1.8.
FontBox won't compile:
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ fontbox ---
[INFO] Compiling 4 source files to /SVN/PDFbox/trunk/fontbox/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
[ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
Any idea?
Best regards
Thomas Fischer
Am 29.12.2012 um 10:52 schrieb Thomas Fischer:
> Hello Andreas,
>
>> Everything looks good so far.
>>
>> Please, run the following and post the log
>>
>> mvn clean install -l mvn.log
>
> I did and attach the log to this mail, since the list doesn't accept attachments afaik.
> Can there be a problem with my maven or Java installations?
> I get
>
> macbook:trunk Thomas$ mvn -version
> Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
> Maven home: /usr/share/maven
> Java version: 1.6.0_37, vendor: Apple Inc.
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: de_DE, platform encoding: MacRoman
> OS name: "mac os x", version: "10.6.8", arch: "x86_64", family: "mac"
>
> Best
> Thomas
>
> ------------- mvn.log -----------------
>
> [INFO] Scanning for projects...
> [INFO] ------------------------------------------------------------------------
> [INFO] Reactor Build Order:
> [INFO]
> [INFO] PDFBox parent
> [INFO] Apache FontBox
> [INFO] Apache JempBox
> [INFO] Apache XmpBox
> [INFO] Apache PDFBox
> [INFO] Apache Preflight
> [INFO] Apache PDFBox for Lucene
> [INFO] Apache PDFBox for Ant
> [INFO] Apache PDFBox webapp
> [INFO] Apache PDFBox application
> [INFO] Apache PDFBox examples
> [INFO] PDFBox reactor
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building PDFBox parent 1.8.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom
> 2/5 KB
> 5/5 KB
>
> Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom (5 KB at 1.1 KB/sec)
> Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.jar
> 2/23 KB
> 3/23 KB
> 4/23 KB
> 6/23 KB
> 7/23 KB
> 8/23 KB
> 9/23 KB
> 11/23 KB
> 12/23 KB
> 13/23 KB
> 15/23 KB
> 16/23 KB
> 17/23 KB
> 19/23 KB
> 20/23 KB
> 21/23 KB
> 23/23 KB
> 23/23 KB
>
> Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.jar (23 KB at 5.3 KB/sec)
> [INFO]
> [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ pdfbox-parent ---
> [INFO] Deleting /SVN/PDFbox/trunk/parent/target
> [INFO]
> [INFO] --- maven-remote-resources-plugin:1.2.1:process (default) @ pdfbox-parent ---
> [INFO]
> [INFO] --- maven-site-plugin:3.0:attach-descriptor (attach-descriptor) @ pdfbox-parent ---
> [INFO]
> [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ pdfbox-parent ---
> [INFO] Installing /SVN/PDFbox/trunk/parent/pom.xml to /Users/Thomas/.m2/repository/org/apache/pdfbox/pdfbox-parent/1.8.0-SNAPSHOT/pdfbox-parent-1.8.0-SNAPSHOT.pom
> [INFO]
> [INFO] ------------------------------------------------------------------------
> [INFO] Building Apache FontBox 1.8.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ fontbox ---
> [INFO] Deleting /SVN/PDFbox/trunk/fontbox/target
> [INFO]
> [INFO] --- maven-remote-resources-plugin:1.2.1:process (default) @ fontbox ---
> [INFO]
> [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ fontbox ---
> [debug] execute contextualize
> [INFO] Using 'ISO-8859-1' encoding to copy filtered resources.
> [INFO] skip non existing resourceDirectory /SVN/PDFbox/trunk/fontbox/src/main/resources
> [INFO] Copying 3 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ fontbox ---
> [INFO] Compiling 73 source files to /SVN/PDFbox/trunk/fontbox/target/classes
> [INFO]
> [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ fontbox ---
> [debug] execute contextualize
> [INFO] Using 'ISO-8859-1' encoding to copy filtered resources.
> [INFO] Copying 1 resource
> [INFO] Copying 3 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ fontbox ---
> [INFO] Compiling 4 source files to /SVN/PDFbox/trunk/fontbox/target/test-classes
> [INFO] -------------------------------------------------------------
> [ERROR] COMPILATION ERROR :
> [INFO] -------------------------------------------------------------
> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
> [INFO] 2 errors
> [INFO] -------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] PDFBox parent ..................................... SUCCESS [16.646s]
> [INFO] Apache FontBox .................................... FAILURE [8.246s]
> [INFO] Apache JempBox .................................... SKIPPED
> [INFO] Apache XmpBox ..................................... SKIPPED
> [INFO] Apache PDFBox ..................................... SKIPPED
> [INFO] Apache Preflight .................................. SKIPPED
> [INFO] Apache PDFBox for Lucene .......................... SKIPPED
> [INFO] Apache PDFBox for Ant ............................. SKIPPED
> [INFO] Apache PDFBox webapp .............................. SKIPPED
> [INFO] Apache PDFBox application ......................... SKIPPED
> [INFO] Apache PDFBox examples ............................ SKIPPED
> [INFO] PDFBox reactor .................................... SKIPPED
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 35.157s
> [INFO] Finished at: Sat Dec 29 10:42:29 CET 2012
> [INFO] Final Memory: 20M/81M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (default-testCompile) on project fontbox: Compilation failure: Compilation failure:
> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
> [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
> [ERROR]
> [ERROR] After correcting the problems, you can resume the build with the command
> [ERROR] mvn <goals> -rf :fontbox
>
>
Re: Can't Compile: cannot find symbol method getSpaceMapping()
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
Am 21.01.2013 19:00, schrieb Thomas Fischer:
> Hello,
>
> well, I finally got it.
>
>> The method in the fontbox lib which is used here contains the old
>> implementation with one parameter.
>> …
>
>> Same issue here, old fontbox version. The getSpaceMapping method is quite new.
>
> The point is that in the compilation process not the newly compiled fontbox was used but an older version of fontbox instaled on my computer: /Library/Java/Extensions/fontbox-1.6.0.jar (Mac).
> I wasn't aware of the problems I get when building a new pdfbox while an older version is installed, it seems on the Mac the /Library/Java/Extensions/ is preferred over the new compilation.
> I have other versions of fontbox installed (e.g. in my solr system) but they don't do any harm (it seems, I hope…).
Congrats!! ;-)
> Thanks for the patience along the way!
No problem at all
> Best
> Thomas
>
BR
Andreas Lehmkühler
Re: Can't Compile: cannot find symbol method getSpaceMapping()
Posted by Thomas Fischer <fi...@aon.at>.
Hello,
well, I finally got it.
> The method in the fontbox lib which is used here contains the old
> implementation with one parameter.
> …
> Same issue here, old fontbox version. The getSpaceMapping method is quite new.
The point is that in the compilation process not the newly compiled fontbox was used but an older version of fontbox instaled on my computer: /Library/Java/Extensions/fontbox-1.6.0.jar (Mac).
I wasn't aware of the problems I get when building a new pdfbox while an older version is installed, it seems on the Mac the /Library/Java/Extensions/ is preferred over the new compilation.
I have other versions of fontbox installed (e.g. in my solr system) but they don't do any harm (it seems, I hope…).
Thanks for the patience along the way!
Best
Thomas
Re: Can't Compile: cannot find symbol method getSpaceMapping()
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Am 18.01.2013 10:58, schrieb Thomas Fischer:
> Hello,
>
> still stuck.
>
> First:
>
>>> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ fontbox ---
>>> [INFO] Compiling 4 source files to /SVN/PDFbox/trunk/fontbox/target/test-classes
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] COMPILATION ERROR :
>>> [INFO] -------------------------------------------------------------
>>> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
>>> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
>> Please double check the source of Type1CharStringTest.
>
> What do you mean?
Exactly what you did, double check if your local version is identical to the svn
version.
> I use
> /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java (identical to the svn's version).
> In Type1CharStringTest.java I have in line 44 to 46
>
> byte[] encodedCommands = new Type1CharStringFormatter().format(commands);
> List<Object> decodedCommands = new Type1CharStringParser()
> .parse(encodedCommands, new IndexData(0));
>
> and in lines 63 t0 65
>
> byte[] encodedNumbers = new Type1CharStringFormatter().format(numbers);
> List<Object> decodedNumbers = new Type1CharStringParser()
> .parse(encodedNumbers, new IndexData(0));
>
> which obviously is what the compiler is complaining about.
> I dont understand enough of the whole system why this "cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)".
> Should it be?
The method in the fontbox lib which is used here contains the old
implementation with one parameter.
>> Your environment looks good, Probably your local maven repository is somehow mixed up. Remove the pdfbox/fontbox stuff and restart mvn clean install.
>
> I erased the .m2 folder in my home directory, but that didn't change anything (only took more time to fetch the stuff again).
>
> Just to check I erased the file Type1CharStringTest.java and then fontbox compiled and everything went through until I hit the old error again:
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project pdfbox: Compilation failure
> [ERROR] /SVN/PDFbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java:[525,52] cannot find symbol
> [ERROR] symbol : method getSpaceMapping()
> [ERROR] location: class org.apache.fontbox.cmap.CMap
>
> which refers to
> int spaceMapping = toUnicodeCmap.getSpaceMapping();
> in PDSimpleFont.java
>
> Why getSpaceMapping() is not found in public class CMap I don't understand. There is
>
> /**
> * Returns the mapping for the space character.
> *
> * @return the mapped code for the space character
> */
> public int getSpaceMapping()
> {
> return spaceMapping;
> }
>
> inside.
> But what is it supposed to do and why isn't it found?
Same issue here, old fontbox version. The getSpaceMapping method is quite new.
> I could run the compilation with the -X switch again if it would help in any way.
It looks like maven is using an old version of fontbox and not the local
fresh compiled one. Did you set your classpath to any local installed version
of fontbox/pdfbox?
The -X switch activates a lot of logging and I'm not sure if something of that
will be helpful, but give it a try.
> Best
> Thomas
BR
Andreas Lehkühler
Re: Can't Compile: cannot find symbol method getSpaceMapping()
Posted by Thomas Fischer <fi...@aon.at>.
Hello,
still stuck.
First:
>> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ fontbox ---
>> [INFO] Compiling 4 source files to /SVN/PDFbox/trunk/fontbox/target/test-classes
>> [INFO] -------------------------------------------------------------
>> [ERROR] COMPILATION ERROR :
>> [INFO] -------------------------------------------------------------
>> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
>> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
> Please double check the source of Type1CharStringTest.
What do you mean?
I use
/SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java (identical to the svn's version).
In Type1CharStringTest.java I have in line 44 to 46
byte[] encodedCommands = new Type1CharStringFormatter().format(commands);
List<Object> decodedCommands = new Type1CharStringParser()
.parse(encodedCommands, new IndexData(0));
and in lines 63 t0 65
byte[] encodedNumbers = new Type1CharStringFormatter().format(numbers);
List<Object> decodedNumbers = new Type1CharStringParser()
.parse(encodedNumbers, new IndexData(0));
which obviously is what the compiler is complaining about.
I dont understand enough of the whole system why this "cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)".
Should it be?
> Your environment looks good, Probably your local maven repository is somehow mixed up. Remove the pdfbox/fontbox stuff and restart mvn clean install.
I erased the .m2 folder in my home directory, but that didn't change anything (only took more time to fetch the stuff again).
Just to check I erased the file Type1CharStringTest.java and then fontbox compiled and everything went through until I hit the old error again:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project pdfbox: Compilation failure
[ERROR] /SVN/PDFbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java:[525,52] cannot find symbol
[ERROR] symbol : method getSpaceMapping()
[ERROR] location: class org.apache.fontbox.cmap.CMap
which refers to
int spaceMapping = toUnicodeCmap.getSpaceMapping();
in PDSimpleFont.java
Why getSpaceMapping() is not found in public class CMap I don't understand. There is
/**
* Returns the mapping for the space character.
*
* @return the mapped code for the space character
*/
public int getSpaceMapping()
{
return spaceMapping;
}
inside.
But what is it supposed to do and why isn't it found?
I could run the compilation with the -X switch again if it would help in any way.
Best
Thomas
Re: Can't Compile: cannot find symbol method getSpaceMapping()
Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,
Am 07.01.2013 11:10, schrieb Thomas Fischer:
> Hello,
>
> I'm still stuck with the compilation of PDFBox 1.8.
> FontBox won't compile:
Sorry for not coming back earlier.
> [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ fontbox ---
> [INFO] Compiling 4 source files to /SVN/PDFbox/trunk/fontbox/target/test-classes
> [INFO] -------------------------------------------------------------
> [ERROR] COMPILATION ERROR :
> [INFO] -------------------------------------------------------------
> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[46,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
> [ERROR] /SVN/PDFbox/trunk/fontbox/src/test/java/org/apache/fontbox/cff/Type1CharStringTest.java:[65,16] parse(byte[]) in org.apache.fontbox.cff.Type1CharStringParser cannot be applied to (byte[],org.apache.fontbox.cff.IndexData)
Please double check the source of Type1CharStringTest.
> Any idea?
Your environment looks good, Probably your local maven repository is somehow
mixed up. Remove the pdfbox/fontbox stuff and restart mvn clean install.
> Best regards
> Thomas Fischer
>
>
>
> Am 29.12.2012 um 10:52 schrieb Thomas Fischer:
>
>> Hello Andreas,
>>
>>> Everything looks good so far.
>>>
>>> Please, run the following and post the log
>>>
>>> mvn clean install -l mvn.log
>>
>> I did and attach the log to this mail, since the list doesn't accept attachments afaik.
>> Can there be a problem with my maven or Java installations?
>> I get
>>
>> macbook:trunk Thomas$ mvn -version
>> Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
>> Maven home: /usr/share/maven
>> Java version: 1.6.0_37, vendor: Apple Inc.
>> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
>> Default locale: de_DE, platform encoding: MacRoman
>> OS name: "mac os x", version: "10.6.8", arch: "x86_64", family: "mac"
>>
>> Best
>> Thomas
>>
>> ------------- mvn.log -----------------
SNIP
BR
Andreas Lehmkühler