google-code-export / gwt-test-utils

Automatically exported from code.google.com/p/gwt-test-utils
1 stars 0 forks source link

java.lang.NoClassDefFoundError: com.thoughtworks.paranamer.Paranamer #158

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Use @UiConstructor annotation in one of the widgets
2.Use that particular widget in one of your tests
3.java.lang.NoClassDefFoundError: com.thoughtworks.paranamer.Paranamer is thrown

What is the expected output? What do you see instead?
There should be no exception, but the exception described above is thrown.

What version of the product are you using? On what operating system?
gwt-test-utils-0.39 on Windows Vista within eclipse environment

Please provide any additional information below.
I believe that java.lang.NoClassDefFoundError: 
com.thoughtworks.paranamer.Paranamer is thrown since there is no Paranamer 
interface present in the gwt-test-utils jar, only JavaFileParanamer class which 
implements Paranamer interface.

Full stack trace:

java.lang.NoClassDefFoundError: com/thoughtworks/paranamer/Paranamer
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.getObjectFromUiConstructor(UiBinderInstanciator.java:90)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.getInstance(UiBinderInstanciator.java:41)
    at com.googlecode.gwt.test.uibinder.UiObjectTag.startTag(UiObjectTag.java:294)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.createUiTag(UiTagBuilder.java:164)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.startTag(UiTagBuilder.java:131)
    at com.googlecode.gwt.test.uibinder.UiXmlContentHandler.startElement(UiXmlContentHandler.java:73)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.googlecode.gwt.test.uibinder.UiBinderParser.createUiComponent(UiBinderParser.java:54)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.createAndBindUi(UiBinderInvocationHandler.java:86)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.invoke(UiBinderInvocationHandler.java:35)
.
.
.
Caused by: java.lang.ClassNotFoundException: caught an exception while 
obtaining a class file for com.thoughtworks.paranamer.Paranamer
    at javassist.Loader.findClass(Loader.java:359)
    at javassist.Loader.loadClass(Loader.java:311)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 50 more
Caused by: javassist.NotFoundException: com.thoughtworks.paranamer.Paranamer
    at javassist.ClassPool.get(ClassPool.java:436)
    at com.googlecode.gwt.test.internal.GwtTranslator.onLoad(GwtTranslator.java:35)
    at javassist.Loader.findClass(Loader.java:340)
    ... 52 more

Original issue reported on code.google.com by tomislav...@gmail.com on 27 Aug 2012 at 10:32

GoogleCodeExporter commented 9 years ago
since version 0.39, gwt-test-utils depends on the paranamer library 
(http://paranamer.codehaus.org/)

I guess you're not using maven to manage your dependencies, so you'll need to 
download the version 2.5 and add it manually to your classpath : 
http://search.maven.org/remotecontent?filepath=com/thoughtworks/paranamer/parana
mer/2.5/paranamer-2.5.jar

HTH

Original comment by gael.laz...@gmail.com on 27 Aug 2012 at 12:12

GoogleCodeExporter commented 9 years ago
Ok, thanks, I added all the dependencies I was missing. But, now, I have the 
following problem.

com.googlecode.gwt.test.exceptions.GwtTestUiBinderException: Error while 
calling @UiConstructor 'new ListBuilderWidget("Matching Items:", "Selected 
Items" );'
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.instanciate(UiBinderInstanciator.java:175)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.getObjectFromUiConstructor(UiBinderInstanciator.java:95)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.getInstance(UiBinderInstanciator.java:41)
    at com.googlecode.gwt.test.uibinder.UiObjectTag.startTag(UiObjectTag.java:294)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.createUiTag(UiTagBuilder.java:164)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.startTag(UiTagBuilder.java:131)
    at com.googlecode.gwt.test.uibinder.UiXmlContentHandler.startElement(UiXmlContentHandler.java:73)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.googlecode.gwt.test.uibinder.UiBinderParser.createUiComponent(UiBinderParser.java:54)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.createAndBindUi(UiBinderInvocationHandler.java:86)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.invoke(UiBinderInvocationHandler.java:35)
    at com.ericsson.itk.framework.client.gui.dialogs.listbuilderdialog.$Proxy27.createAndBindUi(Unknown Source)
    at com.ericsson.itk.framework.client.gui.dialogs.listbuilderdialog.ListBuilderDialogBox.<init>(ListBuilderDialogBox.java:39)
    at com.ericsson.itk.framework.client.gui.parameterspanel.selectchoice.SelectChoiceWidget.<init>(SelectChoiceWidget.java:42)
    at com.ericsson.itk.framework.client.gui.parameterspanel.SelectChoiceGwtTest.setUp(SelectChoiceGwtTest.java:54)
    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at com.googlecode.gwt.test.internal.runner.AbstractGwtRunner.run(AbstractGwtRunner.java:40)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.googlecode.gwt.test.exceptions.GwtTestUiBinderException: Found 
unexpected child element : <urn:ui:com.google.gwt.uibinder:text> in 
com.google.gwt.user.client.ui.Label
    at com.googlecode.gwt.test.uibinder.UiObjectTag.appendElement(UiObjectTag.java:185)
    at com.googlecode.gwt.test.uibinder.UiObjectTag.addElement(UiObjectTag.java:64)
    at com.googlecode.gwt.test.uibinder.UiTagBuilder.endTag(UiTagBuilder.java:116)
    at com.googlecode.gwt.test.uibinder.UiXmlContentHandler.endElement(UiXmlContentHandler.java:41)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.googlecode.gwt.test.uibinder.UiBinderParser.createUiComponent(UiBinderParser.java:54)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.createAndBindUi(UiBinderInvocationHandler.java:86)
    at com.googlecode.gwt.test.uibinder.UiBinderInvocationHandler.invoke(UiBinderInvocationHandler.java:35)
    at com.ericsson.itk.framework.client.gui.components.listbuilder.$Proxy28.createAndBindUi(Unknown Source)
    at com.ericsson.itk.framework.client.gui.components.listbuilder.ListBuilderWidget.<init>(ListBuilderWidget.java:85)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.googlecode.gwt.test.utils.GwtReflectionUtils.instantiateClass(GwtReflectionUtils.java:500)
    at com.googlecode.gwt.test.uibinder.UiBinderInstanciator.instanciate(UiBinderInstanciator.java:158)
    ... 50 more

Is it the problem with custom constructor which has two arguments, or there is 
something else problematic?

Thanks

Original comment by tomislav...@gmail.com on 27 Aug 2012 at 12:44

GoogleCodeExporter commented 9 years ago
I think it's something else. It seems you have some <text> element somwhere in 
your .ui.xml file which is not supported by gwt-test-utils. I never read about 
the possibility of using <text> element with UiBinder, so it might be a bug.

Could you please copy paste your UiBinder xml declaration ?

Original comment by gael.laz...@gmail.com on 27 Aug 2012 at 12:52

GoogleCodeExporter commented 9 years ago
Yes,

I have the following:

<g:Label addStyleNames="{style.label}" ui:field="labelMatchingItems">
    <ui:text from="{translations.ListBuilderWidget_Label_MatchingItems}:" />
</g:Label>

I will try to find some workaround for this.

Original comment by tomislav...@gmail.com on 27 Aug 2012 at 12:59

GoogleCodeExporter commented 9 years ago
I confirm it's a bug in gwt-test-utils, the <ui:text> was never supported... 
Could you please open a new issue to ask for support and I'll fixed it asap for 
the coming 0.40 version. 

Original comment by gael.laz...@gmail.com on 27 Aug 2012 at 1:10

GoogleCodeExporter commented 9 years ago
Ok, I will open a new issue for that.

In the meantime, the workaround is following:

<g:Label addStyleNames="{style.label}" ui:field="labelMatchingItems" 
text="{translations.ListBuilderWidget_Label_MatchingItems}:" />

Original comment by tomislav...@gmail.com on 27 Aug 2012 at 1:21

GoogleCodeExporter commented 9 years ago
Thank you very much ;-)

Original comment by gael.laz...@gmail.com on 27 Aug 2012 at 1:24