Solved

MalformedURLException

Posted on 2002-07-18
8
201 Views
Last Modified: 2008-02-01
Hello,

I am taking a RemoteException --> UnmarshalException --> MalformedURLException: no protocol: Files/apa/webapps/ROOT/WEB-INF/classes

and this occured at the time the object tried to bind itself to the registry.

The thing that I noticed is that it stucks somewhere:

"Files/"

It should be

"Program Files/" etc

The program is a bean that is inside a JSP page located at
C:\2k\Program Files\apa\webapps\ROOT\jsp\game\welcome.jsp

any ideas why I take this ???

0
Comment
Question by:pouli
8 Comments
 
LVL 1

Expert Comment

by:klf
Comment Utility
pouli

URLs are not allowed to contain spaces.  Try encoding the URL before using it. use java.net.URIEncoder
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
Looks like the space in the directory name is screwing it up.
Easiest thing would be to move you webapp to a spot where there are no spaces in directory names.
0
 

Author Comment

by:pouli
Comment Utility
Well I do not set anywhere this address.

     private void bindMe()
     {
          try
          {
               if (System.getSecurityManager() == null)
               {
                   System.setSecurityManager(new RMISecurityManager());
               }    
     
               String name = "RoomCoordinator";
               try
               {              
                   Naming.rebind(name, me);
                   System.out.println("RoomCoordinator bound");
                    //Thread roomThread = new Thread( me );
                    //roomThread.start();
                    //System.out.println("Room Thread Started");
               }
               catch( AccessControlException ace )
               {
                    ace.printStackTrace();
               }
          }
          catch( Exception e )
          {
               e.printStackTrace();
          }    
     }
     
I do not set anywhere this address.

I use the ClassFileServer form Sun to send the Stubs.I set the address where it can find the classes there. But instead of program files I set progra~1.

I used to run a previous RMI example successfully under that folder.

I do not know what is wrong now.

0
 

Author Comment

by:pouli
Comment Utility
When I run the class that used to raise the exception like a normal application everything worked fine.


Probably the JVM that is being loaded from the Tomcat server gives different parameters to the one I give when i load the application.

Anybody has any idea about this?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 92

Accepted Solution

by:
objects earned 25 total points
Comment Utility
>  the Tomcat server gives different parameters

It certainly does. It's probably related to it using a different classpath.
0
 

Author Comment

by:pouli
Comment Utility
I changed the bean to a normal application and it is working fine.

I will ask from the moderator to split the points between
objects & klf
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Points reduced for a split.  You can now accept one experts comment as an answer.  After that, make another question in this topic area for the other expert.  Make the question for the amount of points intended.  Label the question, "Question for (Expert Name) and post this question number in the base of the question, i.e. For your assistance in question # --------


Computer101
E-E Moderator
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues undeā€¦
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilationā€¦
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now