leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
455 stars 21 forks source link

Uncaught ReferenceError: _c4_cAiaWcGU0mons2io7IOUtils8togeVWEU is not defined #67

Closed rbanks721 closed 5 years ago

rbanks721 commented 5 years ago

I keep getting the following error in the console.log. I see the commons-io-2.6.jar is loaded and I am thinking it is not loading the java.nio. & java.net. classes because they are not in the cheerpj runtime rt.jar. I compiled my own rt.jar with the classed but still get the error. Any ideas?

Uncaught ReferenceError: _c4_cAiaWcGU0mons2io7IOUtils8togeVWEU is not defined at Object.eval [as func] (eval at buildContinuations (loader.js:116), :3:147) at runContinuationStack (loader.js:383) at cheerpjSchedule (loader.js:1052) at HTMLScriptElement.classLoadComplete (loader.js:168)

alexp-sssup commented 5 years ago

The CheerpJ runtime includes all java.nio. and java.net.. You need to pass commons-io-2.6.jar and all other dependency JARs to the --deps command line of cheerpjfy.py. For an example see here: https://github.com/leaningtech/cheerpj-meta/wiki/Getting-Started#converting-multiple-jars-to-jarjss-files

rbanks721 commented 5 years ago

Yes, I did this and commons-io-2.6.jar compiles with no errors but when I run in browser I get the error. I see ,"/lt/runtime/rt.jar.java.net.js","/lt/runtime/rt.jar.java.nio.file.js" are included in the cheerpjInit({preloadResources:preloadList}) now but still getting the error in the browser.

On Wed, Apr 17, 2019 at 4:39 AM Alessandro Pignotti < notifications@github.com> wrote:

The CheerpJ runtime includes all java.nio. and java.net.. You need to pass commons-io-2.6.jar and all other dependency JARs to the --deps command line of cheerpjfy.py. For an example see here: https://github.com/leaningtech/cheerpj-meta/wiki/Getting-Started#converting-multiple-jars-to-jarjss-files

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/leaningtech/cheerpj-meta/issues/67#issuecomment-483992591, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC2rgZYyvMZ7Gw0aSCblaU2LNrV5Zx0ks5vht2wgaJpZM4c0DpK .

alexp-sssup commented 5 years ago

What that error means is that the AOT compiler cannot resolve a method. You see what method is problematic by running cheerpjDecompressSymbol("c4_cAiaWcGU0mons2io7IOUtils8togeVWEU") from the command line. Please note that the first '_' should be removed from the name to see the decompressed version.

In this case the method is ZN3org6apache7commons2io7IOUtils8toStringEU (or org.apache.commons.io.IOUtils.toString) The U at the end means that the compiler could not find that method (or the specific signature being used).

I believe the problem is caused by not passing the proper arguments to cheerpjfy.py. Can you post here the full commands you are using (for all the JARs)?

rbanks721 commented 5 years ago

Yes, please see below:

../../cheerpjfy.py animal-sniffer-annotations-1.14.jar ../../cheerpjfy.py error_prone_annotations-2.1.3.jar ../../cheerpjfy.py gson-2.8.5.jar ../../cheerpjfy.py guava-26.0-jre.jar ../../cheerpjfy.py j2objc-annotations-1.1.jar ../../cheerpjfy.py jsr305-3.0.2.jar ../../cheerpjfy.py --deps=gson-2.8.5.jar org.eclipse.lsp4j.jsonrpc-0.7.0.jar ../../cheerpjfy.py --deps=gson-2.8.5.jar:org.eclipse.lsp4j.jsonrpc-0.7.0.jar org.eclipse.lsp4j-0.7.0.jar ../../cheerpjfy.py --deps=guava-26.0-jre.jar:org.eclipse.xtend.lib-2.16.0.jar:org.eclipse.lsp4j.jsonrpc-0.7.0.jar:org.eclipse.xtend.lib-2.16.0.jar:org.eclipse.xtend.lib.macro-2.16.0.jar:org.eclipse.xtext.xbase.lib-2.16.0.jar org.eclipse.lsp4j.generator-0.7.0.jar ../../cheerpjfy.py --deps=org.eclipse.xtend.lib.macro-2.16.0.jar:org.eclipse.xtext.xbase.lib-2.16.0.jar org.eclipse.xtend.lib-2.16.0.jar ../../cheerpjfy.py org.eclipse.xtend.lib.macro-2.16.0.jar ../../cheerpjfy.py org.eclipse.xtext.xbase.lib-2.16.0.jar ../../cheerpjfy.py hamcrest-2.1.jar ../../cheerpjfy.py hamcrest-core-2.1.jar ../../cheerpjfy.py antlr-runtime-3.5.2.jar ../../cheerpjfy.py --deps=guava-26.0-jre.jar guice-4.2.0-no_aop.jar ../../cheerpjfy.py javax.inject-1.jar ../../cheerpjfy.py slf4j-api-1.7.25.jar ../../cheerpjfy.py --deps=slf4j-api-1.7.25.jar:javax.inject-1.jar:guice-4.2.0-no_aop.jar:antlr-runtime-3.5.2.jar:hamcrest-2.1.jar:hamcrest-2.1.jar:antlr-runtime-3.5.2.jar:compatibility-3.2.100-v20070502.jar:app-1.3.200-v20130910-1609.jar:common-3.6.200-v20130402-1505.jar:compatibility-3.1.200-v20070502.jar:configurator-3.2.100-v20070615.jar:contenttype-3.4.200-v20140207-1251.jar:jobs-3.6.0-v20140424-0053.jar:osgi-3.10.0-v20140606-1445.jar:preferences-3.5.200-v20140224-1527.jar:registry-3.5.400-v20140428-1507.jar:runtime-3.10.0-v20140318-2214.jar:org.eclipse.core.commands-3.9.300.jar:org.eclipse.core.contenttype-3.7.300.jar:org.eclipse.core.expressions-3.6.300.jar:org.eclipse.core.filesystem-1.7.300.jar:org.eclipse.core.jobs-3.10.300.jar:org.eclipse.core.resources-3.13.300.jar:org.eclipse.core.runtime-3.15.200.jar:org.eclipse.equinox.app-1.4.100.jar:org.eclipse.equinox.common-3.10.300.jar:org.eclipse.equinox.preferences-3.7.300.jar:org.eclipse.equinox.registry-3.8.300.jar:org.eclipse.jdt.core-3.17.0.jar:org.eclipse.osgi-3.13.300.jar:org.eclipse.text-3.8.100.jar:animal-sniffer-annotations-1.14.jar:error_prone_annotations-2.1.3.jar:gson-2.8.5.jar:guava-26.0-jre.jar:j2objc-annotations-1.1.jar:jsr305-3.0.2.jar:org.eclipse.lsp4j-0.7.0.jar:org.eclipse.lsp4j.generator-0.7.0.jar:org.eclipse.lsp4j.jsonrpc-0.7.0.jar:org.eclipse.xtend.lib-2.16.0.jar:org.eclipse.xtend.lib.macro-2.16.0.jar:org.eclipse.xtext.xbase.lib-2.16.0.jar apex-jorje-lsp-minimized-2019-01-18-a041d7.jar ../../cheerpjfy.py compatibility-3.2.100-v20070502.jar ../../cheerpjfy.py aspectjtools-1.9.3.jar ../../cheerpjfy.py contenttype-3.4.200-v20140207-1251.jar ../../cheerpjfy.py jobs-3.6.0-v20140424-0053.jar ../../cheerpjfy.py org.eclipse.core.expressions-3.6.300.jar ../../cheerpjfy.py org.eclipse.core.filesystem-1.7.300.jar ../../cheerpjfy.py org.eclipse.core.jobs-3.10.300.jar ../../cheerpjfy.py org.eclipse.core.resources-3.13.300.jar ../../cheerpjfy.py org.eclipse.equinox.common-3.10.300.jar ../../cheerpjfy.py org.eclipse.osgi-3.13.300.jar ../../cheerpjfy.py org.eclipse.equinox.preferences-3.7.300.jar ../../cheerpjfy.py org.eclipse.equinox.app-1.4.100.jar ../../cheerpjfy.py --deps=org.eclipse.equinox.app-1.4.100.jar:org.eclipse.equinox.preferences-3.7.300.jar:org.eclipse.equinox.common-3.10.300.jar:org.eclipse.osgi-3.13.300.jar org.eclipse.core.runtime-3.15.200.jar ../../cheerpjfy.py org.eclipse.equinox.registry-3.8.300.jar ../../cheerpjfy.py org.eclipse.core.commands-3.9.300.jar ../../cheerpjfy.py --deps=org.eclipse.core.commands-3.9.300.jar:org.eclipse.core.runtime-3.15.200.jar org.eclipse.text-3.8.100.jar ../../cheerpjfy.py org.eclipse.core.contenttype-3.7.300.jar ../../cheerpjfy.py --deps=org.eclipse.core.contenttype-3.7.300.jar:org.eclipse.equinox.registry-3.8.300.jar:org.eclipse.equinox.common-3.10.300.jar:org.eclipse.core.filesystem-1.7.300.jar:org.eclipse.osgi-3.13.300.jar:org.eclipse.text-3.8.100.jar:org.eclipse.core.runtime-3.15.200.jar:org.eclipse.core.resources-3.13.300.jar org.eclipse.jdt.core-3.17.0.jar ../../cheerpjfy.py preferences-3.5.200-v20140224-1527.jar ../../cheerpjfy.py registry-3.5.400-v20140428-1507.jar ../../cheerpjfy.py commons-io-2.6.jar ../../cheerpjfy.py --deps=apex-jorje-lsp-minimized-2019-01-18-a041d7.jar:pmd-apex-6.14.0-SNAPSHOT.jar:pmd-apex-jorje-6.14.0-SNAPSHOT-lib.jar:pmd-core-6.14.0-SNAPSHOT.jar HelloWorld.jar

On Wed, Apr 17, 2019 at 6:44 AM Alessandro Pignotti < notifications@github.com> wrote:

What that error means is that the AOT compiler cannot resolve a method. You see what method is problematic by running cheerpjDecompressSymbol("c4cAiaWcGU0mons2io7IOUtils8togeVWEU") from the command line. Please note that the first '' should be removed from the name to see the decompressed version.

In this case the method is ZN3org6apache7commons2io7IOUtils8toStringEU (or org.apache.commons.io.IOUtils.toString) The U at the end means that the compiler could not find a method that method (including the specific signature being used).

I believe the problem is caused by not passing the proper arguments to cheerpjfy.py. Can you post here the full commands you are using (for all the JARs)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/leaningtech/cheerpj-meta/issues/67#issuecomment-484032883, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC2rqCDZttWKoZTzTih3yESO0qLzZwTks5vhvsQgaJpZM4c0DpK .

rbanks721 commented 5 years ago

This is my cheerpjRunMain:

cheerpjRunMain("example.Main", "HelloWorld.jar:animal-sniffer-annotations-1.14.jar:ant-1.10.1.jar:ant-launcher-1.10.1.jar:antlr-2.7.7.jar:antlr-runtime-3.5.2.jar:antlr4-runtime-4.7.jar:aopalliance-1.0.jar:apex-jorje-lsp-minimized-2019-01-18-a041d7.jar:asm-7.1.jar:cglib-3.2.0.jar:checker-qual-2.5.2.jar:commons-beanutils-core-1.8.3.jar:commons-io-2.6.jar:commons-lang3-3.8.1.jar:commons-logging-1.1.1.jar:compatibility-3.2.100-v20070502.jar:controlsfx-8.40.13.jar:error_prone_annotations-2.1.3.jar:flowless-0.6.jar:groovy-2.4.7.jar:gson-2.8.5.jar:guava-26.0-jre.jar:guice-4.2.0-no_aop.jar:hamcrest-2.1.jar:hamcrest-core-2.1.jar:ikonli-core-2.3.0.jar:ikonli-fontawesome5-pack-2.3.0.jar:ikonli-javafx-2.3.0.jar:j2objc-annotations-1.1.jar:javacc-5.0.jar:javax.inject-1.jar:jcommander-1.72.jar:jol-core-0.4.jar:jsr305-3.0.2.jar:logback-classic-1.1.7.jar:logback-core-1.1.7.jar:org.eclipse.lsp4j-0.7.0.jar:org.eclipse.lsp4j.generator-0.7.0.jar:org.eclipse.lsp4j.jsonrpc-0.7.0.jar:org.eclipse.xtend.lib-2.16.0.jar:org.eclipse.xtend.lib.macro-2.16.0.jar:org.eclipse.xtext.xbase.lib-2.16.0.jar:pmd-apex-6.14.0-SNAPSHOT.jar:pmd-apex-jorje-6.14.0-SNAPSHOT-lib.jar:pmd-core-6.14.0-SNAPSHOT.jar:pmd-cpp-6.14.0-SNAPSHOT.jar:pmd-cs-6.14.0-SNAPSHOT.jar:pmd-fortran-6.14.0-SNAPSHOT.jar:pmd-go-6.14.0-SNAPSHOT.jar:pmd-groovy-6.14.0-SNAPSHOT.jar:pmd-java-6.14.0-SNAPSHOT.jar:pmd-javascript-6.14.0-SNAPSHOT.jar:pmd-jsp-6.14.0-SNAPSHOT.jar:pmd-kotlin-6.14.0-SNAPSHOT.jar:pmd-matlab-6.14.0-SNAPSHOT.jar:pmd-objectivec-6.14.0-SNAPSHOT.jar:pmd-perl-6.14.0-SNAPSHOT.jar:pmd-php-6.14.0-SNAPSHOT.jar:pmd-plsql-6.14.0-SNAPSHOT.jar:pmd-python-6.14.0-SNAPSHOT.jar:pmd-ruby-6.14.0-SNAPSHOT.jar:pmd-scala-6.14.0-SNAPSHOT.jar:pmd-swift-6.14.0-SNAPSHOT.jar:pmd-ui-6.12.0.jar:pmd-visualforce-6.14.0-SNAPSHOT.jar:pmd-vm-6.14.0-SNAPSHOT.jar:pmd-xml-6.14.0-SNAPSHOT.jar:reactfx-2.0-M5.jar:rhino-1.7.7.2.jar:richtextfx-0.9.2.jar:saxon-9.1.0.8-dom.jar:saxon-9.1.0.8.jar:scala-compiler-2.12.4.jar:scala-library-2.12.4.jar:scala-reflect-2.12.4.jar:scala-xml_2.12-1.0.6.jar:slf4j-api-1.7.25.jar:snakeyaml-1.17.jar:stringtemplate-3.2.1.jar:undofx-2.1.0.jar:wellbehavedfx-0.3.3.jar:org.eclipse.core.contenttype-3.7.300.jar:org.eclipse.equinox.registry-3.8.300.jar:org.eclipse.equinox.common-3.10.300.jar:org.eclipse.core.filesystem-1.7.300.jar:org.eclipse.osgi-3.13.300.jar:org.eclipse.text-3.8.100.jar:org.eclipse.core.runtime-3.15.200.jar:org.eclipse.core.resources-3.13.300.jar:org.eclipse.jdt.core-3.17.0.jar:org.eclipse.core.commands-3.9.300.jar").then(function(){})

On Wed, Apr 17, 2019 at 6:44 AM Alessandro Pignotti < notifications@github.com> wrote:

What that error means is that the AOT compiler cannot resolve a method. You see what method is problematic by running cheerpjDecompressSymbol("c4cAiaWcGU0mons2io7IOUtils8togeVWEU") from the command line. Please note that the first '' should be removed from the name to see the decompressed version.

In this case the method is ZN3org6apache7commons2io7IOUtils8toStringEU (or org.apache.commons.io.IOUtils.toString) The U at the end means that the compiler could not find a method that method (including the specific signature being used).

I believe the problem is caused by not passing the proper arguments to cheerpjfy.py. Can you post here the full commands you are using (for all the JARs)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/leaningtech/cheerpj-meta/issues/67#issuecomment-484032883, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC2rqCDZttWKoZTzTih3yESO0qLzZwTks5vhvsQgaJpZM4c0DpK .

alexp-sssup commented 5 years ago

It is much simpler and safer to list all JARs as deps for every JAR. We advise exactly that in our wiki: https://github.com/leaningtech/cheerpj-meta/wiki/Getting-Started#converting-multiple-jars-to-jarjss-files

Most probably there is another user of commons-io-2.6.jar in all these deps.

alexp-sssup commented 5 years ago

There is another possibility. I see that you are using the eclipse framework here. That might not work since it used some weird non-standard class loader tricks. We recommend to avoid the use of that framework if you can.

We are soon going to release CheerpJ 1.4 which includes experimental support for these features (enabled with a special initialization flag).