Giter Club home page Giter Club logo

gwt-exporter's People

Contributors

cromwellian avatar manolo avatar

Watchers

 avatar

gwt-exporter's Issues

ClassCastException when passing object to method with interface-type parameter

What steps will reproduce the problem?
1. Create exportable interface and implementation
2. Create exportable service that accepts the interface as parameter in one of 
its methods
3. Pass implementation of 1) to service method of 2)

What is the expected output? What do you see instead?
I expect the method to be called, but a ClassCastException is thrown

What version of the product are you using? On what operating system?
2.4.0, linux

Please provide any additional information below.
This worked well in version 2.3.1-SNAPSHOT

I will attach a unit test case that shows the problem

Original issue reported on code.google.com by [email protected] on 31 May 2012 at 8:37

maven build failed

The project doesn't seem to compile under JDK1.6.x+ maven 2.2.1. Adding the 
following dependency will fix the problem:

  <dependency>
    <groupId>sun.jdk</groupId>
    <artifactId>tools</artifactId>
    <version>1.6.0</version>
    <scope>system</scope>
    <systemPath>${java.home}/../lib/tools.jar</systemPath>
  </dependency>



Original issue reported on code.google.com by [email protected] on 23 Jul 2010 at 11:40

Overloaded methods returning arrays give "java.lang.ClassCastException: null" when called.

Overloaded methods - with the same name but different arguments - explode when 
the return value is an array type.
------------------------
@ExportPackage("tst")
@Export
public class Test implements Exportable {
    public int[] method(int i) { return new int[]{1}; }
    public int[] method(String s) { return new int[]{1}; }
}
------------------------
What is the expected output?
>((new tst.Test()).method(1))
>>[1]
>((new tst.Test()).method('1'))
>>[1]
What do you see instead?
>((new tst.Test()).method(1))
>>null
>((new tst.Test()).method('1'))
>>null

What version of the product are you using? On what operating system?
gwt-exporter 2.3.1 latest snapshot. Windows 7.

Please provide any additional information below.

Java Exception while gwt debugging.

java.lang.ClassCastException: null
    at java.lang.Class.cast(Unknown Source)
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:163)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:65)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at org.timepedia.exporter.client.ExporterBaseActual.runDispatch(ExporterBaseActual.java)
    at org.timepedia.exporter.client.ExporterBaseActual.runDispatch(ExporterBaseActual.java:513)
    at org.timepedia.exporter.client.ExporterBaseActual.runDispatch(ExporterBaseActual.java:539)
    at org.timepedia.exporter.client.ExporterUtil.runDispatch(ExporterUtil.java:63)
    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 com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
    at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
    at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)
    at sun.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
    at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
    at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:167)
    at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Unknown Source)


Original issue reported on code.google.com by [email protected] on 12 Oct 2011 at 8:18

Sample won't compile!

What steps will reproduce the problem?
1. Use the latest version of gwt
2. Attempt to build ExportDemo

What is the expected output? What do you see instead?
It should compile. It gives the following error:
[WARN] Line 62: Referencing method
'org.timepedia.exporter.client.ExporterUtil.wrap([Lorg/timepedia/exporterdemo/cl
ient/Person;)':
unable to resolve method, expect subsequent failures

This causes it to fail completely:
     [java]       [ERROR] Line 9:  Unresolvable native reference to method
'wrap' in type 'org.timepedia.exporter.client.ExporterUtil' (did you mean
'wrap(Lorg/timepedia/exporter/client/Exportable;)Lcom/google/gwt/core/client/Jav
aScriptObject;',
'wrap([B)Lcom/google/gwt/core/client/JavaScriptObject;',
'wrap([C)Lcom/google/gwt/core/client/JavaScriptObject;',
'wrap([D)Lcom/google/gwt/core/client/JavaScriptObject;',
'wrap([F)Lcom/google/gwt/core/client/JavaScriptObject;',
'wrap([I)Lcom/google/gwt/core/client/JavaScriptObject;',
'wrap([J)Lcom/google/gwt/core/client/JavaScriptObject;',
'wrap([Lorg/timepedia/exporter/client/Exportable;)Lcom/google/gwt/core/client/Ja
vaScriptObject;',
'wrap([S)Lcom/google/gwt/core/client/JavaScriptObject;'?)

What version of the product are you using? On what operating system?
2.0.10

Please provide any additional information below.
I would really like to use these samples as they have the Person[] array
that I need to complete my project.

Regards,
Brant

Original issue reported on code.google.com by [email protected] on 5 Feb 2010 at 10:22

ClassCastException when using arrays of ExportOverlay classes as a return type for methods.

I have 2 classes for which I have created an ExportOverlay (coordinate and 
geometry). The geometry class has a method that returns an array of 
coordinates. When using this method (tested through a GWTTestCase), I run into 
a ClassCastException that says: cannot cast Coordinate to Exportable.

Original Coordinate and Geometry classes: 
https://svn.geomajas.org/majas/trunk/backend/api/src/main/java/org/geomajas/geom
etry/

Overlays classes are attached.

Now using the following code in a GWTTestCase will result in a 
ClassCastException:

var geometry = new $wnd.org.geomajas.jsapi.spatial.Geometry("Point", 0, 0);
geometry.setCoordinates([ new $wnd.org.geomajas.jsapi.spatial.Coordinate(10, 
10), new $wnd.org.geomajas.jsapi.spatial.Coordinate(20, 20) ]);

// This gives the error:
geometry.getCoordinate();


I have also tested this with other cases(classes) where I return arrays, and 
they all seem to run into this problem.

Original issue reported on code.google.com by [email protected] on 16 Nov 2011 at 8:21

Attachments:

Unable to export Class method with java.lang.Object return type

What steps will reproduce the problem?
1. I have a closure-based interface with one method with a return type of 
java.lang.Object
2. I added an ExportOverlay for java.lang.Object
3. Return values from the interface always end up as null, no matter what.

What version of the product are you using? On what operating system?
Using trunk r18

Please provide any additional information below.
Here is the interface I started with:

@Export
@ExportClosure
public interface FooHandler {
  public Object handle(Object result);
}

and the overlay:

@Export
@ExportClosure
public interface ObjectExporter extends ExportOveraly<Object> {}



Finally, a class that uses FooHandlers:

@Export
public class FooFactory implements Exportable {
  public void setHandler(FooHandler fh) {
    Object o = fh.handle(new Object());
    // can't do anything with 'o', it's null
  }
}


And lastly, in JavaScript we do this:

var fooFactory = new FooFactory();
fooFactory.setHandler(function(o){return o;});


I also tried modifying the ExportPackage for the overlay type - unfortunately, 
at least Firefox has a fit 
when I try to export a function named 'java.lang.Object' - try it, you can't do 
it.

Any guidance at all here on how to work with interfaces that return classes out 
of my control?

Original issue reported on code.google.com by [email protected] on 3 Jun 2009 at 1:48

A more java like syntax using annotations

example:

package org.example.yourcode.format.client;
public class DateFormatterLib implements EntryPoint {

  // Expose the following method into JavaScript.
  private static String formatAsCurrency(double x) {
    return NumberFormat.getCurrencyFormat().format(x);
  }

  // Set up the JS-callable signature as a global JS function.
  @Publish(jsMethod="$wnd.formatAsCurrency" klass=DateFormatterLib.class
method="formatAsCurrency(D)")
  private native void publish() /*-{   
  }-*/;

  // Auto-publish the method into JS when the GWT module loads.
  public void onModuleLoad() {
    publish();
  }
}

Original issue reported on code.google.com by [email protected] on 19 Jul 2008 at 7:22

GWT.create in a GWTestCase exports only once

What steps will reproduce the problem?
1. invoke GWT.create(MyExportable.class) in a gwtSetUp() method
2. have more than one test class that uses the MyExportable class in javascript
3. One of the tests will not have access to the JS MyExportable class

What is the expected output? What do you see instead?
Expected that all tests in the same VM should have access to the JS interface 
exported

What version of the product are you using? On what operating system?


Please provide any additional information below.
It appears that GWT.create will not re-evaluate the generator logic across 
multiple calls in the same VM. Because the JS class is written as a side effect 
of the generator, subsequent calls do not output any JS.
You might consider supporting the "export()" on the Exporter interface to 
ensure that there remains a way to force export the JS class.

Original issue reported on code.google.com by [email protected] on 14 Oct 2010 at 3:58

Force renaming module name <module rename-to="myModuleName">

What steps will reproduce the problem?
1. Force thhe   
2. Set rename-to="myModuleName"

Code: 
<module rename-to="myModuleName">
<inherits name='com.google.gwt.user.User'/>

<!--  Export GWT to JavaScript -->
<inherits name='org.timepedia.exporter.Exporter'/>
<set-property name="export" value="yes"/>

...
</module>

The exportable classe :

@Export
@ExportPackage("hello")
public class Hello implements Exportable{

    public String to(String name){
        return "Welcome " + name;
    }
}

3.

What is the expected output? What do you see instead?



What version of the product are you using? On what operating system?

 - GWT 2.4 with default Jetty container
 - Java 6
 - gwtexporter-2.4.0-M2-SNAPSHOT.jar
 - gwtexporter-2.4.0-M1.jar 

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 16 May 2012 at 7:28

Function name mangling on export

Using GWT 2.2 and the patched GWT-Exporter from here 
(http://code.google.com/p/gwt-exporter/issues/detail?id=27#c3), I am getting 
mangled method names 
in the JavaScript.  The method names are getting “_0” suffixes.

For example:

@Export
public class MyTest implements Exportable {

    @Export
    public String getMessage() {
        return “Hi there!”;
    }

}


Instances of this class in JavaScript end up with a line like:


_.getMessage_0 = function getMessage(){

  return 'This is a message';

}

;

Inspecting the MyTest object using FireBug shows the “getMessage_0” method. 
 Calling “getMessage_0” from external JS works, but calling 
“getMessage” does not - the method does not exist.

I tried using @Export(“getMessage”) on the method which didn't change 
anything.  I then tried @Export(“foobar”) and now the “_0” is dropped 
and “getMessage()” works. (!?).   Do I have to create bogus names in the 
@Export annotation for all my exported methods?  

Additional info:

To create instances of the MyTest object, I have a Java factory object that is 
also exported. It has a single static method that returns a MyTest object.  I 
then put a JS method on $wnd during onModuleLoad that calls the static factory 
method:

public native void publishFactoryMethod()
 /*-{


      $wnd.createTestInstance = $entry(@mypackage.TestFactory::createTestInstance());

}-*/;


Any ideas?  Am I doing something wrong or is this a defect?
Thanks,
DL

Original issue reported on code.google.com by [email protected] on 18 Mar 2011 at 6:06

ExportOverlay<T> does not work if T is an interface

What steps will reproduce the problem?
1.Create a new class which implements ExportOverlay<T> interface having T as an 
interface.
2.Try to export any of methods 
3.Following exception is thrown:
Referencing method 
'com.ericsson.itk.framework.client.javascriptapi.exporters.JsHandlerRegistration
ExporterImpl.___create()': unable to resolve method

What is the expected output? What do you see instead?
Expected is to have the interface exposed and to be able to handle the exposed 
interface in the native JavaScript

What version of the product are you using? On what operating system?
gwt-exporter-2.4.0-M2-SNAPSHOT, Windows Vista and CentOS 5.5

Please provide any additional information below.
@Export
@ExportPackage("_internal")
public class JsHandlerRegistration implements 
ExportOverlay<HandlerRegistration> {

    @Export
    public JsHandlerRegistration() {

    }

    public void removeHandler() {

    }
}

So, I would like to be able to do the following:

@Export("addHandler")
public static HandlerRegistration addNewHandler(JsFunction function) {
HandlerRegistration handler = eventBus.addHandler(...);
...
return handler;
}

And then in the JavaScript the following (we are assuming that the method above 
is exported in the Handlers package):
var handler = Handlers.addHandler(function(){});
...
handler.removeHandler();

Original issue reported on code.google.com by [email protected] on 7 Sep 2012 at 11:10

How to handle the return type null in Class Method

I have a Class with a method which return a exportable class value :
like this
public class A
{
  ...
}

public class B
{
   public A method1()
  {
     ....
     return null;
  }
}

then when i call the method method1 in an instance of B,it says something 
is error. i need a help.

Original issue reported on code.google.com by [email protected] on 28 Oct 2008 at 2:42

Exporter fails in DevMode when using Closures

What steps will reproduce the problem?
Simply wrote the tutorial sample :
1. Define an exportable interface with one single method and with tag 
@ExportClosure
2.
3. Define another class to export, declaring a method with closure as argument

What is the expected output? What do you see instead?
In DevMode, Defered binding fails for the non-closure class.

What version of the product are you using? On what operating system?
Gwt 2.2.0, gwt-exporter 2.0.10, on Jdk 1.6.0_25 XP

Please provide any additional information below.

My project worked well in previous gwt version (2.0.4). I need to use 
CanvasElement from 2.2.0.

Original issue reported on code.google.com by [email protected] on 18 May 2011 at 1:23

Exceptions thrown from exported code aren't propagated

I have some library code that throws an exception with a useful message on 
failure.  When this code is exported the exceptions never reach the calling JS. 
 Supporting this would be really useful; exceptions are a good way of 
communicating failures without compromising the return type of the method.

I tried using RuntimeException and also raising an Error directly in JS but the 
behaviour is the same.

Some code that demonstrates the behaviour:

@Export
@ExportPackage("sh.lib")
public class TagSelection implements Exportable {
  public static String test(boolean fail) {
    if (fail) {
      return failInJS();
    }
    return "Hello";
  }

  public static native String failInJS() /*-{
    throw new Error("Bang");
  }-*/;
}

<script language='javascript'>
    function runTest() {
      try {
        alert(sh.lib.TagSelection.test(false));
        alert(sh.lib.TagSelection.test(true));
        alert('Done');
      }
      catch (e) {
        alert('Caught ' + e);
      }
    }
</script>

Calling runTest prints:

Hello
null
Done

I would expect:

Hello
Caught $exception

Original issue reported on code.google.com by [email protected] on 31 Aug 2010 at 9:55

public final method is not exported in subclass

What steps will reproduce the problem?
1. Create an exportable abstract class MySuper with exported method public 
final String hello(){}
2. Let MySuper export everything
3. Create a concrete class MySub, exportable with @Export(all=true)

What is the expected output? 
* hello() is available in MySub 

What do you see instead?
* hello() is not available in MySub (debugged in Google Chrome)

What version of the product are you using? On what operating system?
latest 2.3.1-SNAPSHOT, GWT 2.3, Java 7, Windows XP SP3 


Please provide any additional information below.
*Workaround: remove final modifier in super class, then method is available.
*GWT exporter rocks


Original issue reported on code.google.com by [email protected] on 15 Sep 2011 at 1:48

ExportOverlay classes cannot be return types

What steps will reproduce the problem?

1. A class exports a method with an ExportOverlay'd return type.
   In this example, Child and Mother are part of a gwt module. XChild
   and XMother are corresponding wrappers. This example generates a
   GWT compilation error.

public class Child {
    private String name;
    public Child(String cname) { name = cname; }
    public String getName() { return name; }
}

public class Mother {
    public void setChild(Child c) {}
    public Child getChild() { return null; }
}

@Export
public class XChild implements ExportOverlay<Child>{
    public String getName() { return null; }
}

@Export
public class XMother implements ExportOverlay<Mother>{
    public void setChild(Child c) {}
    public Child getChild() { return null; }
}

What is the expected output? What do you see instead?

In the generated XMotherExporterImpl, GWT.create() is invoked on
Child.class rather than XChild.class, causing the compilation to fail.
The compilation error is due to the fact that Class 'Child' does not provide 
the default constructor needed for GWT.create())

"""
private static boolean exported;
public void export() { 
  if(!exported) {
        exported=true;
        org.timepedia.exporter.client.Exporter export0 = (org.timepedia.exporter.client.Exporter) GWT.create(com.example.test.Child.class);
        export0();
      }
    }
"""


What version of the product are you using? On what operating system?

 - GWT 2.3.0
 - gwtexporter-2.3.1-SNAPSHOT
 - linux 64bit
 - Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
 - Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

Please provide any additional information below.

I have two additional concerns with ExportOverlay:

I would think that the goal of ExportOverlay<?> is to essentially export to 
JavaScript classes you don't control, e.g. from a 3rd party lib, or to separate 
a pure-GWT implementation from the JavaScript GWT bindings.

What I find slightly inconvenient is that the decoupled class being
exported with ExportOverlay, i.e. Mother or Child, will have all the
characteristics of an Exportable class:
   - Added to the typemap (ExporterUtil::addTypeMap())
   - Receive the special __gwtex_wrap property.
   - Their wrappers have the __gwt_instance property.

but, it still won't implement the Exportable interface, making it
very difficult to use it with some of the ExporterUtil methods, from
Java code. 

For instance, in the generated wrappers for XMother.getChild(), a call
to ExporterUtil.wrap(x) is made in JSNI:

"""
_.getChild = $entry(function() { 
        var x = [email protected]::getChild()();
        return @org.timepedia.exporter.client.ExporterUtil::wrap(Lorg/timepedia/exporter/client/Exportable;)(x);
      });
"""

Trying to call wrap(x) from Java or hosted mode, like this example does would 
likely throw a classcast exception: type Child does not implement Exportable.

Is there a workaround planned for that?

Perhaps introducing another variant of wrap() with a looser signature, or 
introducing additional rebinding magic ?

perhaps providing something like this ?:

public <U, V extends ExportOverlay<U>> void wrap(U exported, Class<V> 
overlayClass) {
... 
}


Original issue reported on code.google.com by [email protected] on 19 Aug 2011 at 10:46

moderated group

would be great if can create a moderated group to futher encourages more
preople to use it

Original issue reported on code.google.com by [email protected] on 28 Feb 2010 at 1:22

ClassCastException caused in Javascript When passing object to JSNI function

What steps will reproduce the problem?
1. Create a class marked up to be exported

package com.package.module.shared.model;
     @ExportPackage("module")
     @Export(value="Chart")
     public class Chart  implements Exportable, IsSerializable  { ... } // this needs to be referenced in the JSNI
2.  Create JSNI to expose the addChart Java Funtion
    private static native void publish() /*-{
        $wnd.ChartManager = {
            addChart : function(chrt) { $entry( @com.package.module.client.ChartManager::addChart(Lcom/package/module/shared/model/Chart;)(chrt)); }
            ,newChart : function(){ return @com.package.module.shared.model.Chart::create(); }
            ,addChartFailure: function(msg) {$wnd.alert('no implementation err: ' + msg); }
            ,addChartSuccess: function(chart) {$wnd.alert('addChartSuccess not implemented'); }
        };
    }-*/;
3. Create addChart JSNI Function to call the GWT RPC
    public static void addChart(Chart chart) {

        Window.alert("inside here?");
        ChartServiceAsync chartService = GWT.create(ChartService.class);
        chartService.addChart(chart,
                new AsyncCallback<Chart>() {
                    public void onFailure(Throwable caught) {
                        ChartManager.addChartFailure(caught.getMessage());

                    }

                    public void onSuccess(Chart result ) {
                        ChartManager.addChartSuccess(result);
                    }
                }); 
        }
    }
4 Call the exported javascript from a plain old html page test.html

<script type="text/javascript"  
src="chartmanager/chartmanager.nocache.js"></script>

           function doSomthing(){
                 try
                {
            var cht = new module.Chart();


            cht.setChartDescription('this is the chart description');
            cht.setName('crazy new chart');
                alert('wow where here2' ); // this occurs
                window.ChartManager.addChart(cht);
                alert('wow where here3' );  // never gets here
                }catch( err )
                  {
                  alert('err: ' + err ) //This displays a ClassCastException, occurs before alert("inside here?");
                 }

          }



What is the expected output? What do you see instead?

I should be seeing an alert "inside here" then a GWT RPC call to add the Chart 
to the data store
However the catch statement catches a ClassCastException

What version of the product are you using? On what operating system?
gwtexporter-2.4.0-M1 running on AMD Windows 7 Pro

Please provide any additional information below.

 This is my first attempt to use the GWT RPC from a legacy javascript implementation.
other RPC calls using Strings(primitives) use the same pattern that work fine.
It seems when complex objects are in use strange things happen.
I suspect that the serialized GWT version of the object is colliding with the 
GWT exporter version
but have no idea how to remedy it.

Joseph



Original issue reported on code.google.com by [email protected] on 1 Jun 2012 at 11:22

ClassCastException when passing factory-based object to method with interface-type parameter

What steps will reproduce the problem?
1. Create exportable interface and implementation
2. Create exportable service that accepts the interface as parameter in one of 
its methods
3. Create exportable factory that returns implementation of 1
4. Create object with factory and pass to service method of 2)


What is the expected output? What do you see instead?
I expect the method to be called, but a ClassCastException is thrown

What version of the product are you using? On what operating system?
2.4.0, linux

Please provide any additional information below.
This worked well in version 2.3.1-SNAPSHOT

Attached is a unit test case

Original issue reported on code.google.com by [email protected] on 14 Sep 2012 at 10:46

Enter one-line summary

What steps will reproduce the problem?
1. What is this
2. Is this some kind of bugzila?
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 15 Jun 2007 at 5:02

JsDoclet and method detail

JsDoclet don't generate method detail for Javascript API Documentation as a 
result, javadoc tags(for instance: @return, @param) are ignored.

Original issue reported on code.google.com by [email protected] on 11 Jul 2012 at 9:06

Returning an exported class

I would like to return a class that I have created from another class similar 
to this

@Export
@ExportPackage("mypackage")
public class MyClassToExport implements Exportable {

}

@Export
@ExportPackage("mypackage")
public class MyClass implements Exportable {
     MyClassToExport test = new MyClassToExport();

     @Export
     public MyClassToExport getTheClass()
     {
        return this.test;
     }
}

But when I try to call this object it is null

Original issue reported on code.google.com by [email protected] on 20 Jul 2010 at 4:07

API documentation generator doesn't work, only empty doc folder and javadoc.xml generated

My project works well with gwt-exporter. But the docs doesn't get generated.

The attached screenshot is my javadoc export settings and the generated 
javadoc.xml.

Below is the messages in console while generating the docs.
------------------------------------------------
Loading source files for package com.topcmm.client.datamodel...
Loading source files for package com.topcmm.client...
Loading source files for package com.topcmm.client.util...
Loading source files for package com.topcmm.client.listener...
Constructing Javadoc information...
Building tree for all the packages and classes...
Generating com/topcmm/client/datamodel/\ExportRoom.html...
Generating com/topcmm/client/datamodel/\ExportTextMessage.html...
Generating com/topcmm/client/datamodel/\ExportUser.html...
Generating com/topcmm/client/\ExportChatBehind.html...
Generating com/topcmm/client/\ExportFacade.html...
Generating com/topcmm/client/\ListenerRegistry.html...
Generating com/topcmm/client/util/\ExportStrings.html...
Generating com/topcmm/client/util/\RoomArray.html...
Generating com/topcmm/client/listener/\CloseListener.html...
Generating com/topcmm/client/listener/\ConnectedListener.html...
Generating com/topcmm/client/listener/\EnterRoomListener.html...
Generating com/topcmm/client/listener/\InitSuccessListener.html...
Generating com/topcmm/client/listener/\JsCloseListener.html...
Generating com/topcmm/client/listener/\JsConnectedListener.html...
Generating com/topcmm/client/listener/\JsEnterRoomListener.html...
Generating com/topcmm/client/listener/\JsInitSuccessListener.html...
Generating com/topcmm/client/listener/\JsLoginCompleteListener.html...
Generating com/topcmm/client/listener/\JsLoginErrorListener.html...
Generating com/topcmm/client/listener/\JsLogoutCompleteListener.html...
Generating com/topcmm/client/listener/\JsRoomAddUserListener.html...
Generating com/topcmm/client/listener/\JsRoomListReceivedListener.html...
Generating com/topcmm/client/listener/\JsRoomOnlineUserListener.html...
Generating com/topcmm/client/listener/\JsRoomQuitUserListener.html...
Generating com/topcmm/client/listener/\JsTalkMessageListener.html...
Generating com/topcmm/client/listener/\LoginCompleteListener.html...
Generating com/topcmm/client/listener/\LoginErrorListener.html...
Generating com/topcmm/client/listener/\LogoutCompleteListener.html...
Generating com/topcmm/client/listener/\RoomAddUserListener.html...
Generating com/topcmm/client/listener/\RoomListReceivedListener.html...
Generating com/topcmm/client/listener/\RoomOnlineUserListener.html...
Generating com/topcmm/client/listener/\RoomQuitUserListener.html...
Generating com/topcmm/client/listener/\TalkMessageListener.html...
Generating overview-frame.html...
Generating com/topcmm/client/\package-frame.html...
Generating com/topcmm/client/\package-summary.html...
Generating com/topcmm/client/\package-tree.html...
Generating com/topcmm/client/datamodel/\package-frame.html...
Generating com/topcmm/client/datamodel/\package-summary.html...
Generating com/topcmm/client/datamodel/\package-tree.html...
Generating com/topcmm/client/listener/\package-frame.html...
Generating com/topcmm/client/listener/\package-summary.html...
Generating com/topcmm/client/listener/\package-tree.html...
Generating com/topcmm/client/util/\package-frame.html...
Generating com/topcmm/client/util/\package-summary.html...
Generating com/topcmm/client/util/\package-tree.html...
Generating constant-values.html...
Building index for all the packages and classes...
Generating overview-tree.html...
Generating index-all.html...
Generating deprecated-list.html...
Building index for all classes...
Generating allclasses-frame.html...
Generating allclasses-noframe.html...
Generating index.html...
Generating overview-summary.html...
Generating help-doc.html...
Generating stylesheet.css...
Generating jsdoc.html...
----------------------------

Any comments will be greatly appreciated.

Thanks,
Kevin

Original issue reported on code.google.com by [email protected] on 1 Dec 2011 at 5:47

Attachments:

An exported contructor with a String argument gives a JavaScriptException in hosted mode

What steps will reproduce the problem?
1.  Export a class that looks like this:
@ExportPackage("it.fake")
@Export
public class Foo extends AbstractFoo  implements Exportable
{
    @Export
    public CommManager()
    {
        super("foo");
    }

    @Export
    public CommManager(String id)
    {
        super(id);
        GWT.log("id is:"+id);
    } 
}
2. Do all the exporter Module/Entrypoint stuff 
3. Run in hosted mode and call: new it.fake.Foo("test");

What is the expected output? What do you see instead?
I expect it to instantiate a Foo with no error, as it does in production mode, 
instead I get this error in the GWT console:
com.google.gwt.core.client.JavaScriptException: (null): null    at 
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelSer
ver.java:237)   at 
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) 
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)  at 
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) 
    at 
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:9
1)  at com.google.gwt.core.client.impl.Impl.apply(Impl.java)    at 
com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214)  at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)   at java.lang.reflect.Method.invoke(Method.java:597)     at 
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)   at 
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)  at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157
)   at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForRetu
rn(BrowserChannelServer.java:326)   at 
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelSer
ver.java:207)   at 
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) 
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)  at 
com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)     at 
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107
)   at 
com.theplatform.pdk.controller.CommunicationManager.onCommManagerLoaded(Communic
ationManager.java)  at 
com.theplatform.pdk.controller.CommunicationManager.onModuleLoad(CommunicationMa
nager.java:36)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)   at java.lang.reflect.Method.invoke(Method.java:597)     at 
com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)   at 
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java
:183)   at 
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelSe
rver.java:510)  at 
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352)
    at java.lang.Thread.run(Thread.java:680)


What version of the product are you using? On what operating system?
I'm using Export 2.0.10 with GWT 2.1.0, running on OS X 10.6.4

Please provide any additional information below:
The code was modified from my original as it's proprietary, if this report 
isn't enough to reproduce I can create/post new source code specifically to 
reproduce it.

Original issue reported on code.google.com by [email protected] on 18 Nov 2010 at 5:57

Missing check for nulls for Exportable function parameters.

What steps will reproduce the problem?

1. Write a function that takes in at least one parameter implementing 
Exportable.

2. Call the wrapper from JavaScript, passing null as the value for the 
parameter.

What is the expected output? What do you see instead?

I would expect the wrapped Java function to receive the null argument. null is 
a valid value for an Object. I would leave it up to the underlying function to 
determine if nulls are allowed, and throw an exception if necessary.

A JavaScript TypeError is thrown, null doesn't have a field __gwt_instance.

Example exported setter method:

//Child implements Exportable
public void setChild(Child c) {...}

Generated code:

"""
_.setChild = $entry(function( arg0) { 
        [email protected]::setChild(Lcom/example/test/Child;)(arg0.__gwt_instance);
});
"""

Should at least be:

(arg0)?arg0.__gwt_instance:arg0

What version of the product are you using? On what operating system?

 - gwtexporter-2.3.1-SNAPSHOT (affect 2.3.0 as well)
 - gwt 2.3.0
 - linux 64 bit
 - Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
 - Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
 - javascript breaks at least in Chrome and Firefox.

Please provide any additional information below.

Workaround is to change parameter type to JavaScriptObject, and do manual 
filtering.

Original issue reported on code.google.com by [email protected] on 19 Aug 2011 at 11:24

How to use JSDoclet

Can anybody tell me how to use the JSDoclet that is mentioned in this change 
http://code.google.com/p/gwt-exporter/source/detail?r=12, I have not used Maven 
before so I do not know exactly what I should be doing to get the jsdocs out

Original issue reported on code.google.com by [email protected] on 13 Aug 2010 at 3:53

Not able to export class: says class is undefined

What steps will reproduce the problem?
I am trying very simple example.
I am trying to call java method from Javascript;  running project is hosted 
mode should reproduce an issue.


What is the expected output? What do you see instead?
From Javascript I should be able to call java method


What version of the product are you using? On what operating system?
<gwtVersion>2.4.0</gwtVersion>

<artifactId>gwtexporter</artifactId>
<version>2.4.0-SNAPSHOT</version>

Ubuntu: 10.4

Please provide any additional information below.
1. On pageload (from SampleEntryPoint) I am calling javascript  jsFunction() 
which is in sample.js
2. This class simply instantiates Person (exported class)
3. And calls method on person class.

I am not able to instantiate the Person class. Can you please look into it and 
say what is going wrong here.,



Original issue reported on code.google.com by [email protected] on 6 Dec 2011 at 11:51

Attachments:

Export of methods with array parameters broken

This used to work in 2alpha but in 2.09 it no longer does:

@Export
@ExportPackage("gwt")
public class HelloClass implements Exportable
{
    public static void helloString(String param)
    {
        Window.alert("param = " + param);
    }

    public static void helloIntArray(int[] params)
    {
        Window.alert("params = " + params);
    }
}


Then, on FireBug's console:

 gwt.HelloClass.helloString("world!") // works!

 gwt.HelloClass.helloIntArray([1, 2, 3]) // doesn't work (output: "params =
undefined")

Original issue reported on code.google.com by [email protected] on 25 Mar 2010 at 9:29

overridden generic method export error

What steps will reproduce the problem?
1. create abstract class SuperClass<T extends SomeType> with a method void 
doSomething(T arg)
2. create abstract class SubClass extends SuperClass<T extends 
SomeMoreSpecificType> with the overridden method void doSomething(T arg)
3. create a concrete FurtherSubClass extends SubClass<EvenMoreSpecificType> 
with override of doSomething(EvenMoreSpecificType arg)
4  decorate all of the above classes with @Export(all=true)

What is the expected output? What do you see instead?
The generic method doSomething is available in the entire class hierarchy with 
the appropriate type. Instead I get the following compiler error:
 Unresolvable native reference to method 'doSomething' in type 'FurtherSubClass ' (did you mean 'doSomething(*)', 'doSomething(LEvenMoreSpecificType;)'?)


What version of the product are you using? On what operating system?
2.3.1-SNAPSHOT, Java 6, GWT 2.3

Please provide any additional information below.
Workaround: put @NoExport on overriden method SubClass.doSomething. This 
compiles, but I wonder if the overridden method is executed in an instance of 
FurtherSubClass?

Original issue reported on code.google.com by [email protected] on 21 Sep 2011 at 8:48

Force renaming module name <module rename-to="myModuleName"> break gwt-export

What steps will reproduce the problem?
1. Everything was fine.   
2. I rename the module name : rename-to="myModuleName"

Code: 
<module rename-to="myModuleName">
<inherits name='com.google.gwt.user.User'/>

<!--  Export GWT to JavaScript -->
<inherits name='org.timepedia.exporter.Exporter'/>
<set-property name="export" value="yes"/>

<entry-point class='someEntryPoint'/>

</module>

The exportable classe :

@Export
@ExportPackage("hello")
public class Hello implements Exportable{

    public String to(String name){
        return "Welcome " + name;
    }
}

HTML file :
<html>
<head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <title>Simple Portlet : Validation</title>

    <link rel="stylesheet" href="SimplePortlet.css">

<!-- after module rename -->
    <script type="text/javascript" language="javascript"
        src="simpleportlet/simpleportlet.nocache.js"></script>

<!-- before renaming -->
     <script type="text/javascript" language="javascript"
     src="com.arm.nimbus.portal.SimplePortlet/com.arm.nimbus.portal.SimplePortlet.nocache.js"></script>
      --> 
  <script language='javascript'>
  function run(){

        var h = new hello.Hello()
        document.getElementById('portlet').innerHTML = h.to("Mike")
    }
  </script>
</head>

<body onload="run()"> 
<div id="portlet"></dvi>
</body>
</html>

What is the expected output? What do you see instead?

Welcome mike must be display in the div named portlet.

Instead, Firebug says (Firefox 12) :

hello is not defined
[Break On This Error]   

var h = new hello.Hello()


What version of the product are you using? On what operating system?

 - GWT 2.4 with default Jetty container
 - Java 6
 - gwtexporter-2.4.0-M2-SNAPSHOT.jar
 - gwtexporter-2.4.0-M1.jar 

Original issue reported on code.google.com by [email protected] on 16 May 2012 at 7:42

Always complains that my exported class is not defined.

I'm using the latest M1 package.

SayHello.java is a gwt class, ExportSayHello is a class to export SayHello.

This is a very simple test. But I got the following error. And cannot figure 
out why.

ExportSayHello is not defined
[Break On This Error] var hello = new ExportSayHello(); 

Looking forward to hearing from you soon.
Thanks.

Original issue reported on code.google.com by [email protected] on 24 Nov 2011 at 7:47

Attachments:

Doc?

Are there some docs I can look at?

Original issue reported on code.google.com by [email protected] on 11 Jun 2008 at 9:13

samples in trunk do now build with GWT-Export build from trunk

I did a build of GTW Exporter from the trunk and then tried to compile the 
samples also taken from trunk, but the compile fails with the following 
errorstack:

Compiling module exporterdemo.ExporterDemo?

Scanning for additional dependencies: 
generated://0D9426A0F51FA1A490834E6DD306246E/org/timepedia/exporter/client/
ExportAllExporterImpl?.java
Adding '4' new generated units
Validating newly compiled units
WARN? Warnings in 
'generated://BEC5278F902D85749031B5798D6728BA/exporterdemo/client/EmployeeE
xporterImpl?.java'
WARN? Line 62: Referencing method 
'org.timepedia.exporter.client.ExporterUtil?.wrap([Lexporterdemo/client/Per
son;)': unable to resolve method, expect subsequent failures See snapshot: 
C:\Users\.....\AppData?
\Local\Temp\EmployeeExporterImpl4965262334706867108?.java
ERROR? Errors in 
generated://BEC5278F902D85749031B5798D6728BA/exporterdemo/client/EmployeeEx
porterImpl?.java
ERROR? Line 9: Unresolvable native reference to method 'wrap' in type 
'org.timepedia.exporter.client.ExporterUtil?' (did you mean 
'wrap(Lorg/timepedia/exporter/client/Exportable;)Lcom/google/gwt/core/clien
t/JavaScriptObject?;', 
'wrap([B)Lcom/google/gwt/core/client/JavaScriptObject?;', 
'wrap([C)Lcom/google/gwt/core/client/JavaScriptObject?;', 
'wrap([D)Lcom/google/gwt/core/client/JavaScriptObject?;', 
'wrap([F)Lcom/google/gwt/core/client/JavaScriptObject?;', 
'wrap([I)Lcom/google/gwt/core/client/JavaScriptObject?;', 
'wrap([J)Lcom/google/gwt/core/client/JavaScriptObject?;', 
'wrap([Lorg/timepedia/exporter/client/Exportable;)Lcom/google/gwt/core/clie
nt/JavaScriptObject?;', 
'wrap([S)Lcom/google/gwt/core/client/JavaScriptObject?;'?)
ERROR? Cannot proceed due to previous errors

Original issue reported on code.google.com by [email protected] on 12 May 2010 at 12:46

Cross-Site Linker compilation error

When using gwtexporter-2.09.jar to compile a project using the Cross site
linker (i.e. <add-linker name="xs" />) I get the following error     

"The module must not have multiple fragments when using the Cross-Site Linker."

I do not get this error when using the older gwtexporter2alpha.jar. The
project compiles although with a few warnings about deprecated methods.

Original issue reported on code.google.com by [email protected] on 21 Dec 2009 at 5:18

How to create an instance for an object, type will be available in the runtime?

I am using the following code in my sample class,
public native void addButton(String name, Panel parent) /*-{
        try {
            var sample = new window['$wnd.mypackage.Samplebutton']();
            sample.addButton(name, parent);
        } catch(err) {
            alert(err);
        }
    }-*/;

It is throwing undefined method error. I know the className in the runtime in 
that case how can i make use of GWT Exporter?

Thanks and Regards,
Malligarjunan S.


Original issue reported on code.google.com by [email protected] on 16 Jan 2012 at 6:59

compile errror

I run mvn compile but i get error because classes com.sun.* not found .

I already included 

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.5</version>
</dependency>


can anyone help?

Original issue reported on code.google.com by [email protected] on 1 Mar 2010 at 3:38

Document Annotations

I would like to use JavaDoc to create Export API.

Could you please add @Documented on to your Export, NoExport annotations?
(all annotations would be good too)

Original issue reported on code.google.com by [email protected] on 11 Feb 2010 at 10:31

Static constructors


I have got a class SomeClass which can be instantiated only once for each
DOM Element. It simply has protected constructor and static method: 

  public static SomeClass getInstance(Element elem);

This method returns instance of Widget previously created for Element elem
or creates new one. Every things works well, except I do not like static
constructors in JavaScript. Instead I prefer to have constructors witch
does all tricks. I mean something like:

   $wnd.Widget = function (elem) {
    if ($wnd.Widget.instances[elem])
        return $wnd.Widget.instances[elem];
    else
        return this;
   }

This is only example of such constructor - in gwt-exporter this should be
implemented in more generic way. 

Attached patch adds new annotation @ExportConstructor, which instructs
gwt-exporter to treat method as a constructor. Annotated method should be
declared static and should return instance of class it is declared in (this
conditions are check during code generation).

JavaScript constructor looks like that:

      $wnd.autoguard.SomeClass = function() {
        if(...)) {
      ....
        }
        else if(arguments.length == 2) {
      .... // code generated for normal constructor
        }
        else if(arguments.length == 1) {
      // code generated for static constructor getInstance():
          var x =
@pl.autoguard.client.SomeClass::getInstance(Lcom/google/gwt/user/client/Element;
)(arguments[0]);
          return
@org.timepedia.exporter.client.ExporterUtil::wrap(Lorg/timepedia/exporter/client
/Exportable;)(x);
        }
        return this; // this is not necessary
      }


One more thing about @ExportConstructor: annotated methods are not
automatically added to set of exportable methods. So in following example
method getInstance() would not be exported:

      class SomeClass implements Exportable {

     @ExportConstructor
     public static SomeClass getInstance(Element elem) {
        ...
     }
      }

Programmer should add @Export annotation (with class or with method).

Let me know if you find this useful.

Radoslaw Kintzi

Original issue reported on code.google.com by [email protected] on 3 Mar 2009 at 10:51

Attachments:

Maven : Missing 2.4.0-SNAPSHOT on sonatype snapshot

At the time of writing, sonatype repo does not contain jar for 2.4.0-SNAPSHOT

https://oss.sonatype.org/content/repositories/snapshots/org/timepedia/exporter/g
wtexporter/2.4.0-SNAPSHOT/

Found 2.4.0-M1 on central

Original issue reported on code.google.com by [email protected] on 25 Jan 2012 at 8:12

JsDoclet ignores javadoc option "-charset UTF-8"

Steps:
1. Call javadoc.exe with the custom doclet JsDoclet to generate java-docs for 
source code with the javadoc options -encoding UTF-8 -charset UTF-8
2. Look at the output jsdoc.html - there is no html meta-tag with the charset 
property.

Expected Behavior:
In the output jsdoc.html must be the next line:
"<meta http-equiv="content-type" content="text/html; charset=UTF-8" />"
Instead of this I see no meta-tag there.

Environment:
OS: Windows 7
gwtexporter-2.4.0-M1.jar

Quote from javadoc output: "-charset <charset> Charset for cross-platform 
viewing of generated documentation."

Thank you a lot for your time.

Original issue reported on code.google.com by [email protected] on 2 Aug 2012 at 7:56

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.