You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Stephane Bailliez <st...@haht.com> on 2002/07/25 18:14:00 UTC

T2.2 / T3.3 and iPlanet-like container

CC: scarab-dev for information

I had the painful pleasure this afternoon to install iPlanet to qualify our
turbine-based webapp. I ran a into a problem encountered a couple of times
judging by a 'iplanet' search in the archives of turbine-user and
scarab-dev.

The error surfacing in the container log is:

[25/Jul/2002:16:24:01] failure ( 2144): Internal error: exception thrown
from the servlet service function (uri=/partner/turbine):
org.apache.turbine.services.InstantiationException: ServiceBroker: unknown
service PoolService requested, Stack:
org.apache.turbine.services.InstantiationException: ServiceBroker: unknown
service PoolService requested
	at
org.apache.turbine.services.BaseServiceBroker.getServiceInstance(BaseService
Broker.java:356)
	at
org.apache.turbine.services.BaseServiceBroker.getService(BaseServiceBroker.j
ava:298)
	at
org.apache.turbine.util.RunDataFactory.putRunData(RunDataFactory.java:231)
	at org.apache.turbine.Turbine.doGet(Turbine.java:638)
[...]

This is due to ServletConfig.getRealPath("") returning null... thus it fails
loading the properties file during initialization of the primary services,
etc etc etc...

It's not clear by the servlet api if an empty path might be considered valid
or not. My interpretation is yes..but iPlanet works fine by using
getRealPath(".") as it simply has the precondition in getRealPath(String)
made of:

if (path == null || path.length() == 0) return null;

I think it might be better to change the empty path to a more valid ".". It
should extend the range of supported container in a snap. I don't think this
problem is limited to iPlanet only. (JRun ? and some version of Weblogic if
I remember well).

Maybe it will be better to get the canonical path in a helper method as I'm
not sure that all servlet containers do return the canonical one (at least
iPlanet does not)

Comments ? If there is a conscencus, I will post the patches for T2.2 and T3
asap.

Stephane



Note for iPlanet users:

No other logging is performed if the line below (on NT) is not added to
magnus.conf file
Init fn="nt-console-init" stdout=console stderr=console

In this case:

java.io.FileNotFoundException: null/WEB-INF/conf/TurbineResources.properties
(The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:64)
        at
org.apache.velocity.runtime.configuration.Configuration.<init>(Configuration
.java:380)
[....]
(!) NOTICE: init
(!) NOTICE: ServiceBroker: LoggingService enabled.
(!) NOTICE: Turbine: init() failed:
org.apache.turbine.services.InitializationException: Can't load file
null/WEB-INF/conf/TurbineResources.properties
        at
org.apache.turbine.services.resources.TurbineResourceService.init(TurbineRes
ourceService.java:167)
[...]

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: T2.2 / T3.3 and iPlanet-like container

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Stephane Bailliez <st...@haht.com> writes:

>I had the painful pleasure this afternoon to install iPlanet to qualify our
>turbine-based webapp. I ran a into a problem encountered a couple of times
>judging by a 'iplanet' search in the archives of turbine-user and
>scarab-dev.

[... getting null from ServletContext.getRealPath("") ...]

Hi,

>This is due to ServletConfig.getRealPath("") returning null... thus it fails
>loading the properties file during initialization of the primary services,
>etc etc etc...

This is correct and legal, according to Sun specs:

--- cut ---
getRealPath

public java.lang.String getRealPath(java.lang.String path)

    Returns a String containing the real path for a given virtual
path. For example, the virtual path "/index.html" has a real path of
whatever file on the server's filesystem would be served by a request
for "/index.html".

    The real path returned will be in a form appropriate to the
computer and operating system on which the servlet container is
running, including the proper path separators. This method returns
null if the servlet container cannot translate the virtual path to a
real path for any reason (such as when the content is being made
available from a .war archive).

Parameters: path - a String specifying a virtual path
Returns: a String specifying the real path, or null if the translation
cannot be performed
--- cut ---


>It's not clear by the servlet api if an empty path might be considered valid
>or not. My interpretation is yes..but iPlanet works fine by using
>getRealPath(".") as it simply has the precondition in getRealPath(String)
>made of:

>if (path == null || path.length() == 0) return null;

>I think it might be better to change the empty path to a more valid ".". It

"." is not the same as "". I'd say that "/" is the same as "".

There are some places in Turbine where context.getRealPath("/"); is
already used.

In Turbine-2, I found one reference to "" in TurbineLoggingService and
two in Turbine.java. Shall we change them?

	Regards
		henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>