« Back to General Discussion - All Versions

JNDI Configuration to use email element in CVP 4.1

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hello,

I am attempting to configure a JNDI data source to use in a VXML email element on CVP 4.1, Call Studio 6.0.

I have followed the instructions I found on another topic on this forum but am still receiving an error.  Below are the steps that I have gone through, does anyone know what the issue might still be?
 
1.       Copied mail.jar and activation.jar to TOMCAT/common/lib
2.       Added a mail session using the TOMCAT interface called mail/CVPMail and clicked ¿Commit Changes¿
3.       Built VXML app with only a start, end and email element.  In the JNDI name part of the element I entered ¿CVPMail¿
4.       Deployed app, tested and got the following error:  The error was: A built-in element encountered an exception of type com.audium.server.AudiumException. There was a problem looking up the JNDI data source 'CVPMail'. The root cause was: javax.naming.NameNotFoundException: Name CVPMail is not bound in this Context com.audium.server.AudiumException: A built-in element encountered an exception of type com.audium.server.AudiumException.



Tomcat is missing an important jar file for email. It's called
naming-factory.jar and you should be able to download it from the
internet and store it into Tomcat/common/lib and then restart tomcat.



Cisco Developer Community Forums wrote:
> Nathan Galloway has created a new message in the forum "General
> Discussion - All Versions":
>
> --------------------------------------------------------------
> Hello,
>
> I am attempting to configure a JNDI data source to use in a VXML email
> element on CVP 4.1, Call Studio 6.0.
>
> I have followed the instructions I found on another topic on this
> forum but am still receiving an error. Below are the steps that I
> have gone through, does anyone know what the issue might still be?
> Â
> 1.      Copied mail.jar and activation.jar to TOMCAT/common/lib
> 2.      Added a mail session using the TOMCAT interface called
> mail/CVPMail and clicked â¿¿Commit Changesâ¿¿
> 3.      Built VXML app with only a start, end and email
> element. In the JNDI name part of the element I entered ⿿CVPMail⿿
> 4.      Deployed app, tested and got the following error: The
> error was: A built-in element encountered an exception of type
> com.audium.server.AudiumException. There was a problem looking up the
> JNDI data source 'CVPMail'. The root cause was:
> javax.naming.NameNotFoundException: Name CVPMail is not bound in this
> Context com.audium.server.AudiumException: A built-in element
> encountered an exception of type com.audium.server.AudiumException.
>
>
>
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1828965>
>
> or simply reply to this email.

Thanks for the response.  In taking a look at my installation of CVP 4.1, Tomcat is coming with the file naming-factory.jar.  I have read places that this file may be missing class files.  Could this be it or something else?

I was able to get by the error that I was running into by downloading a version of naming-factory.jar that includes all the classes needed.  I also added a step to what I posted earlier.
 
So far here is what I have to resolve this:
1.  Copy mail.jar and activation.jar to tomcat/common/lib
2.  Download good copy of naming-factory.jar, remove old one and copy in new one to tomcat/common/lib
3.  Insert the following into server.xml  <GlobalNamingResources>
<Resource auth="Container" name="mail/Session" type="javax.mail.Session" mail.smtp.host="yourhost.smtp.com" />
4. In the email element tag make the JNDI name Session
5.  Insert the following into 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>

Now the issue that I am running into is: Could not connect to SMTP host: localhost port: 25.
If you have any input on this, let me know.  I am just beginning to research, McAfee was my first guess, but after shutting that down the problem still was there.

do you have javamail running on port 25?

Cisco Developer Community Forums wrote:
> Nathan Galloway has created a new message in the forum "General
> Discussion - All Versions":
>
> --------------------------------------------------------------
> I was able to get by the error that I was running into by downloading
> a version of naming-factory.jar that includes all the classes
> needed.  I also added a step to what I posted earlier.
> Â
> So far here is what I have to resolve this:
> 1. Copy mail.jar and activation.jar to tomcat/common/lib
> 2. Download good copy of naming-factory.jar, remove old one and copy
> in new one to tomcat/common/lib
> 3. Insert the following into server.xml <GlobalNamingResources>
> <Resource auth="*Container*" name="*mail/Session*"
> type="*javax.mail.Session*" mail.smtp.host="yourhost.smtp.com" />
> 4. In the email element tag make the JNDI name Session
> 5. Insert the following into 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>
>
> Now the issue that I am running into is: Could not connect to SMTP
> host: localhost port: 25.
> If you have any input on this, let me know. I am just beginning to
> research, McAfee was my first guess, but after shutting that down the
> problem still was there.
> --
> To respond to this post, please click the following link:
>
> <http://developer.cisco.com/web/cvp/forums/-/message_boards/message/1829372>
>
> or simply reply to this email.

Would there be anything more to do that drop the activation.jar and mail.jar files into Tomcat/common/lib and restart VXML server?

Ok, I was able to get this worked out.
From a new CVP 4.1 VXML Server build this what I ended up doing.
 
ALLOW USE OF TOMCAT ADMIN TOOL
1.  Copy admin.xml into Tomcat\conf\Catalina\localhost
2.  Copy the admin folder in Tomcat\server\webapps
3.  Add a new user, with roles of admin and manager to Tomcat\conf\tomcat-users.xml
ADD NEW MAIL SESSION
1.  Copy mail.jar and activation.jar Tomcat\common\lib
2.  Restart VXML Server
3.  Login to Tomcat Admin http://localhost:7000/admin
4.  Go to Tomcat Server\Service (Catalina)\Host (localhost)\Context (/CVP)\Resources\Mail Sessions
5.  Select create new mail session, under name enter "mail/Session", under mail.smtp.host enter "yourhost.mail.com"
6.  Click save, then click commit changes, close Tomcat Admin
7.  In the email element of the VXML app, make the JNDI name "Session"
8.  Restart VXML Server
9.  Deploy app and test, all works.
 
Thanks for your help.

CVP 7.2 email element "LinkageError"
cvp 7.2 email
Answer
3/23/10 8:50 AM as a reply to Nathan Galloway.
I have found my own answer. it is working now.
I have to use the Tomcat\conf\web.xml and not the the Tomcat\webapps\CVP\WEB-INF\web.xml
 
==============================================================================
I have followed all these instructions to get the CVP 7.2 email ellement working and I'm getting this "LinkageError"
What could be the problem?  I have put both of the jars in common/lib as suggested (here, and in other site).
 
10.234.128.36.1269218859328.0.testemail,03/21/2010 17:47:39.468,A built-in element encountered an exception of type java.lang.LinkageError. The error was: java.lang.LinkageError: loader constraints violated when linking javax/activation/DataHandler class
java.lang.LinkageError: loader constraints violated when linking javax/activation/DataHandler class
 at com.audium.server.action.email.EmailActionUtil.addMessageContent(EmailActionUtil.java:287)
 at com.audium.server.action.email.EmailActionUtil.doAction(EmailActionUtil.java:185)
 at com.audium.server.action.email.EmailAction.doAction(EmailAction.java:136)
 at com.audium.server.voiceElement.ActionElementBase.service(ActionElementBase.java:384)
 at com.audium.server.controller.Controller.goToAction(Controller.java:2716)