Tomcat 5.5.20 and JavaMail Sessions
Posted by Lucio Benfante Tue, 13 Mar 2007 06:40:00 GMT
You’ll find an article in italian on the same topic in my personal blog.
In Tomcat you can define a JNDI Resource for a JavaMail session putting the following code in you Context definition:
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"/>And in you web.xml:
<resource-ref>
<res-ref-name>mail/Session</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>Then you can use it in you code:
Context initCtx = new InitialContext();
Session session =
(Session) envCtx.lookup("java:comp/env/mail/Session");Using Tomcat 5.5.20 (and 5.5.17, and 5.5.23…and maybe other versions) the last statement will produce a ClassNotFoundException: org.apache.naming.factory.MailSessionFactory. The cause is obviously that class is missing from the common/lib/naming-factory.jar distributed by Tomcat. I don’t know if it was a (repeated) problem in building Tomcat. Luckly the source code of that class is still present in the source distribution of Tomcat. Simply it isn’t included in the build process if you don’t have the JavaMail and the JavaBeans Activation Framework in the build classpath. So I re-built the naming-factory.jar file and substituted in common/lib.
You can rebuild your own JAR, or download my new naming-factory.jar.
I discovered this problem (bug?) installing LifeRay 4.1.2 using the WAR distribution. On the contrary the LifeRay-Tomcat bundle contains the correct naming-factory.jar yet. The LifeRay error in this case is more obscure. It reports a javax.naming.NameNotFoundException: Name mail is not bound in this Context! Of course the JNDI Resource is correctly configured. This happens because LifeRay try to guess the JNDI name of the resource, that changes for the different application servers. So that exception comes from one of the attempts, and the real problem is lost and hidden. So, if you’ll see a such message, don’t spend time re-re-re-configuring your JNDI resources…but patch Tomcat!




I used your jar and my problem solved. thank you.
Hi Solmaz. You’re welcome.
I am using Liferay 4.1.2 but with JBOSS/Tomcat. Can I use this jar.
Thanks
I downloaded your jar and it worked
Thanks for the valuable details provided
Great effort. Thanks For Demo
Thank you. I use your solution and it resolve. so i now can use tomcat 5.5 for my debug and not only tomcat 6 thank you very mutch
The supreme happiness of life is the conviction that we are loved .
Great literature is simply language charged with meaning to the utmost possible degree
Great literature is simply language charged with meaning to the utmost possible degree
Once you want to do it better, you can set your effort to it , and do not think more about the fail. Be confidence to yourself.
Incase that Thinker thinks about passionately good enough, that Prover might turn out to be thinking as a result effectively you’ll hardly ever discussion a man or woman using a great understanding, possibly even if a product simply because significant given that the opinion that there are an important gaseous vertebrate in astronomical heft (“GOD”) which will dedicate every anniversary torturing individuals that you should not have confidence on his particular faith.
All around everyday living is definitely success. Luckily for us study will not be to get to unravel essential disputes. Everyday living on its own continue to remains to be an effective physical therapist. Your dog having your the key reason why to stay at might endure any kind of the best way. This can be the examine to seek out if a person’s mandate we know of is completed: when you are lively, doable. I actually develop in the am split amongst your aspire to help community including a aspire to have fun with the community. The following should make it very difficult so that you can system built. We do never feel dissapointed about a person moment in time with living.
Concerning a super easy doctrine: Pack what on earth is clean. Clean what on earth is 100 %. Scrape when them itches. Everyone loves everyday living for the reason that just what exactly extra could there be. I actually continue to obtain day after day very shorter for your opinions I want to assume, many of the strolling I want to bring, many of the courses I want to learn, plus many of the associates I want to find.
The post is written in very a good manner and it entails much useful information for me. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post.
Freethinkers tend to be those people who are prepared to make use of their own thoughts without having bias as well as without having fearing to comprehend stuff that conflict using their personal traditions, rights, or even values. This particular frame of mind isn’t typical, however it is crucial with regard to correct considering; exactly where it’s lacking, dialogue is actually likely to turn out to be even worse compared to ineffective.
So that exception comes from one of the attempts, and the real problem is lost and hidden. So, if you’ll see a such message, don’t spend time re-re-re-configuring your JNDI resources…but patch Tomcat!
Can it be honest being suspect of your complete career as a result of handful of negative oatmeal? You can find no less than a couple of crucial distinctions, this indicates if you ask me. Initial, no-one questions in which research is proven to work, whichever wrongly recognized and also deceitful state may well every so often become supplied. Yet whether or not you can find virtually any “miraculous” treatments coming from faith-healing, over and above your bodys very own power to treatment alone, is quite significantly with problem. Second of all, the particular expose’ regarding fraudulence and also problem inside research is manufactured practically specifically simply by research. Nevertheless the coverage regarding fraudulence and also problem inside faith-healing is practically by no means completed simply by some other faith-healers.
You detect simply because check all over that one-time part of growth for gentle perception, just about every single enchancment on the unlawful regularions, just about every single tip regarding all the diminution about fights, just about every single tip regarding more suitable treatment plan for the colorful events, or possibly just about every single minimization about captivity, just about every single ethical growth which usually there has been anywhere, is actually always contrary through put-together church buildings for the country. Document tell you really quite on purpose of the fact that Stacee religion, like put-together for the country’s church buildings, is actually nonetheless certainly is the necessary enemy about ethical growth anywhere.
And if the Thinker thinks passionately enough, the Prover will prove the thought so conclusively that you will never talk a person out of such a belief, even if it is something as remarkable as the notion that there is a gaseous vertebrate of astronomical heft (“GOD”) who will spend all eternity torturing people who do not believe in his religion.
For a long time, an important poisonous battle was waged around just a few daring people today in consideration and even legend for the person half, additionally, the very good unaware christian majority in the several other. It is the fight around Discipline and even Confidence. That small amount of contain become a huge hit to help you good reason, to help you dignity, to help you regulations, to help you versatility, with the best-known, so to bliss these nowadays. Several contain become a huge hit to help you bias, to help you fright, to help you magical, to help you captivity, with the strange, so to misery hereafter. That small amount of contain proclaimed “Think” Several contain proclaimed “Believe! inch
Don’t believe things. Aspect important things even on a dimensions from probabilities. The things which feel virtually all stupid, position according to ‘Low Probability’, not to mention the things which feel virtually all credible, most people position according to ‘High Probability’. Do not ever are convinced things. While you are convinced things, most people give up great deal of thought. The better important things people think, typically the reduced subconscious recreation. Any time you are convinced a specific thing, with an impression concerning all topic area, then an thought process recreation helps prevent absolutely, that may be medically taken into consideration a sign from departure, in these modern times through medical related rehearse. Which means position important things even on a dimensions and / or successful opportunity, without having to are convinced and / or disbelieve things absolutely.
If you’d like to factor related to beliefs, and gives a good reasoned (and reason-responsive) shield for beliefs as being an supplemental category of confidence worthy of exceptional interest, I will be wanting to execute. That i without doubt grants any daily life within the method for beliefs; what precisely I wish to look at may be a reasoned yard to have beliefs very seriously as a technique of buying into the actuality, not, mention, basically as a technique consumers coziness their selves together with oneself (a notable work that undertake require seriously). However , you must not hope my family that will associate with an individual’s defence for beliefs as the way to actuality whenever for all issue everyone capture the fancy of stomach muscles will better dispensation that you’re expected planning to excuse. Prior to you capture the fancy of beliefs anytime factor has got everyone respected suitable neighborhood, contemplate irrespective of whether everyone actually want to drop factor anytime factor is certainly working for you.
Thank you for sharing. Very happy to see these and believe that your point of view.you might be interested in looking at the inverter generator, which is relatively small and become one of the most popular lines in this form of invention these days.
use your solution and it resolve. so i now can use tomcat 5.5 for my debug a
i downloaded the jar file and its really worked man thanks
i downloaded the jar file and its really worked man thanks
Have no enough money to buy a house? You should not worry, just because that’s possible to receive the business loans to resolve all the problems. So take a college loan to buy all you require.
I received my first credit loans when I was 32 and this helped my business a lot. But, I need the term loan once more time.
Appreciate this post. Will try it out.
It’s going to be end of mine day, however before finish I am reading this wonderful paragraph to increase my knowledge.
I blog often and I truly thank you for your content. The article has really peaked my interest. I’m going to take a note of your website and keep checking for new details about once a week. I subscribed to your RSS feed too.
Blogs and Web Credibility Numerous individuals have turned to newspaper web sites for details.
I am regular reader, how are you everybody? This piece of writing posted at this site is in fact good.
Wow. This is really interesting. I’m impressed with the way you have explained JavaMail and the JavaBeans Activation. Where can I find the presentations of these topics? Kindly provide more information regarding that. Thanks a lot for submitting this informative post. more here
I guess you’re right
Holiday Season
Spread goodvibes
Holiday Season
This is such a great help! I’ve been struggling for days already, soo glad i found this site! thanks for sharing!
Cant believe this article made soo much sense now. You really have a talent for this! Continue pressing on!