Jetty base resource help

Hey, I have a java app and I'm using jetty server I used to have this code context.setBaseResource( Resource.newResource( WebConfigurationProvider.class.getResource( "webapp" ) ) ); But after upgrading to jetty 12, Resource.newResource isn't available anymore I replaced it with
Container resourceHandler = new ResourceHandler();
context.setBaseResource( ResourceFactory.of( resourceHandler ).newResource( WebConfigurationProvider.class.getResource( "webapp" ) ) );
Container resourceHandler = new ResourceHandler();
context.setBaseResource( ResourceFactory.of( resourceHandler ).newResource( WebConfigurationProvider.class.getResource( "webapp" ) ) );
This is now causing an exception when the app is built and ran because the resource is in a pkg file pkg://server-config.pkg/com/mirada/cerberus/config/webapp/ java.nio.file.FileSystemNotFoundException: Provider "pkg" not installed pkg is actually not in the FileSystemProvider.installedProviders() hence why this is happening when the path is trying to be fetched I'm kind of stuck, not sure what to try anymore I'm not sure if it's a jetty thing or like java thing because the providers are in java.nio.file.spi, I have file, jar and jrt but i don't have pkg, and jetty is not using that it's simply when it tries to do Path.of(uri)
7 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @mind404! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
mind404
mind404OP2mo ago
Still need help
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
dan1st
dan1st2mo ago
Stack Overflow
How can I serve a particular classpath resource at a given address ...
I'm looking to expose a clientacesspolicy.xml file from an embedded jetty server. My current attempt looks like this: ContextHandler capHandler = new ContextHandler(); capHandler.setContextPath("/
dan1st
dan1st2mo ago
Container resourceHandler = new ResourceHandler();
context.setBaseResource(ResourceFactory.of(resourceHandler).newClassPathResource("webapp", false));
Container resourceHandler = new ResourceHandler();
context.setBaseResource(ResourceFactory.of(resourceHandler).newClassPathResource("webapp", false));
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server