<?xml version="1.0" encoding="UTF-8"?>
<chapter id="sid-32473113">
   <title>Troubleshooting &amp; FAQ</title>
   <para>This section explains the cause of and solution to some common problems that people encounter when building applications with Errai.</para>
   <para>Of course, when lots of people trip over the same problem, it's probably because there is a deficiency in the framework! A FAQ list like this is just a band-aid solution. If you have suggestions for permanent fixes to these problems, please get in touch with us: file an issue in our issue tracker, chat with us on IRC, or post a suggestion on our forum.</para>
   <para>But for now, on to the FAQ:</para>
   <section id="sid-32473113_Troubleshooting%26FAQ-WhydoesitseemthatErraican%27tseemyclassatcompiletime%3F">
      <title>Why does it seem that Errai can't see my class at compile time?</title>
      <para>Possible symptoms:</para>
      <itemizedlist>
         <listitem>
            <para>
            uncaught exception: java.lang.RuntimeException: No proxy provider found for type:
            <emphasis role="italics">my.fully.qualified.ServiceName</emphasis>
            </para>
         </listitem>
      </itemizedlist>
      <para>
        <emphasis role="strong">Answer:</emphasis>
        Make sure the
        <xref linkend="sid-5931354"/>
        file is actually making it into your runtime classpath.
      </para>
      <para>One common cause of this problem is a &lt;resources&gt; section in pom.xml that includes src/main/java (to expose .java sources to the GWT compiler) that does not also include src/main/resources as a resource path. You must include both explicitly:</para>
      <informalexample>
         <programlisting language="xml">
&lt;resources&gt;
  &lt;resource&gt;
    &lt;directory&gt;src/main/java&lt;/directory&gt;
  &lt;/resource&gt;
  &lt;resource&gt;
    &lt;directory&gt;src/main/resources&lt;/directory&gt;
  &lt;/resource&gt;
&lt;/resources&gt;
</programlisting>
      </informalexample>
   </section>
   <section id="sid-32473113_Troubleshooting%26FAQ-WhyamIgetting%22java.lang.ClassFormatError%3AIllegalmethodname%22%3Cinit%3E%24%22inclassorg%2Fxyz%2Fpackage%2FMyClass%22%3F">
      <title>Why am I getting "java.lang.ClassFormatError: Illegal method name "&lt;init&gt;$" in class org/xyz/package/MyClass"?</title>
      <para>
        <emphasis role="strong">Answer:</emphasis>
        This error message means that your project has a (direct or indirect) subclass of JavaScriptObject that lacks a protected no-args constructor. All subtypes of JavaScriptObject (also known as
        <emphasis role="italics">overlay types</emphasis>
        ) must declare a protected no-args constructor, but the error message could be much clearer. There is an issue filed in the GWT project's bug tracker for improving the error message:
        <ulink url="http://code.google.com/p/google-web-toolkit/issues/detail?id=3383">GWT issue 3383</ulink>
        .
      </para>
   </section>
</chapter>