dcsimg
Java Mail
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Greg_Scott
Posted On:   Wednesday, June 18, 2003 04:25 PM

I am getting a runtime error with the portion of my Email Bean that starts a new thread. The error is: java.lang.ClassFormatError: org/suncorp/beans/EmailBean$1 (Illegal Variable name " val$mesg") at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass0(Compiled Code) at java.lang.ClassLoader.defineClass(Compiled Code) at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(Compiled Code) at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Compiled Code) at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Compiled Code) at java.security.AccessController.doPrivileged(Native Method) at java.   More>>

I am getting a runtime error with the portion of my Email Bean that starts a new thread.


The error is:

java.lang.ClassFormatError: org/suncorp/beans/EmailBean$1 (Illegal Variable name " val$mesg")
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass0(Compiled Code)
at java.lang.ClassLoader.defineClass(Compiled Code)
at org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(Compiled Code)
at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Compiled Code)
at org.apache.tomcat.util.depend.DependClassLoader12$1.run(Compiled Code)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Compiled Code)
at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClass(Compiled Code)
at java.lang.ClassLoader.loadClassInternal(Compiled Code)
at org.suncorp.beans.EmailBean.doSend(Compiled Code)
at org.suncorp.beans.EmailBean.processRequest(EmailBean.java:589)
at bpActivitiesClaimReq_7._jspService(bpActivitiesClaimReq_7.java:128)
at org.apache.jasper.runtime.HttpJspBase.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(Compiled Code)
at org.apache.tomcat.facade.ServletHandler.doService(Compiled Code)
at org.apache.tomcat.core.Handler.invoke(Compiled Code)
at org.apache.tomcat.core.Handler.service(Compiled Code)
at org.apache.tomcat.facade.ServletHandler.service(Compiled Code)
at org.apache.tomcat.core.ContextManager.internalService(Compiled Code)
at org.apache.tomcat.core.ContextManager.service(Compiled Code)
at org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Compiled Code)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Compiled Code)
at java.lang.Thread.run(Compiled Code)



The method is:

			
public synchronized void doSend() throws MessagingException {


Properties props = new Properties( );
props.put("mail.smtp.host", mailHost);

if (session == null) {
session = Session.getDefaultInstance(props, null);
if (verbose){
session.setDebug(true);
}
}

final Message mesg = new MimeMessage(session);

InternetAddress[] addresses;

addresses = new InternetAddress[toList.size()];
for (int i=0; i
addresses[i] = new InternetAddress((String)toList.get(i));
mesg.setRecipients(Message.RecipientType.TO, addresses);

// From Address
mesg.setFrom(new InternetAddress(sender));

// CC Address list
addresses = new InternetAddress[ccList.size( )];
for (int i=0; i
addresses[i] = new InternetAddress((String)ccList.get(i));
mesg.setRecipients(Message.RecipientType.CC, addresses);

// BCC Address list
addresses = new InternetAddress[bccList.size( )];
for (int i=0; i
addresses[i] = new InternetAddress((String)bccList.get(i));
mesg.setRecipients(Message.RecipientType.BCC, addresses);

// The Subject
mesg.setSubject(subject);

// Now the message body.
mesg.setText(body);

// Finally, send the message! (use static Transport method)
// Do this in a Thread as it sometimes is too slow for JServ
new Thread() {
public void run() {
try {
Transport.send(mesg); //problem area
} catch (MessagingException e) {
throw new IllegalArgumentException(
"Transport.send() threw: " + e.toString());
}
}
}.start();
}


Any ideas??

I am using jdk 1.3.1 and tomcat on Solaris.
   <<Less
About | Sitemap | Contact