This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Both application-client.xml and jboss-client.xml reside in the META-INF directory of a JAR file. This JAR file is on my CLASSPATH and is also included in my deployed EAR file (and is listed as a module in application.xml).
I'm including mail.jar and activation.jar (from JBoss release), jboss-j2ee.jar, jbossall-client.jar, and the directory path for jndi.properties on the client CLASSPATH.
What am I doing wrong? Does anyone have any ideas? Thanks.
Joined: Sep 20, 2000
OK, I can answer my own question. I set everything up correctly (that�s why I could use the Environment Variable and URL with J2EE-style JNDI ENC names) on the client side. However, according to Ingo Kl�ckl, you can't access JNDI resources bound under the java:/ namespace. Here's an excerpt from Ingo Kl�ckl's web page (http://www.2k-software.de/ingo/jbossjndi.html):
�java: is an ENC which is visible only in the JBoss VM. It holds references to objects which are only [sic] senseful in the JBoss environment, like data sources or other resources.�
So, the short answer is: you can�t access a JavaMail Session (a DataSource) from outside the container because JBoss binds this under its internal java: namespace, so you can�t access outside of JBoss� VM.
Duh! I should've remembered this sooner. If only I�d read my own research more closely and much sooner.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: ClassCastException - JavaMail & JNDI in Application Client