You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Steve Cockwell <st...@canux.com> on 2001/04/12 21:53:31 UTC

java.net.MalformedURLException: unknown protocol: town

I just moved from 1.2.1 to the CVS source (yesterdays).  Using the
supplied assembly.xml (same as james.conf.xml) if I uncomment:

<spoolRepository>
	<repository destinationURL="town://mainspool" type="SPOOL"
model="SYNCHRONOUS">
		<conn>file:///etc.....
	</repository>
</spoolRepository>

I get the above error in the phoenix.log file.

Also, there is a missing "/" in the supplied assembly.xml file for DBMS
user storage:

<repository name="LocalUsers"
class="org.apache.james.userrepository.UsersTownRepository">
	<destination URL="town://users/">
	<conn>file:///var/maildatabase</conn>
	<table>Users</table>
</repository>

Or perhaps the "/" should just be outside (instead of inside) the '"' on
the <destination> line?

Thanks,

..src

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: java.net.MalformedURLException: unknown protocol: town

Posted by Harmeet Bedi <hb...@yahoo.com>.
This seems to be the problem:

james\core\AvalonMailStore has code like this

URL url = new URL(destinationURL);
String protocol = url.getProtocol();

town, is not a know protocol so java.net.URL constructor throws a
MalformedURLException.

In order to avoid this one could either write a URL Handler for town
protocol or avoid using java.net.URL.

I am planning to add this change to james\core\AvalonMailStore.java.
This should cause the exception to go away.
---------------------------------------------------------------------------
-        URL destination = null;
+        String destination = null;
+        String protocol = null;
         try {
-            destination = new URL(repConf.getAttribute("destinationURL"));
+            destination = repConf.getAttribute("destinationURL");
+            int idx = destination.indexOf(':');
+            if ( idx == -1 )
+                throw new ComponentException
+                    ("destination is malformed. Must be a valid URL:
"+destination);
+            protocol = destination.substring(0,idx);
         } catch (ConfigurationException ce) {
             throw new ComponentException("Malformed configuration has no
destinationURL attribute", ce);
-        } catch (MalformedURLException mue) {
-            throw new ComponentException("destination is malformed. Must be
a valid URL", mue);
         }
----------------------------------------------------------------

Harmeet

----- Original Message -----
From: "Charles Benett" <ch...@benett1.demon.co.uk>
To: <ja...@jakarta.apache.org>
Sent: Monday, April 16, 2001 3:18 AM
Subject: Re: java.net.MalformedURLException: unknown protocol: town


> Steve,
> When I ported James from Avalon-1.2.1 to Avalon 3.0 I didn't have an
> RDBMS to test it against - which I pointed out on the list. I started
> looking at it last week and there are bugs. But I haven't pinned them
> down - although I found something different & corrected that.
>
> I suspect it is a very simple bug - we just need to find it. If you find
> it before I do, can you send a patch to the list? (See
> http://jakarta.apache.org/site/source.html for how to submit patches)
>
> Thanks,
>
> Charles
>
> Steve Cockwell wrote:
> >
> > I just moved from 1.2.1 to the CVS source (yesterdays).  Using the
> > supplied assembly.xml (same as james.conf.xml) if I uncomment:
> >
> > <spoolRepository>
> >         <repository destinationURL="town://mainspool" type="SPOOL"
> > model="SYNCHRONOUS">
> >                 <conn>file:///etc.....
> >         </repository>
> > </spoolRepository>
> >
> > I get the above error in the phoenix.log file.
> >
> > Also, there is a missing "/" in the supplied assembly.xml file for DBMS
> > user storage:
> >
> > <repository name="LocalUsers"
> > class="org.apache.james.userrepository.UsersTownRepository">
> >         <destination URL="town://users/">
> >         <conn>file:///var/maildatabase</conn>
> >         <table>Users</table>
> > </repository>
> >
> > Or perhaps the "/" should just be outside (instead of inside) the '"' on
> > the <destination> line?
> >
> > Thanks,
> >
> > ..src
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: james-dev-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Re: java.net.MalformedURLException: unknown protocol: town

Posted by Charles Benett <ch...@benett1.demon.co.uk>.
Steve,
When I ported James from Avalon-1.2.1 to Avalon 3.0 I didn't have an
RDBMS to test it against - which I pointed out on the list. I started
looking at it last week and there are bugs. But I haven't pinned them
down - although I found something different & corrected that.

I suspect it is a very simple bug - we just need to find it. If you find
it before I do, can you send a patch to the list? (See
http://jakarta.apache.org/site/source.html for how to submit patches)

Thanks,

Charles

Steve Cockwell wrote:
> 
> I just moved from 1.2.1 to the CVS source (yesterdays).  Using the
> supplied assembly.xml (same as james.conf.xml) if I uncomment:
> 
> <spoolRepository>
>         <repository destinationURL="town://mainspool" type="SPOOL"
> model="SYNCHRONOUS">
>                 <conn>file:///etc.....
>         </repository>
> </spoolRepository>
> 
> I get the above error in the phoenix.log file.
> 
> Also, there is a missing "/" in the supplied assembly.xml file for DBMS
> user storage:
> 
> <repository name="LocalUsers"
> class="org.apache.james.userrepository.UsersTownRepository">
>         <destination URL="town://users/">
>         <conn>file:///var/maildatabase</conn>
>         <table>Users</table>
> </repository>
> 
> Or perhaps the "/" should just be outside (instead of inside) the '"' on
> the <destination> line?
> 
> Thanks,
> 
> ..src
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org