Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Loko
Creator II

[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
Labels (3)
1 Solution

Accepted Solutions
Loko
Creator II
Author

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

View solution in original post

4 Replies
Anonymous
Not applicable

Studio/plugins contains Plugin dependencies, not a component one. Add required jars via cConfig component
Loko
Creator II
Author

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.
Loko
Creator II
Author

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
Loko
Creator II
Author

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