Blaise Gervais | 1 Feb 12:00
Picon
Gravatar

[Apache Tomcat Maven plugin] Howto specify the Document base ?

Dear tomcat users,

I try to use the Tomcat Maven
plugin<http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/index.html>'s
"run" goal on a webapp. The webapp is generated by
Enunciate<http://enunciate.codehaus.org/> into
the "*target\${artifactId}-${version}*" folder. So the tomcat plugin
complains because it can't found the expected document base.

How can I change the document base ?

Thanks.

GRAVE: Error starting static Resources
> java.lang.IllegalArgumentException: Document base
> C:\Dev\Sources\xyz\sample\src\main\webapp does not exist or is not a
> readable directory
>         at
> org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
>         at
> org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4894)
>         at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5074)
>         at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
>         at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
>         at
(Continue reading)

Olivier Lamy | 1 Feb 12:18
Picon
Favicon
Gravatar

Re: [Apache Tomcat Maven plugin] Howto specify the Document base ?

Hello,
See http://tomcat.apache.org/maven-plugin-2.0-beta-1/tomcat7-maven-plugin/run-mojo.html#warSourceDirectory

So you must be able to configure the plugin :

<configuration>
  <warSourceDirectory>target/${artifactId}-${version}</warSourceDirectory>
will be better with
<warSourceDirectory>${project.build.outputDirectory}/${artifactId}-${version}</warSourceDirectory>
</configuration>

2012/2/1 Blaise Gervais <gervais.b <at> gmail.com>:
> Dear tomcat users,
>
> I try to use the Tomcat Maven
> plugin<http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/index.html>'s
> "run" goal on a webapp. The webapp is generated by
> Enunciate<http://enunciate.codehaus.org/> into
> the "*target\${artifactId}-${version}*" folder. So the tomcat plugin
> complains because it can't found the expected document base.
>
> How can I change the document base ?
>
> Thanks.
>
> GRAVE: Error starting static Resources
>> java.lang.IllegalArgumentException: Document base
>> C:\Dev\Sources\xyz\sample\src\main\webapp does not exist or is not a
>> readable directory
>>         at
(Continue reading)

Ivan | 1 Feb 12:50
Picon

Re: Correct behavior while checking the thread binding in DirContextURLStreamHandler ?

No sure whether I understood you clearly,  if a context is binding on the
current thread, and current context classloader has parent classloader,
current get method will throw an IllegalStateException. So my question is
that, in this scenario, should the context binded on the thread be ignored ?
I did not find too many comments on the svn log, while I guess that the
logic may be :
a. Check whether there is a context binding on the current context
classloader, if does, return it.
b. Check whether there is a context binding on the current thread, if does,
return it.
c. Check whether there is a context binding on the classloader tree of the
current context classloader, if does return it.
d. Throw an IllegalStateException.

2012/2/1 Christopher Schultz <chris <at> christopherschultz.net>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ivan,
>
> On 1/27/12 11:40 PM, Ivan wrote:
> > if (result != null) return result;
> >
> > // Checking thread biding result =
> > threadBindings.get(currentThread); <-------------- Here, the value
> > from threadBindings is always ignored ? is there something like "if
> > (result != null) return result;" required there ?
> >
> > // Checking parent CL binding currentCL = currentCL.getParent();
(Continue reading)

Pid | 1 Feb 13:08
Gravatar

Re: Correct behavior while checking the thread binding in DirContextURLStreamHandler ?

On 01/02/2012 11:50, Ivan wrote:

Here's what the reply should have looked like, without the top-posting.

> 2012/2/1 Christopher Schultz <chris <at> christopherschultz.net>
> 
> Ivan,
> 
> On 1/27/12 11:40 PM, Ivan wrote:
>>>> if (result != null) return result;
>>>>
>>>> // Checking thread biding result =
>>>> threadBindings.get(currentThread); <-------------- Here, the value
>>>> from threadBindings is always ignored ? is there something like "if
>>>> (result != null) return result;" required there ?
>>>>
>>>> // Checking parent CL binding currentCL = currentCL.getParent();
>>>> while (currentCL != null) { result = clBindings.get(currentCL); if
>>>> (result != null) return result; currentCL = currentCL.getParent();
>>>> }
>>>>
>>>> if (result == null) throw new IllegalStateException("Illegal class
>>>> loader binding");
>>>>
>>>> return result;
> 
> That does look fishy.
> 
> "result" will be ignored if currentCL.getParent returns non-null. If
> currentCL.getParent returns null, then the method throws an exception.
(Continue reading)

Jess Holle | 1 Feb 20:10
Favicon

Tomcat Form Authentication Timeout Behavior

I've noticed that if I POST to an authenticated URL in a web app 
configured for form-based authentication, Tomcat delivers the login 
form, and then replays the POST just fine *unless* the current state of 
the browser is one where I had already been authenticated but that 
session had timed out.  In that case, Tomcat fails to deliver the POST data.

I assume this is a known issue/limitation.  If not, is there some 
configuration setting I'm missing or some such?  This is with Tomcat 7.0.23.

--
Jess Holle

Re: Tomcat Form Authentication Timeout Behavior


Jess,

On 2/1/12 2:10 PM, Jess Holle wrote:
> I've noticed that if I POST to an authenticated URL in a web app 
> configured for form-based authentication, Tomcat delivers the login
> form, and then replays the POST just fine *unless* the current
> state of the browser is one where I had already been authenticated
> but that session had timed out.  In that case, Tomcat fails to
> deliver the POST data.
> 
> I assume this is a known issue/limitation.  If not, is there some 
> configuration setting I'm missing or some such?  This is with 
> Tomcat 7.0.23.

If you are logged-in and experience a timeout while you stare at a
POST form, the next POST should ask for your credentials and then
re-POST the form.

Your description about seems to claim that Tomcat can somehow tell the
difference between a POST to a timed-out session and a post to a
session which never existed. Tomcat does not keep old sessions around
for the purposes of messing up your flows.

Are you sure you are describing your observations properly?

Tomcat *does* have a maximum size for a saved post (see
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html,
"maxSavePostSize" - the default is 4kb). I actually don't know what
happens if the POST size exceeds this value since I've never needed
(Continue reading)

Geet Chandra | 2 Feb 03:05
Picon

Re: How to configure certificate file (*.cer) in Tomcat 6

Thanks Chris!!!

Please tell steps to configure *.cer certificate file.

On Wed, Feb 1, 2012 at 2:18 AM, Christopher Schultz <
chris <at> christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Geet,
>
> On 1/29/12 11:42 PM, Geet Chandra wrote:
> >> Actually I don't want to use "keytool -import" command to import
> >> the *.cer file into *.keystore file.
> >>
> >>> Any particular reason for your preference?
> >
> > - The customer has got very secure environment...they don't want to
> > use the *.keystore being shipped with particular product.
>
> You can create your own keystore. Just remember that it has to have
> the server key as well as the certificate itself.
>
> >> - I am using Tomcat 6.x, J2EE based web application on Windows
> >> 2003 64 bit R2, SP2 OS.
>
> Very secure environment, eh?
>
> > Is it possible to configure like this
(Continue reading)

Dale Ogilvie | 2 Feb 05:34
Picon
Favicon

RE: How to configure certificate file (*.cer) in Tomcat 6

FYI, Here's how we did it with APR for local workstation SSL.

Download APR from here: http://tomcat.apache.org/download-native.cgi

Copy the files (openssl.exe and tc-native.dll)  into the tomcat bin
directory

Set up your SSL connector, pointing to your CA signed server
SSLCertificateFile and the CA as SSLCACertificateFile:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS"
               SSLCertificateFile="c:/temp/localhost.cer"
               SSLCACertificateFile="c:/temp/ca2cert.pem"
               />

-----Original Message-----
From: Geet Chandra [mailto:geetcs <at> gmail.com] 
Sent: Thursday, 2 February 2012 3:05 p.m.
To: Tomcat Users List
Subject: Re: How to configure certificate file (*.cer) in Tomcat 6

Thanks Chris!!!

Please tell steps to configure *.cer certificate file.
Geet Chandra | 2 Feb 06:06
Picon

Re: How to configure certificate file (*.cer) in Tomcat 6

Thanks Dale!!!

Few more questions

1. As I have exported *.cer as I have using Digital Badge in Internet
Explorer.Can I use the same *.cer to configure in server.xml.If not, how
can I generate the same file.

2. How can I generate ca2cert.pem file to use in server.xml

On Thu, Feb 2, 2012 at 10:04 AM, Dale Ogilvie <Dale_Ogilvie <at> trimble.com>wrote:

> FYI, Here's how we did it with APR for local workstation SSL.
>
> Download APR from here: http://tomcat.apache.org/download-native.cgi
>
> Copy the files (openssl.exe and tc-native.dll)  into the tomcat bin
> directory
>
> Set up your SSL connector, pointing to your CA signed server
> SSLCertificateFile and the CA as SSLCACertificateFile:
>
> <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
>               maxThreads="150" scheme="https" secure="true"
>               clientAuth="false" sslProtocol="TLS"
>               SSLCertificateFile="c:/temp/localhost.cer"
>               SSLCACertificateFile="c:/temp/ca2cert.pem"
>               />
>
> -----Original Message-----
(Continue reading)

chenqiang | 2 Feb 08:11
Picon

Re: tomcat service version can't access intranet(not internet) files

André Warnier, Thank you very much, I've solve the problem before I saw
your solution, thank you anyway-:).

On Tue, Jan 31, 2012 at 4:41 PM, André Warnier <aw <at> ice-sa.com> wrote:

> chenqiang wrote:
>
>> BTW, I change the user account from local system account to Administrator
>> account using  tomcat configuration console, but I cannot start the
>> service
>> under administrator account.
>>
>
> There we are getting into Windows-specific considerations. Google (or
> baidu) may be a better source for help there. Search for "changing windows
> service account".
>
>
> Quick summary :
> - right-click on "my computer"
> - choose "services" on the left side
> - in the list on the right side, find Apache Tomcat
> - right-click on on it, choose "properties"
> - in the tabs, select the "login" tab
> - change the account
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe <at> tomcat.**apache.org<users-unsubscribe <at> tomcat.apache.org>
> For additional commands, e-mail: users-help <at> tomcat.apache.org
(Continue reading)


Gmane