You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Steve Muench <sm...@us.oracle.com> on 2000/01/09 10:56:18 UTC

setURLStreamHandlerFactory Question

When I run Cocoon in my Oracle JDeveloper 3.0 IDE
that gives me visual Servlet debugging, I get an error
when Engine tries to:

  URL.setURLStreamHandlerFactory()

because it appears that my servlet engine has already
set it before Engine tries to (giving a java.lang.Error
exception "factory already set").

Is it an anomaly that my servlet engine would have
already set this?

_________________________________________________________
Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team
http://technet.oracle.com/tech/java
http://technet.oracle.com/tech/xml


Re: setURLStreamHandlerFactory Question

Posted by Steve Muench <sm...@us.oracle.com>.
| Anyway, I'll make sure that at least Cocoon doesn't fail when its
| executing environment doesn't allow the URLHandlerFactory to be called.

I commented out the code in Engine that was doing
this to get past it to see if I was going to hit
any other issues, but then I ran into the problem
that init(Director) and init(Configs) of
the XSPProcessor (I think I remember correctly)
want to look up things via "resource://..../.xsl"
URL's which I'm presuming only work if your
URLStreamHandler's are in place.

I've also sent email to our guys to find out
why *they* are calling this method in their
servlet engine just to make sure they *need*
to be doing it...

_________________________________________________________
Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team
http://technet.oracle.com/tech/java
http://technet.oracle.com/tech/xml
----- Original Message ----- 
From: "Stefano Mazzocchi" <st...@apache.org>
To: <co...@xml.apache.org>
Sent: Monday, January 10, 2000 7:39 AM
Subject: Re: setURLStreamHandlerFactory Question


| Steve Muench wrote:
| > 
| > When I run Cocoon in my Oracle JDeveloper 3.0 IDE
| > that gives me visual Servlet debugging, I get an error
| > when Engine tries to:
| > 
| >   URL.setURLStreamHandlerFactory()
| > 
| > because it appears that my servlet engine has already
| > set it before Engine tries to (giving a java.lang.Error
| > exception "factory already set").
| > 
| > Is it an anomaly that my servlet engine would have
| > already set this?
| 
| Gosh, didn't think of that one.
| 
| The Java API was not designed deep enough to cover all possible server
| side cases where you have components running into servlets running into
| applications running into sandboxes and so on...
| 
| I see the need for only one security manager (of course), but I fail to
| see the need for having one and only one URL factory. 
| 
| "This method can be called at most once in a given Java Virtual
| Machine."
| 
| Damn it: any component could provide it's own protocol handler, but
| there is no way to register it, unless you write your own
| HandlerFactory. True, there is another way to register your protocol
| handlers, but this is not that portable nor legal. 
| 
| Anyway, I'll make sure that at least Cocoon doesn't fail when its
| executing environment doesn't allow the URLHandlerFactory to be called.
| 
| Grrr.... 
| 
| -- 
| Stefano Mazzocchi      One must still have chaos in oneself to be
|                           able to give birth to a dancing star.
| <st...@apache.org>                             Friedrich Nietzsche
| --------------------------------------------------------------------
|  Come to the first official Apache Software Foundation Conference!  
| ------------------------- http://ApacheCon.Com ---------------------
| 
| 
| 


Re: setURLStreamHandlerFactory Question

Posted by Stefano Mazzocchi <st...@apache.org>.
Steve Muench wrote:
> 
> When I run Cocoon in my Oracle JDeveloper 3.0 IDE
> that gives me visual Servlet debugging, I get an error
> when Engine tries to:
> 
>   URL.setURLStreamHandlerFactory()
> 
> because it appears that my servlet engine has already
> set it before Engine tries to (giving a java.lang.Error
> exception "factory already set").
> 
> Is it an anomaly that my servlet engine would have
> already set this?

Gosh, didn't think of that one.

The Java API was not designed deep enough to cover all possible server
side cases where you have components running into servlets running into
applications running into sandboxes and so on...

I see the need for only one security manager (of course), but I fail to
see the need for having one and only one URL factory. 

"This method can be called at most once in a given Java Virtual
Machine."

Damn it: any component could provide it's own protocol handler, but
there is no way to register it, unless you write your own
HandlerFactory. True, there is another way to register your protocol
handlers, but this is not that portable nor legal. 

Anyway, I'll make sure that at least Cocoon doesn't fail when its
executing environment doesn't allow the URLHandlerFactory to be called.

Grrr.... 

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------