Ok, here what I discovered.
For some reason this call was returning null on web mode.
PrintWriter printWriter = context.tryCreate(logger, packageName,
simpleName);
I found this on api:
Attempts to get a <code>PrintWriter</code> so that the caller can
generate the source code for the named type. If the named types already
exists, <code>null</code> is returned to indicate that no work needs to
be done.
Im not sure what I need to do now, but I resolve the problem changing the
name of generated class every time.
Im pretty sure that is not the right/better solution, but I will look
forward now.
If anyone still have tips about how this "name cache" works I will
appreciate any help.
On Wed, May 5, 2010 at 2:09 PM, Mike S. Matsumoto
<[email protected]>wrote:
> I just finish used the option: -gen myGenClasses.
> My MyServiceFactoryGenerated looks fine.
>
>
> Should I merge myGenClasses directory with war/WEB-INF/classes or something
> like that before deploy?
>
> ty
>
> On Wed, May 5, 2010 at 11:43 AM, Thomas Broyer <[email protected]> wrote:
>
>>
>>
>> On May 5, 12:50 am, Mike <[email protected]> wrote:
>> > Hi guys,
>> >
>> > I have the Generator bellow working perfectly on hosted mode inside
>> > eclipse but now I'm trying generate one .war to deploy on tomcat. The
>> > tomcat start normally without any error on log messages but my
>> > Generator does nothing.
>> >
>> > <generate-with
>> > class="br.com.mycompany.generator.PresenterFactoryGenerator">
>> > <when-type-assignable
>> > class="br.com.mycompany.client.generator.PresenterService" />
>> > </generate-with>
>> >
>> > public interface PresenterService {
>> > public Presenter newPresenter(Class class);
>> >
>> > }
>> >
>> > public class MyServiceFactory implements PresenterService {
>> > public Presenter newPresenter(Class class) { return null }
>> >
>> > }
>> >
>> > public class PresenterFactoryGenerator extends Generator {
>> > // at the end, creates a class to return dynamically any presenter
>> > that I want ;
>> >
>> > }
>> >
>> > PresenterService service = GWT.create(MyServiceFactory .class);
>> > MyPresenter presenter = service.newPresenter( someClazz );
>> >
>> > My Presenter comes null on web mode. I took too long to realize this
>> > because works perfectly inside Eclipse.
>> >
>> > PS: I have gwt-servlet.jar on my lib directory.
>> >
>> > Any help? I'm really lost here.
>>
>> Passing the -gen argument (e.g. "-gen gen") to the Compiler will
>> output the generated files into the given directory ("gen" in my
>> example) so you can explore what your generator outputs and eventually
>> find out why it fails.
>>
>> Beware of using Class<?> on the client side though... IMO, you'd
>> better generate one method per specific class you need (public
>> SomeClass newSomeClassPresenter() { ... }) instead of relying on
>> Class<?>.
>> Compile in Pretty or Detailed style and look at the generated JS code.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Web Toolkit" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-web-toolkit%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>>
>>
>
>
> --
> Mike Shigueru Matsumoto
>
--
Mike Shigueru Matsumoto
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.