0

I am trying to call a servlet from an Oracle DB and for that I am using a java 1.4 class with an URL call on this form http://ip:80/serv/Servletg?parameter with

url = new URL("http","ip",80,"/serv/Servletg"+parameter);

and the following exception is occurred:

java.net.MalformedURLException: unknown protocol: http at java.net.URL.(URL.java:376)
at java.net.URL.(URL.java:264)

With using a webbrowser the URL is giving a good response from the webserver.

I can not understand what the problem in this issue. I am using apache Tomcat on the webserver side.

Thanks for Help

3
  • For starters: why do you use a java 1.4 class in 2010? Commented Nov 9, 2010 at 10:58
  • Do you get the same error if you use the URL overload that only takes a string? IE url = new URL("ip:80/serv/Servletg?parameter"); ? Commented Nov 9, 2010 at 11:07
  • yes I have the same Error with url = new URL("ip:80/serv/Servletg?parameter"); Commented Nov 9, 2010 at 11:20

1 Answer 1

1

You must add the correct security permissions to get it to work - seems that you are not allowed to access the network!

See http://download.oracle.com/docs/cd/B14117_01/java.101/b12021/security.htm

Sign up to request clarification or add additional context in comments.

5 Comments

It works with the webbrowser without https. Do you mean that I need a security permission on Oracle?
Maybe I understood you wrong but this is what I think happens: You have an oracle DB running a java method for you right? Problably Oracle uses javas built in permissions when running this method. If not, who is running the method/class?
Added a url to something interesting.. :)
I tried the https but the compile is givign me the same error java.net.MalformedURLException: unknown protocol: https at java.net.URL.<init>(URL.java:376) at java.net.URL.<init>(URL.java:264)
No no, it is not a secure protocol you need. The java code is not allowed to connect at all using external protocols - look at the link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.