2 Replies Latest reply on Sep 20, 2011 9:16 AM by Mitja Skuhala

    Mail Service doesn't work

    Mitja Skuhala Newbie

      I want to send some mails with JBoss 7.0.0. final but it doesn,t work. At JBoss 5.1 in 6.0 worked in JBoss 7 i got error.

       

      // Send message

      Transport.send(msg);

       

      ERROR:

       

       

      Failed to define class com.sun.mail.util.MailSSLSocketFactory in Module "javax.mail.api:main" from local module loader @b166b5 (roots: D:\jboss-as-7.0.0.Final\modules): java.lang.LinkageError: Failed to link com/sun/mail/util/MailSSLSocketFactory (Module "javax.mail.api:main" from local module loader @b166b5 (roots: D:\jboss-as-7.0.0.Final\modules))

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401)

          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)

          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)

          at org.jboss.modules.Module.loadModuleClass(Module.java:588)

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

          at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900) [mail-1.4.4.jar:1.4.4]

          at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638) [mail-1.4.4.jar:1.4.4]

          at javax.mail.Service.connect(Service.java:317) [mail-1.4.4.jar:1.4.4]

          at javax.mail.Service.connect(Service.java:176) [mail-1.4.4.jar:1.4.4]

          at javax.mail.Service.connect(Service.java:125) [mail-1.4.4.jar:1.4.4]

          at javax.mail.Transport.send0(Transport.java:194) [mail-1.4.4.jar:1.4.4]

          at javax.mail.Transport.send(Transport.java:124) [mail-1.4.4.jar:1.4.4]

          at si.xxxx.sdp.itmail.MailServiceImpl.sendMail(MailServiceImpl.java:372) [itmailsrc.jar:]

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_24]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_24]

          at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_24]

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271)

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:377)

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233)

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

          at com.xxxx.sdp.mail.MailService$$$view1.sendMail(Unknown Source) [sdpcoresrc.jar:]

          at si.xxxx.sdp.rest.RestMailService.sendMail(RestMailService.java:144)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_24]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [:1.6.0_24]

          at java.lang.reflect.Method.invoke(Unknown Source) [:1.6.0_24]

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.2.1.GA.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.2.1.GA.jar:]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:480)

          at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

          at java.lang.Thread.run(Unknown Source) [:1.6.0_24]

      Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/SSLSocketFactory

          at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_24]

          at java.lang.ClassLoader.defineClassCond(Unknown Source) [:1.6.0_24]

          at java.lang.ClassLoader.defineClass(Unknown Source) [:1.6.0_24]

          at java.security.SecureClassLoader.defineClass(Unknown Source) [:1.6.0_24]

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)

          ... 80 more

      Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLSocketFactory from [Module "javax.mail.api:main" from local module loader @b166b5 (roots: D:\jboss-as-7.0.0.Final\modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

          ... 85 more

       

      [RestMailService] ramsak;skuhala|127.0.0.1|7uUY5sVEB8vxH25iKfARg6I4|192.168.60.229|RestMailService

       

      javax.ejb.EJBException: Unexpected Error

       

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:201)

       

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)

       

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:377)

       

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233)

       

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)

       

          at com.xxxx.sdp.mail.MailService$$$view1.sendMail(Unknown Source)

       

          at si.xxxx.sdp.rest.RestMailService.sendMail(RestMailService.java:144)

       

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

       

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

       

          at java.lang.reflect.Method.invoke(Unknown Source)

       

          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)

       

          at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)

       

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)

       

          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)

       

          at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)

       

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)

       

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)

       

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)

       

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)

       

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)

       

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

       

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

       

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

       

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

       

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

       

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:480)

       

          at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

       

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49)

       

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

       

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

       

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

       

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

       

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

       

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

       

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)

       

          at java.lang.Thread.run(Unknown Source)

       

      Caused by: java.lang.LinkageError: Failed to link com/sun/mail/util/MailSSLSocketFactory (Module "javax.mail.api:main" from local module loader @b166b5 (roots: D:\jboss-as-7.0.0.Final\modules))

       

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401)

       

          at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)

       

          at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)

       

          at org.jboss.modules.Module.loadModuleClass(Module.java:588)

       

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

       

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

       

          at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)

       

          at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)

       

          at javax.mail.Service.connect(Service.java:317)

       

          at javax.mail.Service.connect(Service.java:176)

       

          at javax.mail.Service.connect(Service.java:125)

       

          at javax.mail.Transport.send0(Transport.java:194)

       

          at javax.mail.Transport.send(Transport.java:124)

       

          at si.xxxx.sdp.itmail.MailServiceImpl.sendMail(MailServiceImpl.java:372)

       

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

       

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

       

          at java.lang.reflect.Method.invoke(Unknown Source)

       

          at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

          at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

       

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)

       

          at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)

       

          at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271)

       

          ... 41 more

       

      Caused by: java.lang.NoClassDefFoundError: javax/net/ssl/SSLSocketFactory

       

          at java.lang.ClassLoader.defineClass1(Native Method)

       

          at java.lang.ClassLoader.defineClassCond(Unknown Source)

       

          at java.lang.ClassLoader.defineClass(Unknown Source)

       

          at java.security.SecureClassLoader.defineClass(Unknown Source)

       

          at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)

       

          ... 80 more

       

      Caused by: java.lang.ClassNotFoundException: javax.net.ssl.SSLSocketFactory from [Module "javax.mail.api:main" from local module loader @b166b5 (roots: D:\jboss-as-7.0.0.Final\modules)]

       

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)

       

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)

       

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)

       

          ... 85 more