You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Harrison <pe...@nothingbutnet.co.nz> on 2003/08/21 02:13:09 UTC
Tomcat 4.1 DefaultContext Bug?
I have spent the last three days trying everything to move from 4.0 to 4.1.
The problem is with the datasources. When the resource is in a specific
Context everything works, but when its in the DefaultContext I am getting a
java.sql.SQLException: Cannot load JDBC driver class 'null'
The server.xml has a resource defined:
<Resource name="jdbc/foo" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/foo">
<parameter><name>user</name><value>foo</value></parameter>
<parameter><name>password</name><value>bar</value></parameter>
<parameter><name>driverClassName</name>
<value>org.postgresql.Driver</value></parameter>
<parameter><name>url</name>
<value>jdbc:postgresql://localhost/foo</value></parameter>
</ResourceParams>
My web.xml now has:
<resource-ref>
<description>Foo Database</description>
<res-ref-name>jdbc/foo</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
The driver is there - since I it works when the Context is specific. The
problem however is that a Context that is specified will block unpacking of a
war. There are some issues with using the war directly without unpacking - so
I need to define the datasource in the DefaultContext. However this isn't
working.
Simply changing from DefaultContext to Context "solves" the problem - proving
that it is the DefaultContext which doesn't appear to work.
Help :)
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Tomcat 4.1 DefaultContext Bug?
Posted by Peter Harrison <pe...@nothingbutnet.co.nz>.
On Thu, 21 Aug 2003 15:26, Kwok Peng Tuck wrote:
> Specifically what problems do you have when running the app as a war
> file ?
The main problem I think is that Velocity requires files. You supply the
directory, and it accesses them from the filesystem. If you don't unpack
Velocity can't find its files. There is probably a way around this so that
Velocity can use the war directly, however I was hoping to simply migrate
from 4.0 to 4.1, and was hoping it would just be a minor configuration issue
to get it going.
I've read the 4.1 documentation, and from what I can see the specification in
terms of the DefaultContext hasn't changed, although they are definitly
behaving differently. Perhaps its time to look at the code :)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Tomcat 4.1 DefaultContext Bug?
Posted by Peter Harrison <pe...@nothingbutnet.co.nz>.
On Thu, 21 Aug 2003 15:26, Kwok Peng Tuck wrote:
> Specifically what problems do you have when running the app as a war
> file ?
The main problem I think is that Velocity requires files. You supply the
directory, and it accesses them from the filesystem. If you don't unpack
Velocity can't find its files. There is probably a way around this so that
Velocity can use the war directly, however I was hoping to simply migrate
from 4.0 to 4.1, and was hoping it would just be a minor configuration issue
to get it going.
I've read the 4.1 documentation, and from what I can see the specification in
terms of the DefaultContext hasn't changed, although they are definitly
behaving differently. Perhaps its time to look at the code :)
Re: Server.xml
Posted by Bill Barker <wb...@wilshire.com>.
Of course, one way is to comment out the http connector. The other way is
to include a security-constraint in your web.xml something like:
<security-constraint>
<web-resource-collection>
<web-resource-name>SSL area</web-resource-name>
<url-pattern>/protected/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
This forces all URLs under /myapp/protected to use SSL to process them. Of
course, modify the url-pattern to match your use case.
You can only configure this per-directory with Tomcat-out-of-the-box. To
configure this per-user, you would need to write your own Filter to do this.
"Sarika Inamdar " <si...@cisco.com> wrote in message
news:02a501c3679c$57001c50$cc064d0a@apac.cisco.com...
> Hi,
>
> We are using tomcat 4.1.24. The server.xml has configuration for http
> and https.
>
> Now if user wants to disable http and use only https, is there a way to
> do that in server.xml.
>
> One way is to comment the config of http is server.xml But we don't want
> to pursure in this direction.
>
> Is there any property we can set in server.xml to disable htpp or https
> based on user preferece.
>
> Please help me on this.
>
> Thanks Much in Advance,
> Sarika
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Server.xml
Posted by Bill Barker <wb...@wilshire.com>.
Of course, one way is to comment out the http connector. The other way is
to include a security-constraint in your web.xml something like:
<security-constraint>
<web-resource-collection>
<web-resource-name>SSL area</web-resource-name>
<url-pattern>/protected/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
This forces all URLs under /myapp/protected to use SSL to process them. Of
course, modify the url-pattern to match your use case.
You can only configure this per-directory with Tomcat-out-of-the-box. To
configure this per-user, you would need to write your own Filter to do this.
"Sarika Inamdar " <si...@cisco.com> wrote in message
news:02a501c3679c$57001c50$cc064d0a@apac.cisco.com...
> Hi,
>
> We are using tomcat 4.1.24. The server.xml has configuration for http
> and https.
>
> Now if user wants to disable http and use only https, is there a way to
> do that in server.xml.
>
> One way is to comment the config of http is server.xml But we don't want
> to pursure in this direction.
>
> Is there any property we can set in server.xml to disable htpp or https
> based on user preferece.
>
> Please help me on this.
>
> Thanks Much in Advance,
> Sarika
Server.xml
Posted by Sarika Inamdar <si...@cisco.com>.
Hi,
We are using tomcat 4.1.24. The server.xml has configuration for http
and https.
Now if user wants to disable http and use only https, is there a way to
do that in server.xml.
One way is to comment the config of http is server.xml But we don't want
to pursure in this direction.
Is there any property we can set in server.xml to disable htpp or https
based on user preferece.
Please help me on this.
Thanks Much in Advance,
Sarika
Server.xml
Posted by Sarika Inamdar <si...@cisco.com>.
Hi,
We are using tomcat 4.1.24. The server.xml has configuration for http
and https.
Now if user wants to disable http and use only https, is there a way to
do that in server.xml.
One way is to comment the config of http is server.xml But we don't want
to pursure in this direction.
Is there any property we can set in server.xml to disable htpp or https
based on user preferece.
Please help me on this.
Thanks Much in Advance,
Sarika
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Tomcat 4.1 DefaultContext Bug?
Posted by Kwok Peng Tuck <pe...@makmal.net>.
Specifically what problems do you have when running the app as a war
file ?
Peter Harrison wrote:
>I have spent the last three days trying everything to move from 4.0 to 4.1.
>The problem is with the datasources. When the resource is in a specific
>Context everything works, but when its in the DefaultContext I am getting a
>
>java.sql.SQLException: Cannot load JDBC driver class 'null'
>
>The server.xml has a resource defined:
>
><Resource name="jdbc/foo" auth="Container" type="javax.sql.DataSource"/>
>
><ResourceParams name="jdbc/foo">
> <parameter><name>user</name><value>foo</value></parameter>
> <parameter><name>password</name><value>bar</value></parameter>
> <parameter><name>driverClassName</name>
> <value>org.postgresql.Driver</value></parameter>
> <parameter><name>url</name>
> <value>jdbc:postgresql://localhost/foo</value></parameter>
></ResourceParams>
>
>My web.xml now has:
>
> <resource-ref>
> <description>Foo Database</description>
> <res-ref-name>jdbc/foo</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
>
>The driver is there - since I it works when the Context is specific. The
>problem however is that a Context that is specified will block unpacking of a
>war. There are some issues with using the war directly without unpacking - so
>I need to define the datasource in the DefaultContext. However this isn't
>working.
>
>Simply changing from DefaultContext to Context "solves" the problem - proving
>that it is the DefaultContext which doesn't appear to work.
>
>Help :)
>
>Peter
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>
Re: Tomcat 4.1 DefaultContext Bug?
Posted by Kwok Peng Tuck <pe...@makmal.net>.
Specifically what problems do you have when running the app as a war
file ?
Peter Harrison wrote:
>I have spent the last three days trying everything to move from 4.0 to 4.1.
>The problem is with the datasources. When the resource is in a specific
>Context everything works, but when its in the DefaultContext I am getting a
>
>java.sql.SQLException: Cannot load JDBC driver class 'null'
>
>The server.xml has a resource defined:
>
><Resource name="jdbc/foo" auth="Container" type="javax.sql.DataSource"/>
>
><ResourceParams name="jdbc/foo">
> <parameter><name>user</name><value>foo</value></parameter>
> <parameter><name>password</name><value>bar</value></parameter>
> <parameter><name>driverClassName</name>
> <value>org.postgresql.Driver</value></parameter>
> <parameter><name>url</name>
> <value>jdbc:postgresql://localhost/foo</value></parameter>
></ResourceParams>
>
>My web.xml now has:
>
> <resource-ref>
> <description>Foo Database</description>
> <res-ref-name>jdbc/foo</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
>
>The driver is there - since I it works when the Context is specific. The
>problem however is that a Context that is specified will block unpacking of a
>war. There are some issues with using the war directly without unpacking - so
>I need to define the datasource in the DefaultContext. However this isn't
>working.
>
>Simply changing from DefaultContext to Context "solves" the problem - proving
>that it is the DefaultContext which doesn't appear to work.
>
>Help :)
>
>Peter
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org