You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ryan Heise <rh...@it.uts.edu.au> on 2002/11/08 07:41:54 UTC

my.roles file

I am trying to set up my own roles file according to this FAQ:

http://xml.apache.org/cocoon/faq/faq-configure-c2.html#faq-1

However, as soon as I add the user-roles attribute and restart cocoon,
it produces this error message in the catalina.out log file:

org.apache.commons.digester.Digester error
Parse Error at line 269 column 11: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:362)
at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:296)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1953)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:878)
...

Also, when I attempt to access a page served by cocoon, I get:

java.lang.NullPointerException
at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...

Any ideas?

Thanks,

Ryan

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Geoff Howard <co...@yahoo.com>.
> A patch to the FAQ I submitted has been applied, but
> the change has not 
> yet propagated to the web pages, it seems (why?).

Since the site is still statically served, it is only
occasionally updated from cvs.  The local docs
(running at localhost) should be correct and the live
site will follow soon - I think they shoot for every
few weeks, if memory serves.

Geoff Howard

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Kjetil Kjernsmo <kj...@kjernsmo.net>.
On Friday 08 November 2002 10:48, Ryan Heise wrote:

> 1. edited one line of cocoon.xconf to read:
>
> 	<cocoon version="2.0" user-roles="WEB-INF/my.roles">
>

Yep, they're wrong, it should read:
<cocoon version="2.0" user-roles="/WEB-INF/my.roles">
                                  ^

A patch to the FAQ I submitted has been applied, but the change has not 
yet propagated to the web pages, it seems (why?).

Best,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
kjetil@kjernsmo.net  webmaster@skepsis.no  editor@learn-orienteering.org
Homepage: http://www.kjetil.kjernsmo.net/


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2002-11-08 at 10:48, Ryan Heise wrote:
> On Fri, Nov 08, 2002 at 09:44:39AM +0100, Joerg Heinicke wrote:
> > Hello Ryan,
> > 
> > the error message is non-ambiguous: You created a non-valid web.xml.
> > Remove the changes you did and add the roles at the correct place
> > according to the DTD.
> 
> Thanks for your reply..
> 
> Before I go tracking down the problem the hard way, can you tell me if
> these instructions are wrong?
> 
> 	http://xml.apache.org/cocoon/faq/faq-configure-c2.html#faq-1
> 
> 
> Here is what I did, I just:
> 
> 1. edited one line of cocoon.xconf to read:
> 
> 	<cocoon version="2.0" user-roles="WEB-INF/my.roles">
> 
> 2. created a file called WEB-INF/my.roles which I copied from
> src/java/org/apache/cocoon/cocoon.roles (first I tried copy&pasting the
> example from the FAQ, but that didn't work either)
> 

You should not copy the cocoon.roles file to my.roles. The my.roles file
is for declaring roles for *additional* components. When using the
my.roles file, all roles declared in cocoon.roles also continue to
exist.

> Just a point of clarification: is it true that cocoon.xconf and my.roles
> are just cocoon specific files, and not web.xml files (or included into
> web.xml files)?

Yes that is true.

If you want to know how all that works (from Java-developer viewpoint),
you should go read the developing with avalon guide at
http://jakarta.apache.org/avalon/developing/index.html

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Geoff Howard <co...@yahoo.com>.
> Before I go tracking down the problem the hard way,
> can you tell me if
> these instructions are wrong?
> 
> 
>
http://xml.apache.org/cocoon/faq/faq-configure-c2.html#faq-1
> 

I'm pretty sure you need a leading slash:
/WEB-INF/my.roles.  I don't know whether this would
cause the specific error you're seeing.  Search the
archives for user-roles: a few different people have
been through this recently.

Geoff Howard

> 1. edited one line of cocoon.xconf to read:
> 
> 	<cocoon version="2.0"
> user-roles="WEB-INF/my.roles">
> 
> 2. created a file called WEB-INF/my.roles which I
> copied from
> src/java/org/apache/cocoon/cocoon.roles (first I
> tried copy&pasting the
> example from the FAQ, but that didn't work either)


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Ryan Heise <rh...@it.uts.edu.au>.
On Fri, Nov 08, 2002 at 09:44:39AM +0100, Joerg Heinicke wrote:
> Hello Ryan,
> 
> the error message is non-ambiguous: You created a non-valid web.xml.
> Remove the changes you did and add the roles at the correct place
> according to the DTD.

Thanks for your reply..

Before I go tracking down the problem the hard way, can you tell me if
these instructions are wrong?

	http://xml.apache.org/cocoon/faq/faq-configure-c2.html#faq-1


Here is what I did, I just:

1. edited one line of cocoon.xconf to read:

	<cocoon version="2.0" user-roles="WEB-INF/my.roles">

2. created a file called WEB-INF/my.roles which I copied from
src/java/org/apache/cocoon/cocoon.roles (first I tried copy&pasting the
example from the FAQ, but that didn't work either)

I think I followed the instructions exactly. Could it be that these
instructions are ambiguous or wrong?

(Note: if I reverse step (1), the error message goes away)

Just a point of clarification: is it true that cocoon.xconf and my.roles
are just cocoon specific files, and not web.xml files (or included into
web.xml files)? Because, I only touched cocoon.xconf and my.roles.

Very confusing!

Thanks,

Ryan

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Ryan Heise <rh...@it.uts.edu.au>.
On Fri, Nov 08, 2002 at 09:44:39AM +0100, Joerg Heinicke wrote:
> Hello Ryan,
> 
> the error message is non-ambiguous: You created a non-valid web.xml.
> Remove the changes you did and add the roles at the correct place
> according to the DTD. The important snippet of it you can see in the 
> error message. If you need more information have a look into the servlet 
> spec.

You're right, I had created a non-valid web.xml at some point in the
past (my session-config came after mime-mapping instead of before).

What puzzled me was that adding the user-roles attribute in cocoon.xconf
caused tomcat to detect the error in my web.xml file. Strange...

Ryan

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Re: my.roles file

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Ryan,

the error message is non-ambiguous: You created a non-valid web.xml.
Remove the changes you did and add the roles at the correct place
according to the DTD. The important snippet of it you can see in the 
error message. If you need more information have a look into the servlet 
spec.

Regards,

Joerg

Ryan Heise wrote:
 > I am trying to set up my own roles file according to this FAQ:
 >
 > http://xml.apache.org/cocoon/faq/faq-configure-c2.html#faq-1
 >
 > However, as soon as I add the user-roles attribute and restart
 > cocoon, it produces this error message in the catalina.out log file:
 >
 > org.apache.commons.digester.Digester error Parse Error at line 269
 > column 11: The content of element type "web-app" must match
 > "(icon?,display-name?,description?,distributable?,context-param*,serv-
 > let*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list-
 > ?,error-page*,taglib*,resource-ref*,security-constraint*,login-config-
 > ?,security-role*,env-entry*,ejb-ref*)".
 > org.xml.sax.SAXParseException: The content of element type "web-app"
 > must match
 > "(icon?,display-name?,description?,distributable?,context-param*,serv-
 > let*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list-
 > ?,error-page*,taglib*,resource-ref*,security-constraint*,login-config-
 > ?,security-role*,env-entry*,ejb-ref*)". at
 > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Er-
 > rorHandlerWrapper.java:232) at
 > org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.-
 > java:173) at
 > org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.-
 > java:362) at
 > org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.-
 > java:296) at
 > org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDVal-
 > idator.java:1953) at
 > org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator-
 > .java:878) ...
 >
 > Also, when I attempt to access a page served by cocoon, I get:
 >
 > java.lang.NullPointerException at
 > org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:999)
 >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ...
 >
 > Any ideas?
 >
 > Thanks,
 >
 > Ryan


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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