B4J Question [Solved] Exception: Cannot invoke "com.sun.prism.Texture.getPixelFormat()"

schimanski

Well-Known Member
Licensed User
Longtime User
Can anyone do something with this error message? It only occurs occasionally and I can't even say where?

B4X:
java.lang.NullPointerException: Cannot invoke "com.sun.prism.Texture.getPixelFormat()" because "<parameter1>" is null
    at javafx.graphics/com.sun.prism.impl.BaseGraphics.drawTexture(BaseGraphics.java:424)
    at javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.drawTexture(BaseShaderGraphics.java:139)
    at javafx.graphics/com.sun.javafx.sg.prism.NGImageView.renderContent(NGImageView.java:123)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
    at javafx.graphics/com.sun.javafx.sg.prism.NGImageView.doRender(NGImageView.java:103)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
    at javafx.graphics/com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:270)
    at javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:579)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2072)
    at javafx.graphics/com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1964)
    at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:480)
    at javafx.graphics/com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:329)
    at javafx.graphics/com.sun.javafx.tk.quantum.UploadingPainter.run(UploadingPainter.java:143)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
    at javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
    at java.base/java.lang.Thread.run(Thread.java:1589)
 

stevel05

Expert
Licensed User
Longtime User
You could help by giving some more information. Which OS, Java Version, Which Libraries are you using? Or better still post a small project that produces the error. I realize you said it doesn't happen all of the time, the first thing I would do would be to try and find out what user actions cause it.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Thank you for your answer. I actually have no idea where to look. The problem occurs when I send the image to an extended desktop with a very high resolution of 10100x2160 pixels (3 projectors with edge blending).
I was hoping to find a clue. When the error occurs, the image is not transferred to the extended desktop. The application continues to run, but without displaying the screen.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Have you checked the image is valid? Maybe load it into a graphics app and check it has all the correct meta data.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Sorry, then I expressed myself incorrectly. It is not just one image that is being swapped out. It is always a complete layout of many, each with numerous views. It seems as if it occurs after multiple repetitions. So switching between different layouts on the extended desktop. After restarting the application, the layout that last caused the error will run again.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Thank you very much, i will try and call back.
One last question: After finishing a layout, I don't need the respective cancas objects anymore. Can I perhaps delete them from the vram again?
 
Upvote 0
Top