I believe that's a mistake in the book.  You need to use an absolute path to
the resource from the application context root: /WEB-INF/myroles.xconf

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

You can also search the archives for user-roles and you'll find a few
threads on the subject.

Geoff

> -----Original Message-----
> From: Marc Wilhelm Kuster [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 1:08 PM
> To: [EMAIL PROTECTED]
> Subject: User roles in extra file
>
>
> Hi!
>
> For a project I have developed a Cocoon / Avalon component to send SMS
> messages from within cocoon. Trying to define this as a role in a file
> by itself as described in Cocoon: Building XML Applications, p. 291. I
> modified cocoon.xconf:
>
> <cocoon version="2.0" user-roles="WEB-INF/myroles.xconf">
> </cocoon>
>
> (even though myroles.xconf and cocoon.xconf are in the same directory,
> Cocoon utterly fails to find myroles.xconf at all without the WEB-INF
> prefix).
>
> However, Cocoon refuses to start up and  fails with the following
> stacktrace.
>
>
> ERROR   (2003-01-14) 18:34.53:664   [access] (Unknown-URI)
> Unknown-thread/CocoonServlet: Exception reloading
> org.apache.avalon.framework.configuration.ConfigurationException: Error
> trying to load user-roles configuration
>       at org.apache.cocoon.Cocoon.configure(Cocoon.java:400)
>       at org.apache.cocoon.Cocoon.initialize(Cocoon.java:284)
>       at
> org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet
> .java:1340)
>       at
> org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:507)
>       at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapp
> er.java:934)
>       at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
>       at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardCon
> text.java:3420)
>       at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3608)
>       at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerB
> ase.java:821)
>       at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
>       at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
>       at
> org.apache.catalina.core.StandardHostDeployer.install(StandardHost
> Deployer.java:257)
>       at
> org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
>       at
> org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:502)
>       at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:410)
>       at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
>       at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)
>       at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifec
> ycleSupport.java:166)
>       at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
>       at
> org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>       at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>       at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>       at
> org.apache.catalina.core.StandardService.start(StandardService.java:497)
>       at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
>       at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
>       at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>       at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
> pl.java:39)
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
> cessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:324)
>       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> Caused by: java.io.FileNotFoundException
>       at
> org.apache.naming.resources.DirContextURLConnection.getInputStream
> (DirContextURLConnection.java:344)
>       at java.net.URL.openStream(URL.java:955)
>       at org.apache.cocoon.Cocoon.configure(Cocoon.java:395)
>       ... 31 more
> java.io.FileNotFoundException
>       at
> org.apache.naming.resources.DirContextURLConnection.getInputStream
> (DirContextURLConnection.java:344)
>       at java.net.URL.openStream(URL.java:955)
>       at org.apache.cocoon.Cocoon.configure(Cocoon.java:395)
> [snip]
>
> System:
> Windows 2000
> JDK 1.4
> Tomcat 4.1.18
> Cocoon: Cocoon-dev, 2002-01-10
>
> Exactly the same issue was pointed out on this list by Kjetil Kjernsmo
> in 2002-10-27, but AFAICS has never been solved.
>
> I would appreciate it very much if somebody could point out how to
> access an external roles file from within cocoon.xconf today.
>
> Thanks and best regards,
>
> Marc
>
>
>
> ---------------------------------------------------------------------
> 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:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>
>


---------------------------------------------------------------------
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:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to