Persistent Context Configuration

2014-05-18 Thread Tim Gustafson
Hi,

I have a web application that I've deployed on three different virtual
hosts.  Each virtual host requires different configuration data
(specifically, AWS credentials and options that the web application
uses to access AWS services).  In the future, there may be many more
deployments, each with their own set of AWS credentials and options.

I've tried putting these options as parameters in
conf/Catalina/name/ROOT.xml files which works except that file is
deleted each time the web application is redeployed.

Where is the proper place to put virtual-host-specific configuration
options such that they can be easily read from within the web
application and persist across redeployments?  I can't put them in the
WAR file directly because the same WAR file will be re-used by
multiple virtual-hosts, so I need something that I can put in
server.xml or something similar.

Thanks in advance for any help you can give.  :)

-- 

Tim Gustafson
t...@tgustafson.com

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



Re: Persistent Context Configuration

2014-05-18 Thread Tim Gustafson
> For virtual host-specific context configurations, place a
> context.xml.default in:
>
> $CATALINA_BASE/conf/[engine-name]/[host-name]
>
> See the following:
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

That did the trick; thanks!

-- 

Tim Gustafson
t...@tgustafson.com

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



Configuring E-Mail Session via JNDI

2015-08-05 Thread Tim Gustafson
I'm trying to configure an e-mail session in my Tomcat configuration like this:



>From my web application, I'm instantiating a Session object like this:

Context initialContext = new InitialContext();
session = (Session) initialContext.lookup("java:comp/env/mail/session");

When I go to send e-mail from my web applet, I'm getting:

java.lang.ClassNotFoundException: javax.mail.Authenticator

I find that error a little odd, as I'm not doing SMTP AUTH anywhere,
but I'll let that go for now.  Based on documentation I found while
Googling that error message, I copied the mail.jar file from my
Netbeans library into Tomcat's lib folder, and now I get:

java.lang.ClassCastException: javax.mail.Session cannot be cast to
javax.mail.Session

Removing Java Mail from my Netbeans project does not appear to be an
option as it will refuse to compile the project without it.

I'm at a loss.  What am I doing wrong?  Thanks in advance for any help
with this - it has been driving me nuts for a while now!

-- 

Tim Gustafson
t...@tgustafson.com

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



Re: Configuring E-Mail Session via JNDI

2015-08-07 Thread Tim Gustafson
> I use NetBeans with Maven, and in that context I would declare the
> mail dependency to be provided.  I don't know how to do
> that in a native NetBeans project, but what you'd need to do is to
> tell NetBeans that javax.mail is required to compile but must not be
> included in the output WAR.

I found this option; it's under "File", "Project Properties",
"Libraries", and then you un-check the "Package" column for the
JavaMail library.

Thanks for the pointer!

-- 

Tim Gustafson
t...@tgustafson.com

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