- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个类 NotifyBuilderUtil,我试图在其中创建另一个类 CustomEmailNotification 的对象。但是,在创建对象时,出现错误:
java.lang.NoSuchMethodError: net.mail.CustomEmailNotification: method <init>()V not found
package org.module.definition.notify;
...
import net.mail.CustomEmailNotification;
...
public class NotifyBuilderUtil implements InitializingBean {
private static NotifyBuilderUtil instance;
public NotifyBuilderUtil() {
if(instance != null) throw new SingletonViolationException(NotifyBuilderUtil.class);
instance = this;
}
...
...
public static void buildElements(DefinableEntity entity, Element item, Notify notifyDef, Writer writer, NotifyVisitor.WriterType writerType, Map params, boolean processItem) {
...
String flagElementPath = "./notify";
Element flagElem = (Element) nextItem.selectSingleNode(flagElementPath);
Map oArgs = DefinitionUtils.getOptionalArgs(flagElem);
NotifyVisitor visitor = new NotifyVisitor(entity, notifyDef, customItem, writer, writerType, params);
CustomEmailNotification cen = new CustomEmailNotification();
cen.constructInternalWriter(entity, visitor, flagElem, oArgs);
...
}
}
自定义电子邮件通知:
public class CustomEmailNotification {
private static Map timeFieldMap = null;
public static Writer internalWriter = null;
public static Writer externalWriter = null;
Writer writer;
public CustomEmailNotification() {
timeFieldMap = new HashMap();
}
...
public static void constructInternalWriter(DefinableEntity entity, NotifyVisitor visitor, Element flagElement, Map oArgs) {
...
...
}
}
错误信息是:
ERROR [http-8086-1] [org.kablink.teaming.spring.web.portlet.DispatcherPortlet] - Could not complete request
javax.portlet.PortletException: Error occured during request processing: net.mail.CustomEmailNotification: method <init>()V not found
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:662)
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:519)
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:460)
at org.kablink.teaming.portletadapter.servlet.PortletAdapterController.handleRequestInternal(PortletAdapterController.java:105)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.kablink.teaming.portletadapter.servlet.PortletAdapterServlet.service(PortletAdapterServlet.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kablink.teaming.web.servlet.filter.LoginFilter.doFilter(LoginFilter.java:155)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kablink.teaming.web.servlet.filter.DefaultCharacterEncodingFilter.doFilter(DefaultCharacterEncodingFilter.java:60)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.kablink.teaming.spring.security.LogoutFilter.doFilterHttp(LogoutFilter.java:73)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kablink.teaming.asmodule.servlet.filter.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:127)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.kablink.teaming.tomcat.valve.ZoneContextValve.invoke(ZoneContextValve.java:69)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:316)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NoSuchMethodError: net.mail.CustomEmailNotification: method <init>()V not found
at org.kablink.teaming.module.definition.notify.NotifyBuilderUtil.buildElements(NotifyBuilderUtil.java:203)
at org.kablink.teaming.module.definition.notify.NotifyBuilderUtil.buildElements(NotifyBuilderUtil.java:175)
at org.kablink.teaming.module.mail.impl.DefaultEmailFormatter.buildMessage(DefaultEmailFormatter.java:821)
at org.kablink.teaming.module.mail.MimeNotifyPreparator.prepare(MimeNotifyPreparator.java:334)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:352)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
at org.kablink.teaming.module.mail.impl.MailModuleImpl.sendMail(MailModuleImpl.java:1139)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.kablink.teaming.module.interceptor.EventListenerManagerInterceptor.invoke(EventListenerManagerInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.kablink.teaming.util.aopalliance.InvocationStatisticsInterceptor.invoke(InvocationStatisticsInterceptor.java:49)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy13.sendMail(Unknown Source)
at org.kablink.teaming.module.admin.impl.AbstractAdminModule.sendMail(AbstractAdminModule.java:1174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.kablink.teaming.search.interceptor.IndexSynchronizationManagerInterceptor.invoke(IndexSynchronizationManagerInterceptor.java:67)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.kablink.teaming.module.interceptor.EventListenerManagerInterceptor.invoke(EventListenerManagerInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.kablink.teaming.util.aopalliance.InvocationStatisticsInterceptor.invoke(InvocationStatisticsInterceptor.java:49)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy16.sendMail(Unknown Source)
at org.kablink.teaming.web.util.BinderHelper.sendMailOnEntryCreate(BinderHelper.java:3171)
at org.kablink.teaming.portlet.forum.ModifyEntryController.handleActionRequestAfterValidation(ModifyEntryController.java:202)
at org.kablink.teaming.web.portlet.SAbstractController.handleActionRequestInternal(SAbstractController.java:257)
at org.springframework.web.portlet.mvc.AbstractController.handleActionRequest(AbstractController.java:199)
at org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter.handleAction(SimpleControllerHandlerAdapter.java:64)
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:641)
... 70 more
我找不到发生这种情况的原因。谁能帮我指出我哪里出错了?
我正在使用 Apache Tomcat/6.0.35
JVM 版本:1.7.0_21-b11
最佳答案
(在评论中回答。转换为社区 wiki 答案。参见 Question with no answers, but issue solved in the comments (or extended in chat))
OP 写道:
The problem is fixed now. The error was due to SVN branching. In a separate branch, there is another java class
EmailHelper.java
within the same folder whereCustomEmailNotification.java
resides. So when I switched from that branch to my current one, I did not checkout that branch as I did not require theEmailHelper.java
, hence the error. Just created a separate folder containing justCustomEmailNotification.java
, and the error is gone. Thanks to all for taking their time in looking into this
关于java - 创建类的对象时找不到方法 <init>()V,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16833697/
例如,我有一个父类Author: class Author { String name static hasMany = [ fiction: Book,
代码如下: dojo.query(subNav.navClass).forEach(function(node, index, arr){ if(dojo.style(node, 'd
我有一个带有 Id 和姓名的学生表和一个带有 Id 和 friend Id 的 Friends 表。我想加入这两个表并找到学生的 friend 。 例如,Ashley 的 friend 是 Saman
我通过互联网浏览,但仍未找到问题的答案。应该很容易: class Parent { String name Child child } 当我有一个 child 对象时,如何获得它的 paren
我正在尝试创建一个以 Firebase 作为我的后端的社交应用。现在我正面临如何(在哪里?)找到 friend 功能的问题。 我有每个用户的邮件地址。 我可以访问用户的电话也预订。 在传统的后端中,我
我主要想澄清以下几点: 1。有人告诉我,在 iOS 5 及以下版本中,如果您使用 Game Center 设置多人游戏,则“查找 Facebook 好友”(如与好友争夺战)的功能不是内置的,因此您需要
关于redis docker镜像ENTRYPOINT脚本 docker-entrypoint.sh : #!/bin/sh set -e # first arg is `-f` or `--some-
我是一名优秀的程序员,十分优秀!