0

ClassFormatError in doAfterCompose [closed]

asked 2016-01-19 08:33:27 +0800

Neus gravatar image Neus
1415 14

updated 2016-01-19 08:57:14 +0800

Hi,

Since yesterday I am getting an Exception in all the classes that overrides doAfterCompose from GenericForwardComposer. This is the exception's stacktrace:

java.lang.ClassFormatError: Duplicate method name&signature in class file org/sts/Pyme/PantallasZul/IndexPyme
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2904)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.zkoss.lang.Classes.forNameByThread(Classes.java:270)
at org.zkoss.lang.ImportedClassResolver.resolveClass(ImportedClassResolver.java:121)
at org.zkoss.zk.ui.impl.PageImpl.resolveClass(PageImpl.java:485)
at org.zkoss.zk.ui.impl.AbstractUiFactory.newComposer(AbstractUiFactory.java:142)
at org.zkoss.zk.ui.impl.Utils.newComposer(Utils.java:90)
at org.zkoss.zk.ui.metainfo.ComponentInfo.toComposer(ComponentInfo.java:355)
at org.zkoss.zk.ui.metainfo.ComponentInfo.toComposers(ComponentInfo.java:323)
at org.zkoss.zk.ui.metainfo.ComponentInfo.resolveComposer(ComponentInfo.java:310)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:834)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:826)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:735)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:797)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:757)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:699)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:442)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:356)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:217)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I checked that if I remove the doAfterCompose method it works fine.

The strange thing is that it begins to happen suddenly. Maybe because a Windows update or eclipse plugin update? But I'm not aware of none of these.

I'm using ZK 7.0.3-FL and JAVA EE 1.8

Thank you in advance.

My class code:

public class IndexPyme extends GenericForwardComposer<Component> {
    @Override
public void doAfterCompose(Component comp)throws Exception{
    super.doAfterCompose(comp);
    }
}
delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by Neus
close date 2016-01-19 10:32:48

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-01-19 08:51:43 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

Your class : org.sts.Pyme.PantallasZul.IndexPyme

Has a duplicated method signature. The reflection can't decide what method to take at this point.

Chill.

link publish delete flag offensive edit

Comments

But it is not true. My class haven't a duplicate method. The method it thinks is duplicated is the doAfterCompose that overrides the GenericForwardComposer method. If i delete this method it works fine.But I have plenty of overriding doAfterCompose I can't just delete all of them without knowing why

Neus ( 2016-01-19 08:55:54 +0800 )edit

I edited the post to include my class code...you will see that I haven't got any duplicated method....

Neus ( 2016-01-19 08:58:51 +0800 )edit

same issue in java 1.7?

chillworld ( 2016-01-19 09:12:31 +0800 )edit

Yes same issue, I checked that too....

Neus ( 2016-01-19 09:14:16 +0800 )edit

And same issue using Tomcat outside of Eclipse, so is not Ecplipse related....

Neus ( 2016-01-19 09:17:45 +0800 )edit
0

answered 2016-01-19 09:52:54 +0800

Darksu gravatar image Darksu
1991 1 4

Hello Neus,

Following is a working sample that you could refer to:

public class TestComposer extends GenericForwardComposer{

public void doAfterCompose(Component comp) throws Exception {
    super.doAfterCompose(comp);
    Clients.showNotification("doAfterCompose called");
}

}

Ref: http://zkfiddle.org/sample/2fgdol8/1-doAfterCompose-called#source-1

Best Regards,

Darksu

link publish delete flag offensive edit

Comments

I can't see anything different to my code. I think it is something related with my computer because I try the code in another computer and it worked! But I'm not able to find what is happening!

Neus ( 2016-01-19 10:09:25 +0800 )edit

Finally....It was something wrong with Tomcat...I deleted it and downloaded it again and it works.... I really don't know what was happening but it is solved. Thank you very much for your help

Neus ( 2016-01-19 10:32:19 +0800 )edit

Question tools

Follow

RSS

Stats

Asked: 2016-01-19 08:33:27 +0800

Seen: 14 times

Last updated: Jan 19 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More