You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave Pawson <da...@gmail.com> on 2009/02/04 14:35:47 UTC

servlet use. TC6, FC10

I now have a tiny class file for context 'atom'.

Loaded
{catalina-home}/webapps/atom/WEB-INF/web.xml
and
/classes/SimpleServlet.class
plus
/lib/ .... couple of jars needed

I'm failing to run the app, possibly because of this logged error?

[Loaded java.net.Proxy from shared objects file]
[Loaded java.net.Proxy$Type from shared objects file]
Feb 4, 2009 1:29:36 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Feb 4, 2009 1:29:36 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.UnknownHostException: marge.localdomain: marge.localdomain
	at java.net.InetAddress.getLocalHost(InetAddress.java:1353)

Note:

[root@marge apps]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1	localhost localhost.localdomain		marge	marge
::1	localhost.localdomain	localhost6	localhost	marge	marge
10.0.0.137	homer

AFAIK TC uses the first entry for 127, i.e. localhost, rather than
subsequent ones?
Yet it's blowing up over that one?

Any suggestions please.

TIA



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Gregor Schneider <rc...@googlemail.com>.
Dave,

On Wed, Feb 4, 2009 at 8:50 PM, Dave Pawson <da...@gmail.com> wrote:
> 2009/2/4 Caldarale, Charles R <Ch...@unisys.com>:
>>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>>> Subject: Re: servlet use. TC6, FC10
>>>
>>> 2009/2/4 Gregor Schneider <rc...@googlemail.com>:
>>> > what gives "uname -n" ?
>>>
>>> 2.6.27.12-170.2.5.fc10.i686
>>
>> Is it just me, or does that look like a really, really weird result for uname -n?  Did someone mistake an "n" for an "r"?
>
>
> Its the kernel version, as generated by FC10?
> How does that help please Gregor?
>

First: Please post to the mailing-list so that others are able to participate

Second: "uname -n" in Linux gives the hostname which is set and known
to the Java-subsystem.

"uname -r" gives, as you stated correctly, the kernel-version which is
of no use in this context.

As Chuck pointed out, I guess you mixed up the "n" with a "r"

HTH

Gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> Not my idea of 'hello world' Charles?
>   (Closer to 'go write a device driver for this real time Unix mc :-)
> I'm guessing you've used TC for a while... or longer?

Nothing in the proffered link was Tomcat-specific (it did make use of Spring, which is a commonly-used framework in servlet container environments).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>
>> <aside> Is there a basic 'hello world' restlet that should just 'work'
>> please</aside>
>
> GIYF:

Indeed (Last time I tried a day without internet access I most definately
realised this :0(

> http://temporary.name/java/index.php/spring/restlet-spring-integration

View from the other side.
Not my idea of 'hello world' Charles?
  (Closer to 'go write a device driver for this real time Unix mc :-)

I'm guessing you've used TC for a while... or longer?

regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10

> <aside> Is there a basic 'hello world' restlet that should just 'work'
> please</aside>

GIYF:
http://temporary.name/java/index.php/spring/restlet-spring-integration

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> I meant to application/xml rather than ... https type!

I'm confused; what kind of access restrictions are you referring to?  And whom do you want to restrict?

(Perhaps this would be better under a new thread, as you suggested.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>
>> I want to start looking at restricting access now, but I'll start a
>> new thread for that!
>
> Read section 12 of the servlet spec first.

<chuckles/>
Different kind of restriction in mind?

I meant to application/xml rather than ... https type!


section???

I wish there was an index to the docs.
I'm beginning to think it's all there... just hard to find?

regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10

> I want to start looking at restricting access now, but I'll start a
> new thread for that!

Read section 12 of the servlet spec first.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>>
>> Thanks Chaz. Now works.
>
> That was Gregor, not me, that gave you the answer.  (Our corporate e-mail server hasn't passed your previous message through yet - must be a Homeland Security thing. :-)

I'm sure Obama will fix that :-)
Sorry Gregor. And many thanks.


>
>> Are you going to tell me why please?
>
> Servlet mappings are relative to the context (webapp) part of the URL, not the host part.  That allows the webapp to be deployed under any name you want without changing the web.xml settings.


Just testing my understanding.
Not relative to ../webapp but relative to (in this case) .../webapps/atom
hence I should use the url path relative to http://localhost:8080/atom
which, as you say is /*

So that my code would pick up http://localhost:8080/atom/AlmostAnything

Thanks. That makes sense.... and helps (I think)
When I deploy (upload) to my web visible server, the web.xml file will
remain the same!


I'm going to write this up. I'll post to this list and would appreciate
any feedback.

I want to start looking at restricting access now, but I'll start a
new thread for that!

Many thanks gents.

regards


regards

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> Thanks Chaz. Now works.

That was Gregor, not me, that gave you the answer.  (Our corporate e-mail server hasn't passed your previous message through yet - must be a Homeland Security thing. :-)

> Are you going to tell me why please?

Servlet mappings are relative to the context (webapp) part of the URL, not the host part.  That allows the webapp to be deployed under any name you want without changing the web.xml settings.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Gregor Schneider <rc...@googlemail.com>:
> Just had a quick view, but if I'm not mistaken:
>
> Change
>
>   <servlet-mapping>
>       <servlet-name>atom</servlet-name>
>       <url-pattern>/atom/*</url-pattern>
>   </servlet-mapping>
>
> to
>
>   <servlet-mapping>
>       <servlet-name>atom</servlet-name>
>       <url-pattern>/*</url-pattern>
>   </servlet-mapping>

:-)

Thanks Chaz. Now works.

Are you going to tell me why please?

regards





-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Gregor Schneider <rc...@googlemail.com>.
Just had a quick view, but if I'm not mistaken:

Change

   <servlet-mapping>
       <servlet-name>atom</servlet-name>
       <url-pattern>/atom/*</url-pattern>
   </servlet-mapping>

to

   <servlet-mapping>
       <servlet-name>atom</servlet-name>
       <url-pattern>/*</url-pattern>
   </servlet-mapping>

Rgds

Gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:

>> I created a context element in META-INF, filename atom.xml
>> contents are
>>
>> <Context         reloadable="true"/>
>
> O.K.
>
>> Nothing showing in the log.
>> http://marge:8080/atom/  shows
>>
>> type Status report
>> message /atom/
>> description The requested resource (/atom/) is not available.
>
> And what is under the webapps/atom directory (or inside the webapps/atom.war file)?

[dpawson@marge webapps]$ tree atom
atom
|-- META-INF
|   |-- context.xml
|   `-- context.xml~
`-- WEB-INF
    |-- classes
    |   `-- SimpleServlet.class
    |-- lib
    |   |-- com.noelios.restlet.ext.servlet_2.5.jar
    |   |-- com.noelios.restlet.jar
    |   `-- org.restlet.jar
    |-- web.xml
    `-- web.xml~




> What's in WEB-INF/web.xml of your webbapp?

[dpawson@marge webapps]$ cat atom/WEB-INF/web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>


<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">

    <description>
      Servlet example using atom.
    </description>
    <display-name>Atom example</display-name>




    <!-- Define servlets that are included in the  application -->

    <servlet>
        <servlet-name>atom</servlet-name>
        <servlet-class>SimpleServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>atom</servlet-name>
        <url-pattern>/atom/*</url-pattern>
    </servlet-mapping>







 Do you have any welcome files in your webapp?

I had an index.html in .../atom
http://marge:8080/atom/index.html
showed that fine.

>
>> Hence my request for a 'hello' world to try and get a (any?)
>> servlet working
>
> Do the sample servlets that come with Tomcat work?  Most of those are small and easy to modify for experimentation purposes.

<grin/> 'Thats a view' as my manager used to say.

Yes.

http://marge:8080/examples/servlets/servlet/HelloWorldExample  works fine.
I was put off by the complexity of the examples hence avoided copying them
and 'stripping out' the ??? unecessary parts.


regards

(Help appreciated btw)


-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> My interpretation, seemingly wrong is that my servlet class must
> implement org.apache.catalina.Context.

Definitely the wrong interpretation.  Read the servlet spec.

> I created a context element in META-INF, filename atom.xml
> contents are
>
> <Context         reloadable="true"/>

O.K.

> Nothing showing in the log.
> http://marge:8080/atom/  shows
>
> type Status report
> message /atom/
> description The requested resource (/atom/) is not available.

And what is under the webapps/atom directory (or inside the webapps/atom.war file)?  What's in WEB-INF/web.xml of your webbapp?  Do you have any welcome files in your webapp?

> Hence my request for a 'hello' world to try and get a (any?)
> servlet working

Do the sample servlets that come with Tomcat work?  Most of those are small and easy to modify for experimentation purposes.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>>
>> I was wondering if there was a two liner that implements
>> org.apache.catalina.Context as per the classname attribute
>> at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html?
>> which I might use to get started?
>
> ??? Why would you *ever* want to set the className attribute to anything other than the default?  This is for Tomcat internal use, not something an application programmer would fiddle with.

Quote. Java class name of the implementation to use. This class must
implement the org.apache.catalina.Context interface. If not specified,
the standard value (defined below) will be used.
end quote.

My interpretation, seemingly wrong is that my servlet class must
implement org.apache.catalina.Context.
Duly noted. Sorry.

I created a context element in META-INF, filename atom.xml

contents are

<Context 	 reloadable="true"/>

Nothing showing in the log.
http://marge:8080/atom/  shows

type Status report
message /atom/
description The requested resource (/atom/) is not available.

http://localhost:8080/atom/  just the same.

Hence my request for a 'hello' world to try and get a (any?) servlet working

regards






-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 André Warnier <aw...@ice-sa.com>:

> [OT]
> I was just checking that page indicated above, and happened to read the
> "caseSensitive" attribute definition.
> Doesn't that explanation strike anyone as weird ?
> Or am I just not getting the double negatives somewhere ?
>
> I would expect a "caseSensitive" attribute to have a default value "false"
> under Windows for example.
> Or else be named "caseInsensitive" and be true.


Possibly, with a Windows perspective?
All of Linux is case sensitive in terms of paths so I guess not
with that perspective?

Sounds good to me, meaning use Catalina as apposed to catalina?



regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: [OT] servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: [OT] servlet use. TC6, FC10
>
> I was just checking that page indicated above, and happened
> to read the "caseSensitive" attribute definition.
> Doesn't that explanation strike anyone as weird ?

Only if you're not aware that both Java and URLs are case-sensitive.

> Or am I just not getting the double negatives somewhere ?

Nope, you're not :-)

> I would expect a "caseSensitive" attribute to have a default value
> "false" under Windows for example.

Because the Windows file system is not case sensitive, it would be easy to accidentally expose mandated hidden resources via such URLs as:
    http://host/myApp/wEb-Inf/dont-look-here.jsp
if case sensitivity were disabled in Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] servlet use. TC6, FC10

Posted by André Warnier <aw...@ice-sa.com>.
Caldarale, Charles R wrote:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>>
>> I was wondering if there was a two liner that implements
>> org.apache.catalina.Context as per the classname attribute
>> at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html?
>> which I might use to get started?
> 
[OT]
I was just checking that page indicated above, and happened to read the 
"caseSensitive" attribute definition.
Doesn't that explanation strike anyone as weird ?
Or am I just not getting the double negatives somewhere ?

I would expect a "caseSensitive" attribute to have a default value 
"false" under Windows for example.
Or else be named "caseInsensitive" and be true.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> I was wondering if there was a two liner that implements
> org.apache.catalina.Context as per the classname attribute
> at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html?
> which I might use to get started?

??? Why would you *ever* want to set the className attribute to anything other than the default?  This is for Tomcat internal use, not something an application programmer would fiddle with.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Gregor Schneider <rc...@googlemail.com>:
> On Thu, Feb 5, 2009 at 3:20 PM, Dave Pawson <da...@gmail.com> wrote:

>> <aside> Is there a basic 'hello world' restlet that should just 'work'
>> please</aside>
>>
>
> Sorry, but we can't support every kind of software claiming to work
> within Tomcat.

No, agreed. I was wondering if there was a two liner that implements
org.apache.catalina.Context as per the classname attribute
at http://tomcat.apache.org/tomcat-6.0-doc/config/context.html?
which I might use to get started?

I want something simple working on TC before I try restlets?

regards


-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Gregor Schneider <rc...@googlemail.com>.
On Thu, Feb 5, 2009 at 3:20 PM, Dave Pawson <da...@gmail.com> wrote:
>
> I note that Charles says I don't need this unless I need to define a
> realm or other resources.
>

it's a wise decision to believe almost anything what Chuck mentions ;)

>
> <aside> Is there a basic 'hello world' restlet that should just 'work'
> please</aside>
>

Sorry, but we can't support every kind of software claiming to work
within Tomcat.

Might be a better idea to take a look here insted: http://www.restlet.org/

Rgds

Gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Gregor Schneider <rc...@googlemail.com>:

>> Which I interpret that to have my servlet deployed (found?) I need to
>> set up an XML file
>> as per that web page at
>> {}/conf/????/marge/atom.xml
>>
>
> Nope, you don't have to.
>
> Within your webapp, create a folder "META-INF", and within this folder
> create a file named "context.xml"
>
> An example:
>
> <?xml version='1.0' encoding='utf-8'?>
> <Context>
>  <Resource
> [.. put your ressource-defs here ]
> </Context>
>
> Tomcat's deployer will do the rest and put that file into the correct
> directory, after renaming the file to ${your_webapp_name}.xml

http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#A%20word%20on%20Contexts
mentions some of that.

I note that Charles says I don't need this unless I need to define a
realm or other resources.
My aim is a restlet servlet (uses Jars in the atom/lib directory).

I'll try based on    http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

<aside> Is there a basic 'hello world' restlet that should just 'work'
please</aside>


>
>> What's the engine name please?
>
> That's usually Catalina

Thanks Gregor.


regards


-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Gregor Schneider <rc...@googlemail.com>.
Hi Dave,

On Thu, Feb 5, 2009 at 2:52 PM, Dave Pawson <da...@gmail.com> wrote:
>
>
> From the docs "Context elements may be explicitly defined:
> .... <snip/>
>    * in individual files (with a ".xml" extension) in the
> $CATALINA_BASE/conf/[enginename]/[hostname]/ directory."
>
> Which I interpret that to have my servlet deployed (found?) I need to
> set up an XML file
> as per that web page at
> {}/conf/????/marge/atom.xml
>

Nope, you don't have to.

Within your webapp, create a folder "META-INF", and within this folder
create a file named "context.xml"

An example:

<?xml version='1.0' encoding='utf-8'?>
<Context>
  <Resource
[.. put your ressource-defs here ]
</Context>

Tomcat's deployer will do the rest and put that file into the correct
directory, after renaming the file to ${your_webapp_name}.xml

> What's the engine name please?

That's usually Catalina

Rgds

Gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>>
>> Note my response to Gregors questions about uname -n?
>> Were I to use this method would the 'path' then be
>>
>> $CATALINA_BASE/conf/Cataline/localhost/atom/atom.xml

            ^^^^^
>>
>> for my {}/webapps/atom  'webapp'
>
> No; if you need one at all, it should be conf/Catalina/localhost/atom.xml (and watch your spelling), assuming you have not modified anything in conf/server.xml.

Understood, as Gregor suggested.


>  However, since your webapp is deployed under the webapps directory, a better location for the <Context> element is META-INF/context.xml inside your webapp, so you don't have to keep track of separate bits and pieces.

Trying that now.


regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> Note my response to Gregors questions about uname -n?
> Were I to use this method would the 'path' then be
>
> $CATALINA_BASE/conf/Cataline/localhost/atom/atom.xml
>
> for my {}/webapps/atom  'webapp'

No; if you need one at all, it should be conf/Catalina/localhost/atom.xml (and watch your spelling), assuming you have not modified anything in conf/server.xml.  However, since your webapp is deployed under the webapps directory, a better location for the <Context> element is META-INF/context.xml inside your webapp, so you don't have to keep track of separate bits and pieces.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:

> The [engine] name is whatever it's configured to be in server.xml; the default is Catalina (case sensitive), and there's almost never a reason to change it.  The [host] name is NOT the DNS name, but rather the name of the associated <Host> element that you want your webapp to run under.  By default, this is localhost - but that is not associated with the hosts file localhost.
>
>  - Chuck

Oh dear!

Note my response to Gregors questions about uname -n?
Were I to use this method would the 'path' then be

$CATALINA_BASE/conf/Cataline/localhost/atom/atom.xml

for my {}/webapps/atom  'webapp'

regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/6 Gregor Schneider <rc...@googlemail.com>:
>> AFAIK I don't need any resource specification.

> Basically yes, however:
>
> In one of your previous posts you had the definition
>
> <Context reloadable="true">
>
> If you want this behaviour explicitely, you'll nee the context-definition.
>
> From the docs:
>
> ==== [ snip ] ==========
>
> Set to true if you want Catalina to monitor classes in
> /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically
> reload the web application if a change is detected. This feature is
> very useful during application development, but it requires
> significant runtime overhead and is not recommended for use on
> deployed production applications. That's why the default setting for
> this attribute is false. You can use the Manager web application,
> however, to trigger reloads of deployed applications on demand.
>
> ==== [ snap ] ==========
>
> Rgds
>
> Gregor

Certainly for development (this could be some time for me:-) it seems
worthwhile.

Just reading up on filters and valves, certainly for a valve I need
to specify it in webapps/atom/WEB-INF/context.xml
so (for the moment) I guess I'll leave it.

Thanks Gregor.



regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Gregor Schneider <rc...@googlemail.com>.
On Fri, Feb 6, 2009 at 1:06 PM, Dave Pawson <da...@gmail.com> wrote:
> One final item before I leave this thread please.
>
>
> AFAIK I don't need any resource specification.
> Does this mean that I can dispense with the atom/META-INF directory
> totally? I.e. it is redundant
> for this usage of Tomcat?
>
> atom
> |-- META-INF
> |   |-- context.xml
> |-- WEB-INF
> .....
>
Basically yes, however:

In one of your previous posts you had the definition

<Context reloadable="true">

If you want this behaviour explicitely, you'll nee the context-definition.

>From the docs:

==== [ snip ] ==========

Set to true if you want Catalina to monitor classes in
/WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically
reload the web application if a change is detected. This feature is
very useful during application development, but it requires
significant runtime overhead and is not recommended for use on
deployed production applications. That's why the default setting for
this attribute is false. You can use the Manager web application,
however, to trigger reloads of deployed applications on demand.

==== [ snap ] ==========

Rgds

Gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/6 Peter Crowther <Pe...@melandra.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> AFAIK I don't need any resource specification.
>> Does this mean that I can dispense with the atom/META-INF directory
>> totally? I.e. it is redundant
>> for this usage of Tomcat?
>>
>> atom
>> |-- META-INF
>> |   |-- context.xml
>> |-- WEB-INF
>> .....
>
> If you don't need anything in context.xml, you don't need the context.xml file.
>
> If there are no files in META-INF, you don't need the directory.

Thanks Peter.


regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by Peter Crowther <Pe...@melandra.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> AFAIK I don't need any resource specification.
> Does this mean that I can dispense with the atom/META-INF directory
> totally? I.e. it is redundant
> for this usage of Tomcat?
>
> atom
> |-- META-INF
> |   |-- context.xml
> |-- WEB-INF
> .....

If you don't need anything in context.xml, you don't need the context.xml file.

If there are no files in META-INF, you don't need the directory.

                - Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
One final item before I leave this thread please.


2009/2/5 Caldarale, Charles R <Ch...@unisys.com>:
onf/????/marge/atom.xml
>
> No.  First off, unless you have something specific to define for your webapp (e.g., a <Resource> or <Realm>, you don't need a <Context> element.  If you do need a <Context>, it is normally placed inside the webapp in META-INF/context.xml.


AFAIK I don't need any resource specification.
Does this mean that I can dispense with the atom/META-INF directory
totally? I.e. it is redundant
for this usage of Tomcat?

atom
|-- META-INF
|   |-- context.xml
|-- WEB-INF
.....

regards

-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> From the docs "Context elements may be explicitly defined:
> .... <snip/>
>     * in individual files (with a ".xml" extension) in the
> $CATALINA_BASE/conf/[enginename]/[hostname]/ directory."
>
> Which I interpret that to have my servlet deployed (found?) I need to
> set up an XML file as per that web page at
> {}/conf/????/marge/atom.xml

No.  First off, unless you have something specific to define for your webapp (e.g., a <Resource> or <Realm>, you don't need a <Context> element.  If you do need a <Context>, it is normally placed inside the webapp in META-INF/context.xml.  If you wish to override the contecnt of that location, or you want to deploy the webapp somewhere outside of the normal <Host> appBase directory, then you place your <Context> element in conf/[engine]/[host]/[appName].xml.

The [engine] name is whatever it's configured to be in server.xml; the default is Catalina (case sensitive), and there's almost never a reason to change it.  The [host] name is NOT the DNS name, but rather the name of the associated <Host> element that you want your webapp to run under.  By default, this is localhost - but that is not associated with the hosts file localhost.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
Moving on, reading
http://tomcat.apache.org/tomcat-6.0-doc/config/printer/context.html

2009/2/5 Dave Pawson <da...@gmail.com>:
> 2009/2/4 Caldarale, Charles R <Ch...@unisys.com>:
>>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>>> Subject: Re: servlet use. TC6, FC10
>>>
>>> 2009/2/4 Gregor Schneider <rc...@googlemail.com>:
>>> > what gives "uname -n" ?
>>>
>>> 2.6.27.12-170.2.5.fc10.i686
>>
>> Is it just me, or does that look like a really, really weird result for uname -n?  Did someone mistake an "n" for an "r"?
>
> Who! Me! Never... well, OK, yes.
>
> [dpawson@marge ~]$ uname -n
> marge.localdomain
>
> which is 'odd' since /etc/hosts
>
> 127.0.0.1               localhost localhost.localdomain marge
> ::1     localhost.localdomain   localhost6      localhost       marge   marge

I've tweaked /etc/hosts
so now

[dpawson@marge conf]$ uname -n
marge
[dpawson@marge conf]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1		localhost localhost.localdomain	marge
::1	localhost.localdomain	localhost6	localhost	marge	marge
10.0.0.137	homer


>From the docs "Context elements may be explicitly defined:
.... <snip/>
    * in individual files (with a ".xml" extension) in the
$CATALINA_BASE/conf/[enginename]/[hostname]/ directory."

Which I interpret that to have my servlet deployed (found?) I need to
set up an XML file
as per that web page at
{}/conf/????/marge/atom.xml

What's the engine name please? Nothing clear at
http://tomcat.apache.org/tomcat-6.0-doc/config/printer/engine.html

I've a vague memory it may be 'catalina'?

Is my logic right please?


regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/4 Caldarale, Charles R <Ch...@unisys.com>:
>> From: Dave Pawson [mailto:dave.pawson@gmail.com]
>> Subject: Re: servlet use. TC6, FC10
>>
>> 2009/2/4 Gregor Schneider <rc...@googlemail.com>:
>> > what gives "uname -n" ?
>>
>> 2.6.27.12-170.2.5.fc10.i686
>
> Is it just me, or does that look like a really, really weird result for uname -n?  Did someone mistake an "n" for an "r"?

Who! Me! Never... well, OK, yes.

[dpawson@marge ~]$ uname -n
marge.localdomain

which is 'odd' since /etc/hosts

127.0.0.1		localhost localhost.localdomain	marge	
::1	localhost.localdomain	localhost6	localhost	marge	marge


I.e. uname seems to be picking up the 'second' entry?

Thanks Gregor. Now I can see how it impacts TC :-)


regards




-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: servlet use. TC6, FC10

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dave Pawson [mailto:dave.pawson@gmail.com]
> Subject: Re: servlet use. TC6, FC10
>
> 2009/2/4 Gregor Schneider <rc...@googlemail.com>:
> > what gives "uname -n" ?
>
> 2.6.27.12-170.2.5.fc10.i686

Is it just me, or does that look like a really, really weird result for uname -n?  Did someone mistake an "n" for an "r"?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Dave Pawson <da...@gmail.com>.
2009/2/4 Gregor Schneider <rc...@googlemail.com>:
> what gives "uname -n" ?

2.6.27.12-170.2.5.fc10.i686



-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: servlet use. TC6, FC10

Posted by Gregor Schneider <rc...@googlemail.com>.
what gives "uname -n" ?

gregor
-- 
just because your paranoid, doesn't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org