Hello Jetspeed Community,
is it possible to use a JNDI datasource within a portlet deployed on
jetspeed 2. The datasource itself seems to work because I can use it in
a test servlet. But my portlets cann't access it through JNDI. I
configured the datasource as JNDI resource in the tomcate server.xml
file. The file $CATALINA_HOME/conf/server.xml therefore contains a
'global naming section':
...
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Forum DB -->
<Resource
auth="Container"
driverClassName="org.postgresql.Driver"
maxActive="20"
maxIdle="10"
maxWait="-1"
name="jdbc/forum"
password="xxxxx"
type="javax.sql.DataSource"
url="jdbc:postgresql://192.168.3.102:5432/forum"
username="forum"/>
</GlobalNamingResources>
Then I linked the resource to the jetspeed context. The file
$CATALINA_HOME/conf/Catalina/localhost/jetspeed.xml therefore contains a
reference to resource:
<Context path="/jetspeed" docBase="jetspeed" crossContext="true">
...
<ResourceLink global="jdbc/forum" name="jdbc/forum"
type="javax.sql.DataSource"/>
</Context>
And finally I added to the file:
$CATALINA_HOME/webapps/jetspeed/WEB-INF/web.xml the reference to the
datasource:
<web-app>
<display-name>Jetspeed-2 Enterprise Portal</display-name>
...
<resource-ref>
<description>Forum DB Connection</description>
<res-ref-name>jdbc/forum</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...
</web-app>
Normally (if this would be a simple servlet) the datasource would now be
accessable through a JNDI lookup. As I said a little while ago, I tested
this with a simple standalone servlet deployed in tomcat. But the JNDI
lookup fails in my portlets. Adding the <resource-ref> to the web.xml
file of the portlet also didn't work. Has anyone experience on this?
Best regards,
Alexander
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]