Hi, I wrote ant script that will compile, make jar file and deploy that jar file to websphere. I am trying to send emails using ant script .. When i try to run my ant file using the following command: c:/> ant -buildfile test.xml email: [mail] Sending email: Test build ...... that's it .. it not displaying promt at all ... which means it is hanging some where .. Here is my code .. Any help how to send emails using ant script please .... <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- specify the base directory and default value --> <project name="test" default="all" basedir="."> <target name="all" description="send email using ant" > <mail mailhost="testhome" mailport="1025" subject="Test build"> <from address="malathi.gowda@inc.com"/> <to address="Vdevmermana@inc.com"/> <message>The test has completed</message> </mail> </target>
</project>
sirisha reddy
Greenhorn
Joined: Oct 29, 2003
Posts: 3
posted
0
I downloaded mail.jar and activation.jar and copied those two jars into c:/ant/lib and it is under class path .... any help how to send emails using ant. What is wrong in my code ... thanks.
Hi, I solved the mailing problem but i have one more problem. I can test ejb using junit and jboss successfully. When running a JUnit test thru jboss the following switches should be passed to the JVM: -DxPool -DAutoCommit -Djava.security.auth.login.config=c:\jboss-3.2.1\client\auth.conf But in case of ant where do i set these settings to run EJB. When I try to run EJB thru ant Script using junit it is giving the following erorr: Testcase: unknown took 0 sec Caused an ERROR Unable to locate a login configuration java.lang.SecurityException: Unable to locate a login configuration at com.sun.security.auth.login.ConfigFile.getAppConfigurationEntry(ConfigFile.java:221) at javax.security.auth.login.LoginContext.init(LoginContext.java:176) at javax.security.auth.login.LoginContext.<init>(LoginContext.java:404) at common.test.EJBTestSetup.setUp(EJBTestSetup.java:56) at common.test.Test.setUp(Test.java:37) at junit.extensions.TestSetup$1.protect(TestSetup.java:18) at junit.extensions.TestSetup.run(TestSetup.java:23) Here is the code to run ejb using junit thru ant .. <target name="junit" description="Test " > <junit printsummary="yes" haltonfailure="yes"> <formatter type="plain"/> <test name="common.test.Test" haltonfailure="no" outfile="result"> </test> </junit> </target> Any help please ...
I am trying to sedn e-mails through ant.It was working with WSAD 5.0.2.But when we updated to WSAD 5.1 + 2 patches.The e-mail is not working. I was able to find that these 2 versions of WSAD use 2 different versions of ant versiojs.the new wsad used ant V 1.5.3 and the old one soem 1.4... stuff.I included the mail.jar in teh classpath.But still it is complaining about. " BUILD FAILED: java.lang.NoClassDefFoundError: com.sun.mail.util.SharedByteArrayInputStream " Can soembody help why it is behaving like that.I cansee this file is there in mail.jar .
Did anybody find solution to this problem? I am having same problem. Please help!
TIA.
SCWCD 1.4<br />---------------------<br />Ability is what you're capable of. <br />Motivation determines what you do. <br />Attitude determines how well you do it.<br />---------------------
Hi sirisha reddy!! How you have solved that after the line [mail] Sending email: Test build it was hanging know ? that problem. I am facing same problem. Please help me.. any others faced same problem please provide your inputs on how to solve this problem.....Thanks in Advance [ March 18, 2007: Message edited by: Mohan Kumar G ]
Mohan G Kumar<br />SCJP(76%), SCWCD(91%), Preparing for SCBCD..