You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by sz...@op.pl on 2004/10/15 20:35:06 UTC
XSP and service manager
Hello ml users,
Why this simple code doesnt work? I get compile error when try+catch
block is not commented
<?xml version="1.0" encoding="UTF-8"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
<xsp:structure>
<xsp:include>org.apache.avalon.excalibur.datasource.DataSourceComponent</xsp:include>
<xsp:include>java.sql.DriverManager</xsp:include>
<xsp:include>java.sql.Connection</xsp:include>
<xsp:include>org.apache.avalon.framework.component.ComponentSelector</xsp:include>
<xsp:include>org.apache.avalon.framework.component.ComponentException</xsp:include>
</xsp:structure>
<xsp:logic>
ComponentSelector dc = null;
try {
dc = (ComponentSelector) manager.lookup(DataSourceComponent.ROLE + "Selector");
}catch(ComponentException cme) {}
</xsp:logic>
</xsp:page>
--
Best regards,
szefu18
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: XSP and service manager
Posted by "John L. Webber" <Jo...@jentro.com>.
Have you looked at the generated java file? If you're using Tomcat, it
will be somewhere like
$CATALINA_HOME/work/localhost/web-app-name/cocoon-files/org/apache/cocoon/www
with the base below that depending on the directory path under
$COCOON_HOME. Classes are renamed from XXX.xsp to XXX_xsp.java. (from
the Cocoon WIKI).
Often looking at the generated java code will reveal what went wrong. As
to the manager, there is a ServiceManager available in the Context, but
AFAIK you need to access it in this way:
manager = (ServiceManager) context.getAttribute("manager");
Hope that helps,
John
szefu18@op.pl wrote:
> Hello John,
>
> Monday, October 18, 2004, 9:02:11 AM, you wrote:
>
> JLW> Hello,
>
> JLW> It would help to send the complete stack trace. Where does the manager
> JLW> variable come from?
>
> And that is the problem ... it looks like manager is definied in base class
> of any XSP class. Correct me if i'm wrong.
>
> Stracktrace is stupid as any Cocoon exception and dont say anything
> about error ... well its error while compiling XSP- it claims
> that ";" is missing... i think propably its problem with some import
> - compiler does not recognize some type.
>
>
>
--
---------------------------------------------------------
Jentro Technologies GmbH
John L. Webber, Software Development
---------------------------------------------------------
Rosenheimer Str. 145e 81671 München
Tel. +49 89 189 169 80 mailto:John.Webber@jentro.com
Fax +49 89 189 169 99 http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may
otherwise be legally privileged. It is intended for the named recipient
only. If you have received it in error, please notify us immediately by
reply or by calling the telephone number above and delete this message
and all its attachments without any use or further distribution of its
contents. Please note that any unauthorised review, copying, disclosing
or otherwise making use of the information is strictly prohibited. Thank
you.
---------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re[2]: XSP and service manager
Posted by sz...@op.pl.
Hello John,
Monday, October 18, 2004, 9:02:11 AM, you wrote:
JLW> Hello,
JLW> It would help to send the complete stack trace. Where does the manager
JLW> variable come from?
And that is the problem ... it looks like manager is definied in base class
of any XSP class. Correct me if i'm wrong.
Stracktrace is stupid as any Cocoon exception and dont say anything
about error ... well its error while compiling XSP- it claims
that ";" is missing... i think propably its problem with some import
- compiler does not recognize some type.
--
Best regards,
szefu18
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: XSP and service manager
Posted by "John L. Webber" <Jo...@jentro.com>.
Hello,
It would help to send the complete stack trace. Where does the manager
variable come from?
John
szefu18@op.pl wrote:
> Hello ml users,
>
> Why this simple code doesnt work? I get compile error when try+catch
> block is not commented
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
> <xsp:structure>
>
> <xsp:include>org.apache.avalon.excalibur.datasource.DataSourceComponent</xsp:include>
> <xsp:include>java.sql.DriverManager</xsp:include>
> <xsp:include>java.sql.Connection</xsp:include>
> <xsp:include>org.apache.avalon.framework.component.ComponentSelector</xsp:include>
> <xsp:include>org.apache.avalon.framework.component.ComponentException</xsp:include>
> </xsp:structure>
> <xsp:logic>
> ComponentSelector dc = null;
> try {
> dc = (ComponentSelector) manager.lookup(DataSourceComponent.ROLE + "Selector");
> }catch(ComponentException cme) {}
>
>
> </xsp:logic>
>
> </xsp:page>
>
>
--
---------------------------------------------------------
Jentro Technologies GmbH
John L. Webber, Software Development
---------------------------------------------------------
Rosenheimer Str. 145e 81671 München
Tel. +49 89 189 169 80 mailto:John.Webber@jentro.com
Fax +49 89 189 169 99 http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may
otherwise be legally privileged. It is intended for the named recipient
only. If you have received it in error, please notify us immediately by
reply or by calling the telephone number above and delete this message
and all its attachments without any use or further distribution of its
contents. Please note that any unauthorised review, copying, disclosing
or otherwise making use of the information is strictly prohibited. Thank
you.
---------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org