[External] : Re: Eclipse: ClassNotFoundException: com.sun.prism.shader.FillPgram_Color_Loader
Nir Lisker
nlisker at gmail.com
Sat Jul 16 00:07:43 UTC 2022
I'm using 4.24 and I didn't touch the build options. Possibly Eclipse works
differently on different platforms, but that would be a bug.
[image: image.png][image: image.png]
I have no folder and the project builds fine. I might need to test on Linux.
On Sat, Jul 16, 2022 at 1:42 AM Andy Goryachev <andy.goryachev at oracle.com>
wrote:
> Nir:
>
>
>
> Which version of eclipse are you on?
>
>
>
> I've added your entry and my Eclipse (2022-06 4.24.0 on Mac) complains
> about
>
>
>
> Project 'graphics' is missing required source folder: 'build/hi' Build
> path graphics
>
>
>
> It does not allow to ignore this problem, as the only choices are "error"
> and "warning":
>
>
>
>
>
>
>
>
>
> What is the fear of modifying the build.gradle?
>
>
>
> -a
>
>
>
>
>
> *From: *Nir Lisker <nlisker at gmail.com>
> *Date: *Friday, 2022/07/15 at 15:33
> *To: *Andy Goryachev <andy.goryachev at oracle.com>
> *Cc: *Jeanette Winzenburg <fastegal at swingempire.de>, Kevin Rushforth <
> kevin.rushforth at oracle.com>, openjfx-dev at openjdk.org <
> openjfx-dev at openjdk.org>
> *Subject: *Re: [External] : Re: Eclipse: ClassNotFoundException:
> com.sun.prism.shader.FillPgram_Color_Loader
>
>
> 1. Unfortunately, even with ”ignore optional problems” Eclipse
> generates the “missing required source folder”.
>
>
>
> I added the following to the classpath of graphics:
>
>
>
> <classpathentry kind="src" path="build/hi">
> <attributes>
> <attribute name="ignore_optional_problems" value="true"/>
> </attributes>
>
> </classpathentry>
>
>
>
> Eclipse adds the non-existent source folder even though there is no such
> directory and does not complain. We should be able to revert the changes
> done to the graphics classpath file and then add the other
> platform-specific entries.
>
> Worst case, we could generate an empty folder, but that would require
> changing the build, which is not the best approach.
>
>
>
> I also managed to reproduce the runtime error by using an application that
> uses fonts. If you know what the Mac/Linux-specific folders are, I will add
> them to my classpath and see if everything works for me.
>
>
>
> On Fri, Jul 15, 2022 at 10:34 PM Nir Lisker <nlisker at gmail.com> wrote:
>
> Ah, I missed that it's during runtime. When I reviewed the PR I tested an
> external project which relies on the graphics module and it worked fine. I
> will try to find a case that throws this error and see what can be done.
>
>
>
> On Fri, Jul 15, 2022 at 9:22 PM Andy Goryachev <andy.goryachev at oracle.com>
> wrote:
>
> Nir:
>
>
>
> 1. Unfortunately, even with ”ignore optional problems” Eclipse
> generates the “missing required source folder”. Below are the four entries
> I’ve added to modules/javafx.graphics/.classpath:
>
>
>
> <classpathentry kind="src" path="build/hlsl/Prism">
>
> <attributes>
>
> <attribute name="ignore_optional_problems"
> value="true"/>
>
> </attributes>
>
> </classpathentry>
>
> <classpathentry kind="src" path="build/gensrc/jsl-prism">
>
> <attributes>
>
> <attribute name="ignore_optional_problems"
> value="true"/>
>
> </attributes>
>
> </classpathentry>
>
> <classpathentry kind="src" path="build/hlsl/Decora">
>
> <attributes>
>
> <attribute name="ignore_optional_problems"
> value="true"/>
>
> </attributes>
>
> </classpathentry>
>
> <classpathentry kind="src" path="build/gensrc/jsl-decora">
>
> <attributes>
>
> <attribute name="ignore_optional_problems"
> value="true"/>
>
> </attributes>
>
> </classpathentry> <classpathentry kind="src"
> path="src/main/java"/>
>
>
>
>
>
> 1. The classes in build/gensrc/ generate a runtime exception, not a
> build error. I wonder if perhaps we should add an entry to the library
> path instead. Let me check on this.
>
>
>
> 1. Again, Jeanette’s report was about runtime error. I wonder though
> if we have / should have a file that documents where reflection is being
> used. (Perhaps it already exists somewhere? Searching for “reflection”
> turned out 4.5K hits…)
>
>
>
> What do you think?
>
>
>
> -andy
>
>
>
> *From: *Nir Lisker <nlisker at gmail.com>
> *Date: *Friday, 2022/07/15 at 11:04
> *To: *Andy Goryachev <andy.goryachev at oracle.com>, Jeanette Winzenburg <
> fastegal at swingempire.de>
> *Cc: *Kevin Rushforth <kevin.rushforth at oracle.com>,
> openjfx-dev at openjdk.org <openjfx-dev at openjdk.org>
> *Subject: *[External] : Re: Eclipse: ClassNotFoundException:
> com.sun.prism.shader.FillPgram_Color_Loader
>
> First of all, you can set "ignore optional compile problems" on a source
> folder in Eclipse. In fact, these folders were set as such before the
> change.
>
>
>
> But more importantly, I don't see how classes that are only used in
> reflection will cause a build error. If these folders are not referenced in
> compile time, Eclipse doesn't need them as source folders.
>
>
>
> Jeanette, the Problems view in Eclipse has a table where it shows the
> problem and the resource and path from which the error originates. If you
> get errors because of missing OS-specific folders, it's crucial to know
> what reports those errors, that is, who is looking for these folders.
>
>
>
> On Fri, Jul 15, 2022 at 8:17 PM Andy Goryachev <andy.goryachev at oracle.com>
> wrote:
>
> Kevin:
>
>
>
> The four classpath entries in question are
>
> build/hlsl/Prism
>
> build/gensrc/jsl-prism
>
> build/hlsl/Decora
>
> build/gensrc/jsl-decora
>
>
>
> once added to the Eclipse .classpath file (in graphics) I see two warnings
> (on Mac):
>
>
>
> Project 'graphics' is missing required source folder:
> 'build/hlsl/Decora' Build path graphics
>
> Project 'graphics' is missing required source folder:
> 'build/hlsl/Prism' Build path graphics
>
>
>
> For the moment I cannot verify the situation on Windows or Linux, but I
> think Nir mentioned that these directories might be created on Windows, so
> this is my current assumption.
>
>
>
> The problem in Eclipse is that these warnings (incomplete build path)
> cannot be turned off. One solution is to (re)create the missing
> directories manually after each [gradle clean]. The other solution is to
> modify gradle build to always create these directories, even if they are
> not used. This step is usually in ‘init’ target in the builds that utilize
> clean-init-build cycle.
>
>
>
> What could be the problem in creating empty directories?
>
>
>
>
>
> - Is there a way to make it conditional?
>
>
>
> In theory, yes, via classpath variables:
>
>
>
>
> https://stackoverflow.com/questions/495264/how-can-i-specify-an-eclipse-classpath-entry-for-specific-o-s-platform
> <https://urldefense.com/v3/__https:/stackoverflow.com/questions/495264/how-can-i-specify-an-eclipse-classpath-entry-for-specific-o-s-platform__;!!ACWV5N9M2RV99hQ!LIzGSIjIMUXkp-9z2M2VFKfJBUQcWoQPJSn6doHpNKi_Zr1Tms-_bnPFrh67esgNcmElmd8oTKoXmLRcdWkg$>
>
>
>
> I’ve never used this before. So far these directories are the only place
> where we have platform differences in the classpath.
>
>
>
> Could someone with a Windows machine verify that 'build/hlsl/Decora' and
> 'build/hlsl/Prism' are not empty please?
>
>
>
> Thank you
>
> -andy
>
>
>
>
>
>
>
> *From: *openjfx-dev <openjfx-dev-retn at openjdk.org> on behalf of Kevin
> Rushforth <kevin.rushforth at oracle.com>
> *Date: *Friday, 2022/07/15 at 09:51
> *To: *openjfx-dev at openjdk.org <openjfx-dev at openjdk.org>
> *Subject: *Re: Eclipse: ClassNotFoundException:
> com.sun.prism.shader.FillPgram_Color_Loader
>
>
>
> On 7/15/2022 9:05 AM, Andy Goryachev wrote:
>
> Nir:
>
>
>
> So these folders are not needed to compile, but they are needed to run.
>
>
>
> I suggest we bring them back to .classpath
>
>
> Is there a way to make it conditional?
>
> and also modify build.gradle to create all 4 folders as a part of the
> corresponding target.
>
>
> I am not in favor of this change. There are platform-specific parts of the
> build, so IDEs should be able to adapt to this.
>
> -- Kevin
>
>
>
> What do you think?
>
>
>
> -andy
>
>
>
>
>
>
>
> *From: *openjfx-dev <openjfx-dev-retn at openjdk.org>
> <openjfx-dev-retn at openjdk.org> on behalf of Jeanette Winzenburg
> <fastegal at swingempire.de> <fastegal at swingempire.de>
> *Date: *Friday, 2022/07/15 at 03:19
> *To: *openjfx-dev at openjdk.org <openjfx-dev at openjdk.org>
> <openjfx-dev at openjdk.org>
> *Subject: *Re: Eclipse: ClassNotFoundException:
> com.sun.prism.shader.FillPgram_Color_Loader
>
>
> Zitat von Nir Lisker <nlisker at gmail.com> <nlisker at gmail.com>:
>
> Hi Nir,
>
> thanks for the explanation - though I have no idea why Eclipse wants
> them (see them again after re-adding as source folders and all running
> as before).
>
> Not sure where to go from here, would prefer not to have a local
> classpath that differs from the one in the repository .. hmm
>
> -- Jeanette
>
> > To be more specific, FillPgram_Color_Loader.java is located under the
> > build/gensrc folder, which is created during the javafx setup depending
> on
> > the OS. Specifically, it's under build/gensrc/jsl-prism, which is
> > Windows-specific.
> > The change to the classpath file removed these folders from the source
> > folders list in the build path, so I don't know why you would get this
> > error. Nothing in the "main" source folders references these in compile-
> or
> > build-time.
> >
> > On Fri, Jul 15, 2022 at 12:51 PM Nir Lisker <nlisker at gmail.com>
> <nlisker at gmail.com> wrote:
> >
> >> The Eclipse project files were updated recently in
> >> https://github.com/openjdk/jfx/pull/804
> <https://urldefense.com/v3/__https:/github.com/openjdk/jfx/pull/804__;!!ACWV5N9M2RV99hQ!LIzGSIjIMUXkp-9z2M2VFKfJBUQcWoQPJSn6doHpNKi_Zr1Tms-_bnPFrh67esgNcmElmd8oTKoXmE8agVgz$>.
> The OS-specific folders were
> >> removed. I tested it and I had no issue after this change. On what
> resource
> >> are you getting this error?
> >>
> >> On Fri, Jul 15, 2022 at 12:44 PM Jeanette Winzenburg <
> >> fastegal at swingempire.de> wrote:
> >>
> >>>
> >>> Hi,
> >>>
> >>> after synching my master branch with upstream (has been a long while
> >>> since my previous update ;), I can't use the Eclipse projects (base,
> >>> controls, graphics are the only ones I'm keeping for change in
> >>> Eclipse) in another project: when running any application it's
> >>> throwing the stacktrace below.
> >>>
> >>> My overall setup worked fine before (didn't dig yet when it started
> >>> not to), running the tests inside the fx projects themselves is fine,
> >>> though.
> >>>
> >>> Looks like there is something missing (native?) related to graphics.
> >>>
> >>> Where to start looking for the reason?
> >>>
> >>> Stacktrace:
> >>>
> >>> java.lang.ClassNotFoundException:
> >>> com.sun.prism.shader.FillPgram_Color_Loader
> >>> at
> >>>
> >>>
> java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
> >>> at
> >>>
> >>>
> java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
> >>> at
> java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
> >>> at java.base/java.lang.Class.forName0(Native Method)
> >>> at java.base/java.lang.Class.forName(Class.java:332)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.d3d.D3DResourceFactory.createStockShader(D3DResourceFactory.java:426)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:269)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:500)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:369)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedPgram(BaseShaderGraphics.java:919)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedRect(BaseShaderGraphics.java:620)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.fillRect(BaseShaderGraphics.java:1526)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderBackgroundRectanglesDirectly(NGRegion.java:1112)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderBackgroundRectangle(NGRegion.java:852)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderAsRectangle(NGRegion.java:754)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:575)
> >>> 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.PresentingPainter.run(PresentingPainter.java:92)
> >>> at
> >>>
> >>>
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> >>> at
> >>>
> java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> >>> at
> >>> javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
> >>> at
> >>>
> >>>
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> >>> at
> >>>
> >>>
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
> >>> at java.base/java.lang.Thread.run(Thread.java:835)
> >>> java.lang.InternalError: Error loading stock shader FillPgram_Color
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.d3d.D3DResourceFactory.createStockShader(D3DResourceFactory.java:432)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:269)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:500)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:369)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedPgram(BaseShaderGraphics.java:919)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.renderGeneralRoundedRect(BaseShaderGraphics.java:620)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.prism.impl.ps.BaseShaderGraphics.fillRect(BaseShaderGraphics.java:1526)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderBackgroundRectanglesDirectly(NGRegion.java:1112)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderBackgroundRectangle(NGRegion.java:852)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderAsRectangle(NGRegion.java:754)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:575)
> >>> 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.PresentingPainter.run(PresentingPainter.java:92)
> >>> at
> >>>
> >>>
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> >>> at
> >>>
> java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> >>> at
> >>> javafx.graphics/com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
> >>> at
> >>>
> >>>
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> >>> at
> >>>
> >>>
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> >>> at
> >>>
> >>>
> javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:126)
> >>> at java.base/java.lang.Thread.run(Thread.java:835)
> >>>
> >>> -- Thanks, Jeanette
> >>>
> >>>
> >>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20220716/3e4c08a1/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 146611 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20220716/3e4c08a1/image001-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 12035 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20220716/3e4c08a1/image-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 4408 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20220716/3e4c08a1/image-0003.png>
More information about the openjfx-dev
mailing list