Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6017483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:08:05+00:00 2026-05-23T03:08:05+00:00

I tried to register a custom URL handler for a classpath protocol, as described

  • 0

I tried to register a custom URL handler for a classpath protocol, as described in another thread. Here is the code:

package com.mycompany;

import org.junit.Test;
import java.net.MalformedURLException;
import java.net.URL;
import com.mycompany.protocol.classpath.Handler;

public class ParserTest {
    @Test
    public void testParsing() throws MalformedURLException {      
        System.out.println(System.getProperty("java.protocol.handler.pkgs"));

        //URL url = new URL(null, "classpath://com.mycompany/hello-world.xml", new Handler(ClassLoader.getSystemClassLoader()));
        URL url = new URL("classpath://com.mycompany/hello-world.xml");
    }
}

The test case has the following JVM arguments:

-Djava.protocol.handler.pkgs=com.mycompany.protocol

The System.out.println line properly outputs com.mycompany.protocol, so the property is being set. However, it looks like it’s not being taken into effect, because the above call will throw a java.net.MalformedURLException: unknown protocol: classpath exception.

If I provide the handler explicitly as in the commented line, everything is fine. However, I would rather not provide it explicitly – it should be done automatically.

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:08:06+00:00Added an answer on May 23, 2026 at 3:08 am

    I have found the issue. The original classpath handler class that I used had a non-default constructor. Of course, because it had only a non-default constructor, the handler couldn’t be instantiated. I apologize to everyone who have tried to debug this issue, I failed to see this connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As you probably know, iPhone applications can register a custom URL scheme handler, ala
Tried following the instructions here: How to use Google app engine with my own
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
I have the following code to build a custom taxonomy for my portfolio: add_action(
I have a custom DropDownList control, SDropDownList. I am trying to register and fire
As The Title said, I tried to implement a custom taxonomy in wordpress, i
I am learning django-cms. I tried to make custom plugin which was quite successful
I have a similar problem with this ( https://wordpress.stackexchange.com/questions/9593/custom-post-type-archive-with-pagination ) and can't really figure
When using the register.inclusion_tag() shortcut on a Custom Template Tag, assuming you define the
I'm creating some custom wp7 silverlight custom controls which register some events on template

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.