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

properties of undefined .isWrapped error #80

Open
ElTankesitoArceus opened this issue May 17, 2023 · 7 comments
Open

properties of undefined .isWrapped error #80

ElTankesitoArceus opened this issue May 17, 2023 · 7 comments
Labels
bug Something isn't working waiting for author

Comments

@ElTankesitoArceus
Copy link

Im trying to use XTerm as a console for a minecraft server, and every time I get this error after 20 lines or so
image

Uncaught TypeError: Cannot set properties of undefined (setting 'isWrapped') (http://localhost:8080/VAADIN/build/generated-flow-imports-4b12332d.js:16123:3143)

Mi XTerm variable looks like this

    terminal = new XTerm(); 
    terminal.setCursorBlink(true);
    terminal.setCursorStyle(CursorStyle.UNDERLINE);
    terminal.setCopySelection(true);
    terminal.setUseSystemClipboard(UseSystemClipboard.READWRITE);
    terminal.setPasteWithRightClick(true);
    terminal.setFitOnResize(true);
    terminal.setRendererType(RendererType.CANVAS);
    terminal.setHeightFull();
    terminal.setWidthFull();
    terminal.setSizeFull();
    TerminalHistory.extend(terminal);

And for writing lines I use

     for (String line = serverInput.readLine(); line != null; line = serverInput.readLine()) {
           // System.out.println(line);
            terminal.writeln(line);
            terminal.scrollToBottom();
            ui.push();
      }

In this case im trying to run a velocity server with a ProcessBuilder in a separate thread (the serverInput variable im using is the Buffered Reader of the process)

The line it strarts givin the error at is
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:579) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
With is part of an Address already in use: bind error caused by the port allready being used, witch im specting when running the JAR.

@javier-godoy
Copy link
Member

Hello. Did you add the com.flowingcode package to the whitelist?

By default, Vaadin Flow only includes com/vaadin/flow/component to be always scanned for UI components and views. For this reason, the addon might need to be whitelisted in order to display correctly.

To do so, just add com.flowingcode to the vaadin.whitelisted-packages property in src/main/resources/application.properties, like:

vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.flowingcode

More information on Spring whitelisted configuration here.

@ElTankesitoArceus
Copy link
Author

@javier-godoy yes, I did

@javier-godoy
Copy link
Member

Which version of Vaadin and which version of the add-on are you using?

@ElTankesitoArceus
Copy link
Author

Vaadin V24, xterm-console addon 2.1.1, running with java 17

@javier-godoy
Copy link
Member

We had just released 2.2.0, which may have a different behavior (it upgrades the version of xterm.js) although it has no direct fix for this issue.

Based on the error message, I think the issue likely related to the following line (which is a workaround for #70)

If the error persists with 2.2.0, please let me know if you have some reproducible example of that issue (perhaps it's related to writing a lot of lines at once, or writing long lines) or if you are willing to try some snapshot version with enhanced logs. That fragment of code is rather fragile, and there may be some corner case that is not covered by the integration tests.

@javier-godoy javier-godoy added the bug Something isn't working label May 17, 2023
@ElTankesitoArceus
Copy link
Author

I upgraded to 2.2.0 and the error still persists.

Also, i was accesing the web using chrome, but trying firefox I get a different error:
image
TypeError: te is undefined (http://localhost:8080/VAADIN/build/generated-flow-imports-ce79c564.js:16125:3133)

If you want to reproduce the error, this is the spected output:

WARN StatusConsoleListener Advanced terminal features are not available in this environment

ERROR StatusConsoleListener Unable to delete file C:\Users\aramosm\Documents\server\logs\latest.log: java.nio.file.FileSystemException C:\Users\aramosm\Documents\server\logs\latest.log: El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso

[09:12:20 INFO]: Booting up Velocity 3.2.0-SNAPSHOT (git-7f776abf-b252)...

[09:12:20 INFO]: Loading localizations...

[09:12:21 INFO]: Connections will use NIO channels, Java compression, Java ciphers

[09:12:21 WARN]: Player info forwarding is disabled! All players will appear to be connecting from the proxy and will have offline-mode UUIDs.

[09:12:21 INFO]: Loading plugins...

[09:12:21 INFO]: Loaded 0 plugins

[09:12:21 INFO]: Done (1,54s)!

[09:12:21 ERROR]: Can't bind to /0.0.0.0:25577
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:555) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:141) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:600) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:579) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]   
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT 
(git-7f776abf-b252)]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]      
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[paper-1.19.4.jar:3.2.0-SNAPSHOT (git-7f776abf-b252)]
        at java.lang.Thread.run(Thread.java:833) [?:?]

And it is able to write this before it starts giving the error every time you attempt to write another line:

WARN StatusConsoleListener Advanced terminal features are not available in this environment

ERROR StatusConsoleListener Unable to delete file C:\Users\aramosm\Documents\server\logs\latest.log: java.nio.file.FileSystemException C:\Users\aramosm\Documents\server\logs\latest.log: El proceso no tiene acceso al archivo porque está siendo utilizado por otro proceso

[09:12:20 INFO]: Booting up Velocity 3.2.0-SNAPSHOT (git-7f776abf-b252)...

[09:12:20 INFO]: Loading localizations...

[09:12:21 INFO]: Connections will use NIO channels, Java compression, Java ciphers

[09:12:21 WARN]: Player info forwarding is disabled! All players will appear to be connecting from the proxy and will have offline-mode UUIDs.

[09:12:21 INFO]: Loading plugins...

[09:12:21 INFO]: Loaded 0 plugins

[09:12:21 INFO]: Done (1,54s)!

[09:12:21 ERROR]: Can't bind to /0.0.0.0:25577
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:555) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:337) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:294) ~[?:?]

You can also run the Velocity server jar, a minecraft server proxy, on a separate thread and redirect the output to the console.

Im writing using this in a separate thread:

 int num = inputStream.available();
 if (num > 0) {
    int n = inputStream.read(buffer, 0, Math.min(num, buffer.length));
    String line = new String(buffer, 0, n);
    System.out.println(line);
    final String out = line;
    ui.access(() -> {
        terminal.writeln(out);
        terminal.scrollToBottom();
        ui.push();
    });
}

Also, I first tried getting the output from the process with a BufferedReader and .readLine(), but it enters on an infinite loop, probably because the process waits for input.

@mlopezFC
Copy link
Member

Can you supply a complete sample project that is able to reproduce the issue easily? What we would need is something like a zip file with a project that you download, unzip and start the application and then some simple steps to reproduce the problem. Thanks!

@paodb paodb moved this to Under consideration in Flowing Code Addons May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for author
Projects
Status: Under consideration
Development

No branches or pull requests

3 participants