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

  • SEARCH
  • Home
  • 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 8087777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:53:19+00:00 2026-06-05T18:53:19+00:00

I am maintaining a web application that uses java.protocol.handler. I initialize it with a

  • 0

I am maintaining a web application that uses java.protocol.handler. I initialize it with a value using: -Djava.protocol.handler.pkgs=<my value>.
The problem is following:
1. If I deploy the app. to tomcat from eclipse directly, using this instruction (directly referring to Tomcat main class) and pass the -Djava.protocol.handler.pkgs=<my value> argument in VM arguments tab, the app works properly and -protocol dependent bean is initialized.

2.If I deploy the .war file directly to Tomcat/webapps and start tomcat with catalina.bat (adding -Djava.protocol.handler.pkgs=<my value> to JAVA_OPTS) I get: Malformed URL supplied Exception.
3.If I start Tomcat from eclipse (and specify VM arguments similar to point 1.) the same .war will be deployed correctly.

My guess is there is difference between how catalina.bat and eclipse initialize VM parameters. Or maybe I should attach my projects .jars to Tomcat somehow.

Thank you for any hints. I can provide more details of required

  • 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-06-05T18:53:20+00:00Added an answer on June 5, 2026 at 6:53 pm

    As per the comments, it’s hard to know what’s going on without more information, but maybe this will help. Tomcat calls URL.setURLStreamHandlerFactory to set its own URLStreamHandlerFactory, which overrides the default behaviour of the java.protocol.handler.pkgs system property. You can’t then call URL.setURLStreamHandlerFactory with your own handler without breaking internal Tomcat functionality. The system of URLStreamHandlers certainly isn’t Java’s greatest feature.

    The only way I’ve found to reliably use my own stream handler is to pass it into the URL constructor:

    URL url = new URL( null, "http://example.com", myURLStreamHandler );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently maintaining a small-medium sized java web application (using only plain JSPs/Servlets) that
I'm maintaining a Java web application that uses a java.util.Hashtable to cache values. This
I am building a web application that uses the database for Users, Security/roles, and
I'm working on an ASP.NET web application that uses a lot of JavaScript on
I'm maintaining a web application that utilizes the provider pattern as described below, for
I am looking at an asp.net 2 web application that I am maintaining (but
currently I am maintaining a django web application and I am using rsync via
I am maintaining a public website (no authorization required) that uses web services over
I help develop a relatively high traffic web application that uses ASP.NET WebForms. Although
At our shop, we are maintaining roughly 20 Java EE web applications. Most of

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.