[resolved] Sending email in a java bean - not finding javax.mail

Highlighted
One Star

[resolved] Sending email in a java bean - not finding javax.mail

Hello
I'm writing a bean in the code/beans section, to have a function sending emails that will be called by a cProcessor in my route. (I don't waant to use cMail).
When I do "import javax.mail.*" it says it can't find it. But in the Studio/plugins directory I can see the javax.mail_1.4.0.v201005080615.jar file.
How can I import it in my java code ?
Thank you
Loko

Accepted Solutions
One Star

Re: [resolved] Sending email in a java bean - not finding javax.mail

I finally found by myself : right click on the bean in the Repository view and select "Edit bean libraries".
Just surprised Talend didn't tell me this option
Loko

All Replies
One Star

Re: [resolved] Sending email in a java bean - not finding javax.mail

Studio/plugins contains Plugin dependencies, not a component one. Add required jars via cConfig component
One Star

Re: [resolved] Sending email in a java bean - not finding javax.mail

Hello aleXx
This would work, but does not suit our needs. We're writing generic java libraries in a bean that will be used in hundreds of routes, we can't add a cConfig in all thoses routes and then modify them all at will, we need a centralized solution for easier maintainance.
For instance, in my bean, I can easily import java.util, java.security, java.text, java.time etc ... How can I know the list of all libraries available for import ? and how can I add one to be imported in a bean ?
An other strange issue : in a bean, if I write "import org.apache." the autocompletion does not suggest "org.apache.camel". If I write this it gets red underlined as faulty but it works anyway.
In my java code, same issue, "Message mymessage = .... " shows an error on "Message" not recognized as a type, but it works.
One Star

Re: [resolved] Sending email in a java bean - not finding javax.mail

Where is the list of the included java libraries that we can import into a bean without having to use a cConfig ? (such as java.utils.* etc ..) ?
How can we add some libraries at the same level, that will always be available to all routes and all beans ?
Subsidiary question : why isn't "org.apache.camel" recognized in the java bean editor, while it do compile and work ?
Thank you.
Loko
One Star

Re: [resolved] Sending email in a java bean - not finding javax.mail

I finally found by myself : right click on the bean in the Repository view and select "Edit bean libraries".
Just surprised Talend didn't tell me this option
Loko

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch