Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I load resources within my application using Class.forName and ClassLoader.getSystemClassLoader in JavaTM Web Start?

0
Posted

How can I load resources within my application using Class.forName and ClassLoader.getSystemClassLoader in JavaTM Web Start?

0

Java Web Start uses a user-level classloader to load all the application resources specified in the JNLP file. This classloader implements the security model and the downloading model defined by the JNLP specification. This is no different than how the AppletViewer or the Java Plug-In works. This has the, unfortunate, side-effect that Class.forName will not find any resources that are defined in the JNLP file. The same is true for looking up resources and classes using the system class loader (ClassLoader.getSystemClassLoader). To find application resources in Java Web Start, make sure to use the classloader that loaded your application, e.g.,: this.getClass().getClassLoader(), or Thread.getCurrent().getContextClassLoader() Also ensure that the above happens in the main thread.

0

Java Web Start uses a user-level classloader to load all the application resources specified in the JNLP file. This classloader implements the security model and the downloading model defined by the JNLP specification. This is no different than how the AppletViewer or the Java Plug-In works. This has the, unfortunate, side-effect that Class.forName will not find any resources that are defined in the JNLP file. The same is true for looking up resources and classes using the system class loader (ClassLoader.getSystemClassLoader). To find application resources in Java Web Start, make sure to use the classloader that loaded your application, e.g.,: this.getClass().getClassLoader(), or Thread.getCurrent().getContextClassLoader() ————————— ConfigObject should have used this.getClass().getClassLoader(), instead. Will this be fixed soon? Do you have any workaround suggestions? Here is the exception: Settings/eth/.javaws/cache/https/Dwww.2interaction.com/P- 1/DMdownload/DMsoft

0

JavaTM Web Start uses a user-level classloader to load all the application resources specified in the JNLP file. This classloader implements the security model and the downloading model defined by the JNLP specification. This is no different than how the AppletViewer or the Java Plug-In works. This has the, unfortunate, side-effect that Class.forName will not find any resources that are defined in the JNLP file. The same is true for looking up resources and classes using the system class loader (ClassLoader.getSystemClassLoader). To find application resources in JavaTM Web Start, make sure to use the classloader that loaded your application, e.g.,: this.getClass().getClassLoader(), or Thread.getCurrent().getContextClassLoader() Also ensure that the above happens in the main thread.” and just played around with the options 😉 > Is it just that Class.getResource() massages the arguments? no idea, I used what worked >Can you get Jess to work >as-is by just reading the docs for Class.getRe

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123