Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

mukesh pandey

Greenhorn
+ Follow
since Apr 02, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mukesh pandey

How do you prevent ... [content removed by moderator]
8 years ago
when I unjar the ant.jar I did not find the MimeMailer class in that. is that the reason ? how can i het the jar which has MimeMailer
9 years ago
I am using a mail sending ant task in maven i m providing required jar as dependencies but I am getting below error

[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""

my ant task is :

<mail mailhost="smtpname" mailport="25" subject="GH-Test Report">
<from address="GH-Hudson" />
<to address="somemailid" />
<message>Please find the GH test reports attached</message>
<fileset dir="C:/myfiles">
<include name="index.html" />
</fileset>
</mail>



while I can run above task in ant seperately without any problem but when I add this task with maven I get the error:
[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""
9 years ago
Hi All,

I want to send am email with attachement when my pom.xml runs so can anyone tell me how I can implement email program in maven. though using ant task I know.
9 years ago
Hi I am using a mail sending ant task in maven i m providing required jar as dependencies but I am getting below error

[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""

my ant task is :

<mail mailhost="smtpname" mailport="25" subject="GH-Test Report">
<from address="GH-Hudson" />
<to address="somemailid" />
<message>Please find the GH test reports attached</message>
<fileset dir="C:/myfiles">
<include name="index.html" />
</fileset>
</mail>



while I can run above task in ant seperately without any problem but when I add this task with maven I get the error:
[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""
9 years ago
Hi I am using a mail sending ant task in maven i m providing required jar as dependencies but I am getting below error

[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""

my ant task is :

<mail mailhost="smtpname" mailport="25" subject="GH-Test Report">
<from address="GH-Hudson" />
<to address="somemailid" />
<message>Please find the GH test reports attached</message>
<fileset dir="C:/myfiles">
<include name="index.html" />
</fileset>
</mail>



while I can run above task in ant seperately without any problem but when I add this task with maven I get the error:
[mail] Failed to initialise MIME mail: Class org.apache.tools.ant.util.ClasspathUtils can not access a member of class org.apache.tools.ant.taskdefs.email.MimeMailer with modifiers ""
9 years ago
main method to call mail sender:

mail sender classs:

build file from where I am calling the mail sender program:
9 years ago
Hi All,

I am facing a strange issue. my requirement is to send a mail with attachement by calling mailsender program from ant task. the attachement is a file and it's filename will be provided from ant task itself. so I made a mail sender program and i am running it from main mehod its working fine but when I run it from ant task it thows an exception though it send the mail but do not send any thing in that mail neither mail subject nor mail content and attachement. and when I simple call this method from ant without supplying file name to be attached it is able to esnd me mail with subject and mail content. although every things is working fine while calling from main method. belwo is the exceprion I got.

javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;
[mytask] boundary="----=_Part_0_17870931.1285953389694"
[mytask] at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:877)
[mytask] at javax.activation.DataHandler.writeTo(DataHandler.java:302)...........................................

in next post I ll be attaching the my code
9 years ago
Hi, I want to call a java method from ant task I have to pass three argument to that method, though I am able to call a method with single argument but I don't know how to pass three arguments bewlo is the java file and ant file that I made and able to run method with one argument from ant.

java file:
==========================================================
package com.mydomain;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;

public class MyVeryOwnTask extends Task {
private String msg;

// The method executing the task
public void execute() throws BuildException {
System.out.println(msg);

}

// The setter for the "message" attribute
public void setMessage(String msg) {
this.msg = msg;
}

}

=========================================================
and it's ant file

<?xml version="1.0"?>

<project name="Build-example" default="main" basedir=".">
<taskdef name="mytask" classname="com.mydomain.MyVeryOwnTask" classpath="bin" />

<target name="main">
<mytask message="Hello World! MyVeryOwnTask works!" />

</target>
</project>

====================================================================

here I am passing only one argument but I need to pass multiple argument how can I do that please help.
9 years ago
Hi ,

I have written a mail client, and I want to test it if I am able to send mail with that or not so I want to ask can we simply call that method of mail client from main method and can test ? i tried to test my mail functionality but i did not able to send the mail though i am able to send mail with the same code when i deploy it on weblogic... my doubt is that is server must for sendig the mail apart from SMTP server ? can't i send mail directly using junit or main method ?
9 years ago
StringBuffer sb1 = new StringBuffer("Amit");
StringBuffer sb2 = new StringBuffer("Amit");

why

sb1.equals(sb2) = false ?

while

String s1 = new String("Amit");
String s2 = new String("Amit");

s1.equals(s2) = true
10 years ago
Anyway I got my job done by downloading plugin for eclipse Thank to all for their view and help I would like to share the link for that plugin below

http://java.decompiler.free.fr/?q=jdeclipse#install
this way I know, but I wanted to open it in eclipse just like source file I don't wana open it seperately. I know we have plugins for eclipse for this but I don't remember them like decompiler and all. Otherwise I would not have asked all this here
you can use following code


void AnimalTest(Animal animal)
{
animal.eat(); //no problem with that, all animals eat
if(animal instanceof Cat){ // it check if the animal reference variable have cat as object or animal if cat then it allowes it to go in and the you can invoke sing menthod on cat
cat c = (cat)animal;
c.sing()

}
}
10 years ago
Hi All,

I want to see the JAVA API implementation for that I need to open the class files(which are provided with JDK) in eclipse, I want to see those class file as source files in eclipse . Please hep me

Thanks in advance