james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ozzy Espaillat" <o...@unwiredsolutions.com>
Subject RE: Problem with mailets calling a class outside of JAMES
Date Sat, 02 Jun 2001 04:18:44 GMT
There is nothing wrong with what you are doing. Make sure an exception is
not being thrown in your constructor or that the FOO class is in the class
path. It might be throwing a ClassNotDef... Error. Check all your log files
as well as the console when you are executing the code to see if you see the
exception.

HTH,
Ozzy

-----Original Message-----
From: John Antypas [mailto:johna@telamon.com]
Sent: Friday, June 01, 2001 3:36 PM
To: james-dev@jakarta.apache.org
Subject: Problem with mailets calling a class outside of JAMES


OK, I give....

I retrieved the latest JAMES, set it up, and started it up with default
mailers.  So far so good.  I then wanted to write a mailet that would allow
ALL pieces of mail sent through JAMES to go to a custom backend.  In effect,
JAMES parses the e-mail and carries out specialized API commands (in JAVA)
to do the actual work, later sending back an e-mail message telling the
sender what was actually done.

Almost so far so good....

I wrote a mailet similar to NotifySender and installed it.  Everything works
until I actually go to instantiate my API class.  At the point, all logging
stops.  To be more specific, assume I have a class with the following
prototype:

public class FOO extends GenericMailet implements FOOListener {
	public FOO() {|
		log ("Foo initialized");
	}
	public Foo.myMethod(String s1, String s2) {
		log("Foo myMethod called ("+s1+","+s2+")");
		... do magic ...
	}
}

In my mailet service routine, I have code such the following

	.... use Mail api to get recipient etc....  all works...
	log("About to call FOO");	// This shows up in log
	FOO f = new FOO();		// No logging from FOO
	log("FOO called");		// No logging from here on

What am I missing?  It appears that calling the new() of this call causes
trouble.  I can't believe JAMES can't handle external calls, so I must be
missing something.  What's the right way to do this?

Many thanks....

John Antypas


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


Mime
View raw message