 |  |  |
 |
When I try to use the Connection pooling code, I get the following exception:
"Could not get the datasource java.sql.SQLException: You cannot
get a Poolable before the pool is initialized". What's going on?
|  |
 |  |  |
 |  |  |
 |
What are the steps to pre-compile the sitemap and XSP's?
|  |
 |  |  |
- Set the "work-directory" parameter in web.xml as follows:
 |  |  |
 |
<init-param>
<param-name>work-directory</param-name>
<param-value>WEB-INF/classes</param-value>
</init-param>
|  |
 |  |  |
- Set the auto-reload to false in your sitemap.xmap as follows:
 |  |  |
 |
<parameter name="auto-reload" value="false"/>
|  |
 |  |  |
- Use "-Dcompile.xsp=yes" in your build command line when you are
building your WAR file.
|
 |  |  |
 |
How do i setup my own .roles file?
|  |
 |  |  |
 |  |  |
 | I don't want to hand edit the sitemap. Are there any
tools? |  |
 |  |  |
 |  |  |
 | How do I create some content which isn't directly visible to
everyone? |  |
 |  |  |
 |  |  |
 | How can I concatenate two xml files? |  |
 |  |  |
 |  |  |
 | When I add an action to a pipeline Cocoon returns an
error. |  |
 |  |  |
 |  |  |
 | How could I have my Cocoon app in an URI other than
<you-server>/cocoon/<my-app>?
|  |
 |  |  |
 | This entry refers only to an Apache + Tomcat + Cocoon configuration,
and was tested under: Windows NT 4.0 + Apache 1.3.14 + Tomcat 3.2 + Cocoon
2.0b1.
|
Test whether Tomcat passes everything under the /cocoon context to
Cocoon. This may be tested by pointing your browser at
<your-server>:8080/cocoon/xsp/simple, if a text page named
"A simple XSP page", everything's fine.
Now, suppose:
- you have a Cocoon application named "foo" which works fine when
called with <your-server>:8080/cocoon/foo
- you want the "foo" app to be called from
<your-server>:8080/foo instead.
The idea is just to redirect the desidered URI (foo) to the one within
the cocoon context (cocoon/foo).
Since this has to be done before the URI is processed by Tomcat, it is
just natural to use Apache for this. And, of course the user should not
notice the redirection.
Apache has an handy feature called mod_rewrite which does just this: URI
rewriting (see the "URL Rewriting Guide" in the Apache user's guide for
details).
First of all, you should instruct Apache to load the mod_rewrite, hence,
you should add (on a Windows system) this line to the httpf.conf:
 |  |  |
 |
LoadModule rewrite_module modules/ApacheModuleRewrite.dll
|  |
 |  |  |
(by the way, most probably, this line is already on the httpd.conf, you
just have to un-comment it).
Add this line to httpd.conf in order to activate mod_rewrite:
It is highly recommended to use the logging option of mod_rewrite, in
order to check the correctness of the URI rewriting; just add this lines
to the httpd.conf:
 |  |  |
 |
RewriteLog "C:/logs/rewrite.log"
RewriteLogLevel 9
|  |
 |  |  |
The first line tells Apache to put the URI rewriting log in the
c:\logs\rewrite.log file (which happens to be on a Windows system, of
course). The second one tells Apache to record everything mod_rewrite
does, if you don't want to log anything, just set the RewriteLogLevel to
0.
Now, it's time to do the URI rewriting trick:
 |  |  |
 |
RewriteRule foo/(.*) /cocoon/foo/$1 [PT]
|  |
 |  |  |
This line instructs Apache to redirect everything under "foo" to
"cocoon/foo" and passes it on to other processing ("[PT]" option),
like mod_alias.
Now, just restart Apache and point your browser to:
 |  |  |
 |
<your-server>:8080/foo/<something>...
|  |
 |  |  |
it should work just fine.
|
 |  |  |
 | How could I have my Cocoon app in a directory other than
$TOMCAT_HOME/webapps/cocoon/<my-app>?
|  |
 |  |  |
 |  |  |
 |
How do i hide "cocoon" in the URL's once i integrate using mod_jk as shown above?
|  |
 |  |  |
Basically to use http://your.server.org/Foo/welcome (as an example) instead of
http://your.server.org/cocoon/Foo/welcome . You need the following two modifications:
Step #1: Add the following lies to to httpd.conf.
 |  |  |
 |
RewriteEngine On
RewriteLog "/var/log/rewrite.log"
RewriteLogLevel 0
RewriteRule ^/Foo /cocoon/Foo/ [R]
RewriteRule ^/Foo(.*) /cocoon/Foo$1 [R]
|  |
 |  |  |
The file rewrite.log does not have to be located in /var/log . For
instance, under Windows NT other locations may be appropriate. The
RewriteLogLevel should be set 3 for debug purposes. The third line is
essentially a redirect, so that Foo becomee /cocoon/Foo/ with the
trailing / , without it the request would not map onto
 |  |  |
 |
<map:match pattern="">
<map:redirect-to uri="welcome" />
</map:match>
|  |
 |  |  |
when you I request http://your.server.org/Foo .
Finally, the last RewriteRule could depend on the local settings.
The original suggestion by Luca was a single line entry (that replaces
both RewriteRules above) according to:
 |  |  |
 |
RewriteRule Foo/(.*) /cocoon/Foo/$1 [PT]
|  |
 |  |  |
 |
This did not work in my case (Slackware Linux with Apache1.3,
tomcat3.2.2, Cocoon). Again, these RewriteRules may vary somewhat
depending on the local settings. You may have to experiment a bit.
|
Step #2: Add to the sitemap.xmap in the cocoon directory.
 |  |  |
 |
<map:pipeline>
<map:match pattern="Foo/**">
<map:mount uri-prefix="Fru" src="/www/Foo/"
check-reload="yes" reload-method="synchron"/>
</map:match>
</map:pipeline>
|  |
 |  |  |
Here, /www/Foo is a some directory on the local file system where the
xml, xsp, .., files of the application Foo live.
 |
The src attribute may have to include "file://"
|
|
 |  |  |
 |
How can I run Cocoon without X11. Why is a Display needed?
|  |
 |  |  |
 |  |  |
 |
How do i debug Cocoon using JDK1.3+?
|  |
 |  |  |
|