Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    metelmann
    @metelmann
    This is from the loading timeline: after the jar (the first file from my server beside the inital html) the error happens before there are any other dependencies loaded.
    metelmann
    @metelmann
    Ok, after all the other jars, the commons-httpclient-3.1.jar.js is the next .js files loaded - similar for the other 404's, so I guess they get loaded when the file is missing? So I guess this is maybe not the problem. I still get stuck at "Jar is loaded, main is starting" and in the Console is now this error:
    Bildschirmfoto 2021-02-21 um 17.56.00.png
    And this is how it looks in Chrome:
    Bildschirmfoto 2021-02-21 um 18.00.20.png
    Alessandro Pignotti
    @alexp-sssup
    @metelmann It seems that an excessively large array is being allocated, but I have no way of giving you a better explanation without being able to see the application. If you can publish the example on a publicly accessible website one of our engineering might be able to take a look over the next days.
    metelmann
    @metelmann
    @alexp-sssup Thank you for your effort.
    This is the Java program: https://www.lernsoftware-filius.de/downloads/Setup/filius-1.11.0.zip
    This is the gitlab site with the source code: https://gitlab.com/filius1/filius
    And this is a link to my try running it with Cheerpj: https://theokoch.schule/filius.html
    metelmann
    @metelmann
    The above application running on the webserver as a zip: https://theokoch.schule/filius.zip
    metelmann
    @metelmann
    If I start in verbose mode I can see that line 85 https://gitlab.com/filius1/filius/-/blob/master/src/main/java/filius/Main.java#L85 is executed and line 169 is not. So it should be happening between those lines.
    Brian G.
    @gissf1
    I'm trying to test out the CheerpJ chrome extension, but no matter what java applet tries to load, it always stays at the spinning CheerpJ page. When loading the https://javafiddle.leaningtech.com/ test, it spins and says "CheerpJ is Initializing" but never proceeds. When opening the Chrome console, it shows the initializing message followed by "RangeError: WebAssembly.instantiate(): Out of memory: wasm memory". I was wondering how I might find more information to debug where it is breaking down?
    Lorenzo
    @marsicplusplus
    Hi @gissf1, I've answered on the issue you have opened on github. The page you have linked has the applet runner embedded in it and you should disable the chrome extension (left click on our icon, disable) to be able to run the application
    metelmann
    @metelmann
    Hi again. I compiled the program myself in one single .jar and it is working :) Thanks for your help! Now I just need to make it a little more touch friendly.
    sireenk
    @sireenk
    hi
    I hava application with data base and when use cheerpj I had error with mysql connectoe library
    Using legacy codegen for com/mysql/cj/x/protobuf/Mysqlx$ClientMessages$1.class
    compiling com/mysql/cj/x/protobuf/Mysqlx$ClientMessages$Builder.class ...
    Failure compiling com/mysql/cj/x/protobuf/Mysqlx$ClientMessages$Builder.class
    command: "C:\Users\sireen sulieman\Documents\cheerpj_2.1\bin\cheerpj" "" -llvm -llvm-exceptions -cp C:\Users\SIREEN~1\AppData\Local\Temp\tmpeduo46kp\rt.jar.dir\ com/mysql/cj/x/protobuf/Mysqlx$ClientMessages$Builder.class
    Loading class com/mysql/cj/x/protobuf/Mysqlx$ClientMessages$Builder and dependencies
    Could not open class com/google/protobuf/AbstractMessage
    Could not open class com/google/protobuf/AbstractMessage$Builder
    Could not open class com/google/protobuf/AbstractMessageLite
    Could not open class com/google/protobuf/AbstractMessageLite$Builder
    Could not open class com/google/protobuf/CodedInputStream
    Alessandro Pignotti
    @alexp-sssup
    @sireenk A few things I can notice
    1) The JAR you are compiling depends on google protobug, but those classes are not provided. You need to get the right JAR for that and use the --deps option of cheerpjfy.py to use it.
    2) In general compile time failures are not necessarily critical. It may well be that the classes which fail due to missing dependencies are not truly used at runtime.
    3) If you need to connect to a mysql DB most likely you need non-HTTP networking, which is something that is not supported by browsers. CheerpJ can only support what is supported b the browser platform. If you need this feature for an enterprise app we can help you find a solution, please get in touch info@leaningtech.com
    sireenk
    @sireenk
    @alexp-sssup how can I connect to a mysql DB by non-HTTP networking
    sireenk
    @sireenk
    @alexp-sssup please check your email
    sireenk
    @sireenk
    Capture.PNG
    Alessandro Pignotti
    @alexp-sssup
    @sireenk Our team will get back to you as soon as possible
    Zachary Whitley
    @zacharywhitley
    Is there any documentation on the new wasm support in CheerpJ?
    Alessandro Pignotti
    @alexp-sssup
    @zacharywhitley CheerpJ uses wasm automatically for some components of the runtime, nothing needs to be done on the user side
    Gaspar Tripodi
    @gaspartrip

    Hi! Maybe you can help me. I followed the guide in "Getting Started" and I am using the following script:

    • cheerpjInit();
    • cheerpjCreateDisplay(1366,768);
    • cheerpjRunMain("mainInt.mainFrame", "/app/videogame.jar:/app/jgoodies-forms-1.8.0.jar:/app/java-json.jar");

    I managed to open my JAVA application in localhost: 8080, even a button from the UI appears, but when click it and enter another section of the app, nothing happens and the following messages appear in the console:

    It seems that there are missing libraries to load. Is there any way to fix it? They seem to be JAVA base libraries. Any ideas? Thanks!

    Lorenzo
    @marsicplusplus
    Hi @gaspartrip.
    Could you share the application and the folder setup with us so that we can help you debug it?
    Gaspar Tripodi
    @gaspartrip
    @marsicplusplus Hi! I was finally able to run the app by removing the sounds from it. The problem appears with the following imports:
    import javax.sound.sampled.AudioInputStream;
    import javax.sound.sampled.AudioSystem;
    import javax.sound.sampled.Clip;
    import javax.sound.sampled.FloatControl;
    Maybe they are not compatible with cheerpj?
    Files: https://easyupload.io/gldkrn
    Lorenzo
    @marsicplusplus
    @gaspartrip could you send us the version with the audio on?
    Gaspar Tripodi
    @gaspartrip
    @marsicplusplus https://easyupload.io/roc1l4 here is the version with the audio! Thx!
    Lorenzo
    @marsicplusplus
    Hi @gaspartrip, it seems that the issue with the sound has already been fixed in our runtime.
    You will need to wait for our next release of CheerpJ to be able to use sound in your java application without issues.
    Gaspar Tripodi
    @gaspartrip
    @marsicplusplus Great! Thanks for the help and congratulations on the compiler, it's great!
    Chengxu Yang
    @lh-ycx
    Hi, I'm trying to use CheerpJ to convert TextDemo.jar to a WebAssembly. But I did not find a document about how should I do. Also, according to the historical discussion, it seems that this feature has not been released because WebAssembly is not a suitable target for Java at this point.
    Could you please tell me how to try this feature? Or is it a detailed document for java to WebAssembly? Thanks a lot : )
    Alessandro Pignotti
    @alexp-sssup
    @lh-ycx CheerpJ uses WebAssembly internally for some component of the runtime. There is nothing to activate on your side. Pure WebAssembly codegen is currently not efficient given the limitations of the WebAssembly standard. JavaScript codegen is already sufficiently efficient anyway.
    Chengxu Yang
    @lh-ycx
    @alexp-sssup Thanks a lot! I'm a new gamer for WebAssembly. Do you know if there is any tool that could achieve my goal, i.e., converting JAVA to WebAssenbly?
    dr-kraus
    @dr-kraus
    Hello, I'm new here. I started using CheerpJ to convert a very old Java applet that some people still want to use, see livegraphics3d.org . So far, it appears to work fine with the exception of calling public functions of the applet from HTML. In the past, there where browser-specific ways of calling public Java functions of applets from JavaScript/HTML and I supported that by defining (and documenting) some public functions in the applet such that people could control the applet via JavaScript/HTML. What is the recommended way to achieve this with the code compiled by CheerpJ?
    Alessandro Pignotti
    @alexp-sssup
    @dr-kraus Calling applet methods from JS is partially supported, please consider using the cjCall APIs documented here: https://github.com/leaningtech/cheerpj-meta/wiki/Runtime-API
    dr-kraus
    @dr-kraus
    @alexp-sssup thanks! i'll give it a try when i've upgraded the rest of the applet documentation. btw, i'm really impressed how well CheerpJ is working!
    Alessandro Pignotti
    @alexp-sssup
    @dr-kraus Thank you for your kind words, much appreciated
    dr-kraus
    @dr-kraus
    @alexp-sssup cjCall requires a Java class object; how do I get that when the HTML page creates the applet? Is it the object that I get with document.getElementById()?
    Alessandro Pignotti
    @alexp-sssup
    @dr-kraus No, that is the HTML side <object> tag and does not correspond to the Java object. You need to get the object separately, for example by using a static method
    dr-kraus
    @dr-kraus
    @alexp-sssup Thanks. So, that would require me to change the Java code of the applet, right? Also, I'm not sure how to do that: in my case, it is common that there are multiple applets of the same class on a single HTML page, thus, how could a static function return the object for a specific instance of the applet?
    Alessandro Pignotti
    @alexp-sssup
    There is truly no nice way if that's your setup, the best solution would be properly implement calls from JavaScript into Java, but currently we don't have commercial demand for this feature
    In reality, the calls work, but they return promises
    Since blocking code cannot be implemented in the browser main thread
    and Java code can potentially do arbitrary computation including blocking before returning a result
    You may be able to simply adapt your code to use async await on the JavaScript side
    dr-kraus
    @dr-kraus
    OK; I think I'll wait whether any of the users of my applet want to use that functionality (I know that some did 10 years ago, but they might not be interested in it any more). Thanks again!
    dr-kraus
    @dr-kraus
    Another question: is the method AppletContext.getApplets() (see https://docs.oracle.com/javase/7/docs/api/java/applet/AppletContext.html ) supported by CheerpJ?
    Alessandro Pignotti
    @alexp-sssup
    No, it's not
    dr-kraus
    @dr-kraus
    @alexp-sssup thanks for the quick reply!