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

OutputStreamWriter - The method getBytes(String) in the type EmulatedCharset is not applicable for the arguments (char[], int, int) #9682

Closed
freddyboucher opened this issue Apr 19, 2020 · 6 comments
Labels

Comments

@freddyboucher
Copy link
Contributor

freddyboucher commented Apr 19, 2020

GWT version: HEAD-SNAPSHOT

Hi, since today I get the following compilation error in my Jenkins-like environment (Github Actions):

[INFO] --- gwt-maven-plugin:1.0.0:compile (default-compile) @ learnkeeper-client ---
[INFO] Compiling module com.learnkeeper.App
[INFO] Tracing compile failure path for type 'java.io.OutputStreamWriter'
[INFO] [ERROR] Errors in 'jar:file:/Users/boucfr01/.m2/repository/com/google/gwt/gwt-user/HEAD-SNAPSHOT/gwt-user-HEAD-SNAPSHOT.jar!/com/google/gwt/emul/java/io/OutputStreamWriter.java'
[INFO] [ERROR] Line 59: The method getBytes(String) in the type EmulatedCharset is not applicable for the arguments (char[], int, int)
[INFO] [ERROR] Aborting compile due to errors in some input files
[INFO] [ERROR] Error saving compilation unit to cache file: /Users/boucfr01/Private/Programming/LearnKeeper/learnkeeper-client/target/gwt-unitCache/gwt-unitCache-8eaa4a3840f6593db9b9513ecf167e7513615408-FF35F588CF7564DE259004F02565B00E-000001719137B04D
[INFO] java.io.IOException: Stream Closed
[INFO] at java.io.RandomAccessFile.seek0(Native Method)
[INFO] at java.io.RandomAccessFile.seek(RandomAccessFile.java:557)
[INFO] at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:161)
[INFO] at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:73)
[INFO] at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
[INFO] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
[INFO] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[INFO] at java.util.ArrayList.writeObject(ArrayList.java:766)
[INFO] at sun.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[INFO] at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:231)
[INFO] at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[INFO] at com.google.gwt.dev.javac.PersistentUnitCacheDir$OpenFile.writeUnit(PersistentUnitCacheDir.java:373)
[INFO] at com.google.gwt.dev.javac.PersistentUnitCacheDir.writeUnit(PersistentUnitCacheDir.java:194)
[INFO] at com.google.gwt.dev.javac.PersistentUnitCache$BackgroundService$6.run(PersistentUnitCache.java:444)
[INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[INFO] at java.lang.Thread.run(Thread.java:748)

So it occurs when running my GWTTestSuite that is part of my build process.
I guess, it's related to the recent change on GWT head: ba037e1

My Github Actions uses JAVA_HOME: /opt/hostedtoolcache/jdk/8.0.252/x64
I can also reproduce it in local (openjdk version "1.8.0_252").

Screen Shot 2020-04-19 at 5 00 16 PM

@freddyboucher
Copy link
Contributor Author

Downgrading to 2.9.0-RC1 fixed temporary my issue!

@tbroyer
Copy link
Member

tbroyer commented Apr 19, 2020

You must have your own EmulatedCharset that shadows GWT's own version, because that overload was added at the same time as the OutputStreamWriter emulation.

@freddyboucher
Copy link
Contributor Author

@tbroyer Nop I don't have my own EmulatedCharset.

freddyboucher added a commit to freddyboucher/gwt-storage-objectify that referenced this issue Apr 19, 2020
…latedCharset is not applicable for the arguments (char[], int, int)

GWT issue: gwtproject/gwt#9682

Just run: `mvn clean install`

[INFO] --- gwt-maven-plugin:1.0.0:compile (default-compile) @ gwt-storage-objectify-client ---
[INFO] Compiling module com.project.App
[INFO]    Tracing compile failure path for type 'java.io.OutputStreamWriter'
[INFO]       [ERROR] Errors in 'jar:file:/Users/boucfr01/.m2/repository/com/google/gwt/gwt-user/HEAD-SNAPSHOT/gwt-user-HEAD-SNAPSHOT.jar!/com/google/gwt/emul/java/io/OutputStreamWriter.java'
[INFO]          [ERROR] Line 59: The method getBytes(String) in the type EmulatedCharset is not applicable for the arguments (char[], int, int)
[INFO]    [ERROR] Aborting compile due to errors in some input files
[INFO] [ERROR] Error saving compilation unit to cache file: /Users/boucfr01/Private/Programming/gwt-storage-objectify/gwt-storage-objectify-client/target/gwt-unitCache/gwt-unitCache-8eaa4a3840f6593db9b9513ecf167e7513615408-FF35F588CF7564DE259004F02565B00E-000001719216C7D7
[INFO] java.io.IOException: Stream Closed
[INFO]  at java.io.RandomAccessFile.seek0(Native Method)
[INFO]  at java.io.RandomAccessFile.seek(RandomAccessFile.java:557)
[INFO]  at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:161)
[INFO]  at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:73)
[INFO]  at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO]  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
[INFO]  at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
[INFO]  at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:230)
[INFO]  at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO]  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[INFO]  at com.google.gwt.dev.javac.PersistentUnitCacheDir$OpenFile.writeUnit(PersistentUnitCacheDir.java:373)
[INFO]  at com.google.gwt.dev.javac.PersistentUnitCacheDir.writeUnit(PersistentUnitCacheDir.java:194)
[INFO]  at com.google.gwt.dev.javac.PersistentUnitCache$BackgroundService$6.run(PersistentUnitCache.java:444)
[INFO]  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO]  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO]  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[INFO]  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[INFO]  at java.lang.Thread.run(Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for gwt-storage-objectify 0.0.1-SNAPSHOT:
@freddyboucher
Copy link
Contributor Author

@tbroyer
I setup a demo project to reproduce the issue:

  1. checkout branch gwt-9682 https://github.com/freddyboucher/gwt-storage-objectify/commits/gwt-9682
  2. run: mvn clean install

[INFO] --- gwt-maven-plugin:1.0.0:compile (default-compile) @ gwt-storage-objectify-client ---
[INFO] Compiling module com.project.App
[INFO] Tracing compile failure path for type 'java.io.OutputStreamWriter'
[INFO] [ERROR] Errors in 'jar:file:/Users/boucfr01/.m2/repository/com/google/gwt/gwt-user/HEAD-SNAPSHOT/gwt-user-HEAD-SNAPSHOT.jar!/com/google/gwt/emul/java/io/OutputStreamWriter.java'
[INFO] [ERROR] Line 59: The method getBytes(String) in the type EmulatedCharset is not applicable for the arguments (char[], int, int)
[INFO] [ERROR] Aborting compile due to errors in some input files
[INFO] [ERROR] Error saving compilation unit to cache file: /Users/boucfr01/Private/Programming/gwt-storage-objectify/gwt-storage-objectify-client/target/gwt-unitCache/gwt-unitCache-8eaa4a3840f6593db9b9513ecf167e7513615408-FF35F588CF7564DE259004F02565B00E-000001719216C7D7
[INFO] java.io.IOException: Stream Closed
[INFO] at java.io.RandomAccessFile.seek0(Native Method)
[INFO] at java.io.RandomAccessFile.seek(RandomAccessFile.java:557)
[INFO] at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:161)
[INFO] at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:73)
[INFO] at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
[INFO] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
[INFO] at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:230)
[INFO] at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[INFO] at com.google.gwt.dev.javac.PersistentUnitCacheDir$OpenFile.writeUnit(PersistentUnitCacheDir.java:373)
[INFO] at com.google.gwt.dev.javac.PersistentUnitCacheDir.writeUnit(PersistentUnitCacheDir.java:194)
[INFO] at com.google.gwt.dev.javac.PersistentUnitCache$BackgroundService$6.run(PersistentUnitCache.java:444)
[INFO] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[INFO] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[INFO] at java.lang.Thread.run(Thread.java:748)

freddyboucher added a commit to freddyboucher/gwt-storage-objectify that referenced this issue Apr 19, 2020
…latedCharset is not applicable for the arguments (char[], int, int)

GWT issue: gwtproject/gwt#9682

Just run: `mvn clean install`

[INFO] --- gwt-maven-plugin:1.0.0:compile (default-compile) @ gwt-storage-objectify-client ---
[INFO] Compiling module com.project.App
[INFO]    Tracing compile failure path for type 'java.io.OutputStreamWriter'
[INFO]       [ERROR] Errors in 'jar:file:/Users/boucfr01/.m2/repository/com/google/gwt/gwt-user/HEAD-SNAPSHOT/gwt-user-HEAD-SNAPSHOT.jar!/com/google/gwt/emul/java/io/OutputStreamWriter.java'
[INFO]          [ERROR] Line 59: The method getBytes(String) in the type EmulatedCharset is not applicable for the arguments (char[], int, int)
[INFO]    [ERROR] Aborting compile due to errors in some input files
[INFO] [ERROR] Error saving compilation unit to cache file: /Users/boucfr01/Private/Programming/gwt-storage-objectify/gwt-storage-objectify-client/target/gwt-unitCache/gwt-unitCache-8eaa4a3840f6593db9b9513ecf167e7513615408-FF35F588CF7564DE259004F02565B00E-000001719216C7D7
[INFO] java.io.IOException: Stream Closed
[INFO]  at java.io.RandomAccessFile.seek0(Native Method)
[INFO]  at java.io.RandomAccessFile.seek(RandomAccessFile.java:557)
[INFO]  at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:161)
[INFO]  at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:73)
[INFO]  at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO]  at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
[INFO]  at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:441)
[INFO]  at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:230)
[INFO]  at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
[INFO]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO]  at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1154)
[INFO]  at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496)
[INFO]  at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
[INFO]  at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
[INFO]  at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
[INFO]  at com.google.gwt.dev.javac.PersistentUnitCacheDir$OpenFile.writeUnit(PersistentUnitCacheDir.java:373)
[INFO]  at com.google.gwt.dev.javac.PersistentUnitCacheDir.writeUnit(PersistentUnitCacheDir.java:194)
[INFO]  at com.google.gwt.dev.javac.PersistentUnitCache$BackgroundService$6.run(PersistentUnitCache.java:444)
[INFO]  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[INFO]  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO]  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[INFO]  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[INFO]  at java.lang.Thread.run(Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for gwt-storage-objectify 0.0.1-SNAPSHOT:
@tbroyer
Copy link
Member

tbroyer commented Apr 19, 2020

There are 3.5-year-old EmulatedCharset copies in gwt-commons-lang3 and gwt-commons-validator.

@freddyboucher
Copy link
Contributor Author

@tbroyer As always I really appreciated your help!
I opened a gwt-commons-lang3 ticket
Thanks

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

No branches or pull requests

2 participants