Jboss下配置javamail的问题。
程序员文章站
2022-03-27 07:50:55
...
1.今天在jboss下面发送电子邮件的时候,抛出了如下异常:
最终发现原来不小心没有设置content,结果content为null,所以把content设置好后就OK了。写下来让以后遇到此问题的弟兄们尽快解决。
[JmsServerSession] Unexpected error delivering message org.jboss.mq.SpyMapMessage {
Header {
jmsDestination : TOPIC.EmailService
jmsDeliveryMode : 2
jmsExpiration : 0
jmsPriority : 4
jmsMessageID : ID:5-12110906215461
jmsTimeStamp : 1211090621546
jmsCorrelationID: null
jmsReplyTo : null
jmsType : null
jmsRedelivered : false
jmsProperties : {content=欢迎你注册为我们的会员, subject=欢迎你注册为我们的会员, [email protected], [email protected]}
jmsPropReadWrite: false
msgReadOnly : true
producerClientId: ID:5
}
}
javax.ejb.EJBTransactionRolledbackException
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
at $Proxy121.onMessage(Unknown Source)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.sun.mail.handlers.text_plain.writeTo(text_plain.java:121)
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:868)
at javax.activation.DataHandler.writeTo(DataHandler.java:301)
at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:248)
at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1268)
at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2012)
at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1980)
at javax.mail.Transport.send(Transport.java:97)
at com.bookshop.logic.serviceMDB.EmailServiceMDB.onMessage(EmailServiceMDB.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
... 17 more
最终发现原来不小心没有设置content,结果content为null,所以把content设置好后就OK了。写下来让以后遇到此问题的弟兄们尽快解决。
上一篇: IE6下的JavaScript
下一篇: 去掉点击链接产生的虚线框
推荐阅读
-
MySQL的一些配置有关问题
-
关于Thinkphp下buildHtml的问题
-
请教一下thinkphp模板使用函数的有关问题
-
CentOS-6.5下MariaDB-10基于XtraBackup备份工具的原理及配置详解
-
关于站点获取另外一个站点下的cookie有关问题
-
windows环境下php配置memcache的具体操作步骤_PHP
-
Android解决ScrollView下嵌套ListView和GridView中内容显示不全的问题
-
Nginx服务器下配置个性二级域名及多个域名的实例讲解
-
大家帮忙看一下这段简单的代码哪里有有关问题
-
用DS配置oracle数据库时,使用和客户端相同的账号导致的问题