You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by David Esposito <dv...@newnetco.com> on 2001/11/09 16:22:11 UTC

loading my mailet hangs on James startup

Hello all,

I am testing out James and am trying to write my own Mailet.

Summary: I wrote a very simple mailet (does nothing), jarred it up, added it
to the james/lib directory and added my package to the <mailetpackage> ... I
added my <mailet> to the "root" processor ... But when I start up James, it
hangs when trying to load my mailet.

Below is my mailet. I have tried removing the constructor and the
init(MailetConfig) method ... But it still hangs. My log file indicates that
it loads the matcher for my mailet. I'm sure that it actually found my
mailet because i've gotten rid of the ClassNotFoundExceptions that were
popping up when I didn't have it configured correctly. But none of my
"debug" statements ever hit the log files or the console ...

Please, someone, say that there is something simple I'm missing here. I
lookd at the MailetLoader code and it coudln't be simpler so I don't know
where I'm going wrong.

Thanks in advance.

-Dave

public class BounceMailet extends GenericMailet
{
	public BounceMailet(){
		System.out.println("OUTTTTT PLEEEEEEZZZZ...");
		System.err.println("ERRRR PLEEEEEEZZZZ...");
		log("HELOOOOOOOOO OUT THERE!!!!!!!!!");
	}

	public void init(MailetConfig newConfig) throws MessagingException
	{
		super.init(newConfig);
		log("Initializing BounceMailet...");

		Iterator iter = newConfig.getInitParameterNames();
		while(iter.hasNext())
		{
			String paramName = (String)iter.next();
			log(paramName + "=" + newConfig.getInitParameter(paramName));
		}

	}

	public void service(Mail mail) throws MessagingException
	{
		Collection recipients = mail.getRecipients();
		Iterator iter = recipients.iterator();

		log("Received email ... ");
		int i=0;

		while(iter.hasNext())
		{
			log("Recipient[" + i++ + "]: " + iter.next());
		}
	}


    public String getMailetInfo() {
        return "Bouncey Mailet";
    }

}


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: loading my mailet hangs on James startup

Posted by Mike Bridge <mi...@bridgecanada.com>.
Hi-

My mailets did the same thing.  I found that James was swallowing
the runtime exception that my mailet was throwing, which made it 
really difficult to debug.  In my case, it was a ClassNotFound 
exception, because I was missing some import statements.  It was 
only by trial-and-error that I finally figured out what the problem 
was....

-Mike


On Mon, Nov 12, 2001 at 09:02:33AM -0500, David Esposito wrote:
> Nope, that doesn't help either. I've tried it with both the init() (no
> arguments) and by removing the init() method altogether ... still hangs on
> startup...
> 
> Thanks for your input..
> 
> -Dave
> 
> > -----Original Message-----
> > From: Danny Angus [mailto:danny@thought.co.uk]
> > Sent: Monday, November 12, 2001 8:39 AM
> > To: James Developers List; James Users List
> > Subject: RE: loading my mailet hangs on James startup
> >
> >
> > I dont think you need to call super.init(MailetConfig)
> >
> >
> > > > > public void init(MailetConfig newConfig) throws MessagingException
> > > > > {
> > > > > super.init(newConfig);
> > > > > log("Initializing BounceMailet...");
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> 

-- 
Mike Bridge <mi...@bridgecanada.com>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: loading my mailet hangs on James startup

Posted by David Esposito <dv...@newnetco.com>.
Nope, that doesn't help either. I've tried it with both the init() (no
arguments) and by removing the init() method altogether ... still hangs on
startup...

Thanks for your input..

-Dave

> -----Original Message-----
> From: Danny Angus [mailto:danny@thought.co.uk]
> Sent: Monday, November 12, 2001 8:39 AM
> To: James Developers List; James Users List
> Subject: RE: loading my mailet hangs on James startup
>
>
> I dont think you need to call super.init(MailetConfig)
>
>
> > > > public void init(MailetConfig newConfig) throws MessagingException
> > > > {
> > > > super.init(newConfig);
> > > > log("Initializing BounceMailet...");
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: loading my mailet hangs on James startup

Posted by David Esposito <dv...@newnetco.com>.
Nope, that doesn't help either. I've tried it with both the init() (no
arguments) and by removing the init() method altogether ... still hangs on
startup...

Thanks for your input..

-Dave

> -----Original Message-----
> From: Danny Angus [mailto:danny@thought.co.uk]
> Sent: Monday, November 12, 2001 8:39 AM
> To: James Developers List; James Users List
> Subject: RE: loading my mailet hangs on James startup
>
>
> I dont think you need to call super.init(MailetConfig)
>
>
> > > > public void init(MailetConfig newConfig) throws MessagingException
> > > > {
> > > > super.init(newConfig);
> > > > log("Initializing BounceMailet...");
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: loading my mailet hangs on James startup

Posted by Danny Angus <da...@thought.co.uk>.
I dont think you need to call super.init(MailetConfig)


> > > public void init(MailetConfig newConfig) throws MessagingException
> > > {
> > > super.init(newConfig);
> > > log("Initializing BounceMailet...");


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: loading my mailet hangs on James startup

Posted by Danny Angus <da...@thought.co.uk>.
I dont think you need to call super.init(MailetConfig)


> > > public void init(MailetConfig newConfig) throws MessagingException
> > > {
> > > super.init(newConfig);
> > > log("Initializing BounceMailet...");


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: loading my mailet hangs on James startup

Posted by David Esposito <dv...@newnetco.com>.
I just downloaded the 2.01a binary on Friday. I had never had a previous
version of JAMES on my computer (or in my CLASSPATH) ... I do explicit
imports of the JAMES classes (no wildcard imports)... So I can't figure how
it could be a version-related problem.

I'm using Sun JDK 1.3.

Thanks for your reply.

-Dave


> -----Original Message-----
> From: Jacques Lema [mailto:jacques@link-u.com]
> Sent: Saturday, November 10, 2001 2:43 PM
> To: James Users List
> Subject: Re: loading my mailet hangs on James startup
>
>
> I had the exact same problem when I upgraded to James 2.01a binary. My
> mailets where compiled (and used to work) with a previous version of the
> jars (1.2). All I had to do is recompile my mailets and remove
> some imports
> that did not exist anymore.. can't remember the name yet. I can't access
> them from home. Just rebuild using the new jars as imports and see what's
> wrong.
>
> Hope this helps.
>
>
> ----- Original Message -----
> From: "David Esposito" <dv...@newnetco.com>
> To: <ja...@jakarta.apache.org>
> Sent: Friday, November 09, 2001 4:22 PM
> Subject: loading my mailet hangs on James startup
>
>
> > Hello all,
> >
> > I am testing out James and am trying to write my own Mailet.
> >
> > Summary: I wrote a very simple mailet (does nothing), jarred it
> up, added
> it
> > to the james/lib directory and added my package to the
> <mailetpackage> ...
> I
> > added my <mailet> to the "root" processor ... But when I start up James,
> it
> > hangs when trying to load my mailet.
> >
> > Below is my mailet. I have tried removing the constructor and the
> > init(MailetConfig) method ... But it still hangs. My log file indicates
> that
> > it loads the matcher for my mailet. I'm sure that it actually found my
> > mailet because i've gotten rid of the ClassNotFoundExceptions that were
> > popping up when I didn't have it configured correctly. But none of my
> > "debug" statements ever hit the log files or the console ...
> >
> > Please, someone, say that there is something simple I'm missing here. I
> > lookd at the MailetLoader code and it coudln't be simpler so I
> don't know
> > where I'm going wrong.
> >
> > Thanks in advance.
> >
> > -Dave
> >
> > public class BounceMailet extends GenericMailet
> > {
> > public BounceMailet(){
> > System.out.println("OUTTTTT PLEEEEEEZZZZ...");
> > System.err.println("ERRRR PLEEEEEEZZZZ...");
> > log("HELOOOOOOOOO OUT THERE!!!!!!!!!");
> > }
> >
> > public void init(MailetConfig newConfig) throws MessagingException
> > {
> > super.init(newConfig);
> > log("Initializing BounceMailet...");
> >
> > Iterator iter = newConfig.getInitParameterNames();
> > while(iter.hasNext())
> > {
> > String paramName = (String)iter.next();
> > log(paramName + "=" + newConfig.getInitParameter(paramName));
> > }
> >
> > }
> >
> > public void service(Mail mail) throws MessagingException
> > {
> > Collection recipients = mail.getRecipients();
> > Iterator iter = recipients.iterator();
> >
> > log("Received email ... ");
> > int i=0;
> >
> > while(iter.hasNext())
> > {
> > log("Recipient[" + i++ + "]: " + iter.next());
> > }
> > }
> >
> >
> >     public String getMailetInfo() {
> >         return "Bouncey Mailet";
> >     }
> >
> > }
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: loading my mailet hangs on James startup

Posted by David Esposito <dv...@newnetco.com>.
I just downloaded the 2.01a binary on Friday. I had never had a previous
version of JAMES on my computer (or in my CLASSPATH) ... I do explicit
imports of the JAMES classes (no wildcard imports)... So I can't figure how
it could be a version-related problem.

I'm using Sun JDK 1.3.

Thanks for your reply.

-Dave


> -----Original Message-----
> From: Jacques Lema [mailto:jacques@link-u.com]
> Sent: Saturday, November 10, 2001 2:43 PM
> To: James Users List
> Subject: Re: loading my mailet hangs on James startup
>
>
> I had the exact same problem when I upgraded to James 2.01a binary. My
> mailets where compiled (and used to work) with a previous version of the
> jars (1.2). All I had to do is recompile my mailets and remove
> some imports
> that did not exist anymore.. can't remember the name yet. I can't access
> them from home. Just rebuild using the new jars as imports and see what's
> wrong.
>
> Hope this helps.
>
>
> ----- Original Message -----
> From: "David Esposito" <dv...@newnetco.com>
> To: <ja...@jakarta.apache.org>
> Sent: Friday, November 09, 2001 4:22 PM
> Subject: loading my mailet hangs on James startup
>
>
> > Hello all,
> >
> > I am testing out James and am trying to write my own Mailet.
> >
> > Summary: I wrote a very simple mailet (does nothing), jarred it
> up, added
> it
> > to the james/lib directory and added my package to the
> <mailetpackage> ...
> I
> > added my <mailet> to the "root" processor ... But when I start up James,
> it
> > hangs when trying to load my mailet.
> >
> > Below is my mailet. I have tried removing the constructor and the
> > init(MailetConfig) method ... But it still hangs. My log file indicates
> that
> > it loads the matcher for my mailet. I'm sure that it actually found my
> > mailet because i've gotten rid of the ClassNotFoundExceptions that were
> > popping up when I didn't have it configured correctly. But none of my
> > "debug" statements ever hit the log files or the console ...
> >
> > Please, someone, say that there is something simple I'm missing here. I
> > lookd at the MailetLoader code and it coudln't be simpler so I
> don't know
> > where I'm going wrong.
> >
> > Thanks in advance.
> >
> > -Dave
> >
> > public class BounceMailet extends GenericMailet
> > {
> > public BounceMailet(){
> > System.out.println("OUTTTTT PLEEEEEEZZZZ...");
> > System.err.println("ERRRR PLEEEEEEZZZZ...");
> > log("HELOOOOOOOOO OUT THERE!!!!!!!!!");
> > }
> >
> > public void init(MailetConfig newConfig) throws MessagingException
> > {
> > super.init(newConfig);
> > log("Initializing BounceMailet...");
> >
> > Iterator iter = newConfig.getInitParameterNames();
> > while(iter.hasNext())
> > {
> > String paramName = (String)iter.next();
> > log(paramName + "=" + newConfig.getInitParameter(paramName));
> > }
> >
> > }
> >
> > public void service(Mail mail) throws MessagingException
> > {
> > Collection recipients = mail.getRecipients();
> > Iterator iter = recipients.iterator();
> >
> > log("Received email ... ");
> > int i=0;
> >
> > while(iter.hasNext())
> > {
> > log("Recipient[" + i++ + "]: " + iter.next());
> > }
> > }
> >
> >
> >     public String getMailetInfo() {
> >         return "Bouncey Mailet";
> >     }
> >
> > }
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: loading my mailet hangs on James startup

Posted by Jacques Lema <ja...@link-u.com>.
I had the exact same problem when I upgraded to James 2.01a binary. My
mailets where compiled (and used to work) with a previous version of the
jars (1.2). All I had to do is recompile my mailets and remove some imports
that did not exist anymore.. can't remember the name yet. I can't access
them from home. Just rebuild using the new jars as imports and see what's
wrong.

Hope this helps.


----- Original Message -----
From: "David Esposito" <dv...@newnetco.com>
To: <ja...@jakarta.apache.org>
Sent: Friday, November 09, 2001 4:22 PM
Subject: loading my mailet hangs on James startup


> Hello all,
>
> I am testing out James and am trying to write my own Mailet.
>
> Summary: I wrote a very simple mailet (does nothing), jarred it up, added
it
> to the james/lib directory and added my package to the <mailetpackage> ...
I
> added my <mailet> to the "root" processor ... But when I start up James,
it
> hangs when trying to load my mailet.
>
> Below is my mailet. I have tried removing the constructor and the
> init(MailetConfig) method ... But it still hangs. My log file indicates
that
> it loads the matcher for my mailet. I'm sure that it actually found my
> mailet because i've gotten rid of the ClassNotFoundExceptions that were
> popping up when I didn't have it configured correctly. But none of my
> "debug" statements ever hit the log files or the console ...
>
> Please, someone, say that there is something simple I'm missing here. I
> lookd at the MailetLoader code and it coudln't be simpler so I don't know
> where I'm going wrong.
>
> Thanks in advance.
>
> -Dave
>
> public class BounceMailet extends GenericMailet
> {
> public BounceMailet(){
> System.out.println("OUTTTTT PLEEEEEEZZZZ...");
> System.err.println("ERRRR PLEEEEEEZZZZ...");
> log("HELOOOOOOOOO OUT THERE!!!!!!!!!");
> }
>
> public void init(MailetConfig newConfig) throws MessagingException
> {
> super.init(newConfig);
> log("Initializing BounceMailet...");
>
> Iterator iter = newConfig.getInitParameterNames();
> while(iter.hasNext())
> {
> String paramName = (String)iter.next();
> log(paramName + "=" + newConfig.getInitParameter(paramName));
> }
>
> }
>
> public void service(Mail mail) throws MessagingException
> {
> Collection recipients = mail.getRecipients();
> Iterator iter = recipients.iterator();
>
> log("Received email ... ");
> int i=0;
>
> while(iter.hasNext())
> {
> log("Recipient[" + i++ + "]: " + iter.next());
> }
> }
>
>
>     public String getMailetInfo() {
>         return "Bouncey Mailet";
>     }
>
> }
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>