MapServer / MapServer-import

3 stars 2 forks source link

Can't compile test #1869

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: dnadeau@pop600.gsfc.nasa.gov Date: 2006/08/20 - 00:41

QueryByAttribute does not use imageObj. Line one should be deleted.

1. WARNING in examples/QueryByAttribute.java (at line 1)
        import edu.umn.gis.mapscript.imageObj;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import edu.umn.gis.mapscript.imageObj is never used
----------

In RunTimeBuiltWMSClient.java methods setMap and setWeb do not exist. If delete,
the tests run fine.

----------
2. ERROR in examples/RunTimeBuiltWMSClient.java (at line 48)
        web.setMap(map);
            ^^^^^^
The method setMap(mapObj) is undefined for the type webObj
----------
3. ERROR in examples/RunTimeBuiltWMSClient.java (at line 49)
        map.setWeb(web);
            ^^^^^^
The method setWeb(webObj) is undefined for the type mapObj
----------
gmake: *** [test] Erreur 255

Denis
tbonfort commented 12 years ago

Author: szekerest Date: 2006/08/20 - 14:22


RunTimeBuiltWMSClient.java uses incorrect way to set the parameters of the web
object. The web object of the map has already been created by default, there's
no need to create it from scratch. The proper way should be:

           //web = new webObj();
       web = map.getWeb();
       web.setImagepath("/tmp/");
       web.setImageurl("http://katrin/~nicol/mapserver/tmp/");
       web.setLog("/tmp/wms.log");
       web.setHeader("nh_header.html");
       web.setTemplate("../html/form.html");
       web.setEmpty("../themen/noFeature.html");

       //web.setMap(map);
       //map.setWeb(web);

On windows i have also got the following problems:
1. output.setImagemode(mapscript.MS_IMAGEMODE_RGB);  should be replaced with
output.setImagemode(MS_IMAGEMODE.MS_IMAGEMODE_RGB.swigValue());

2. layer.setType(mapscript.MS_LAYER_RASTER); should be replaced with
layer.setType(MS_LAYER_TYPE.MS_LAYER_RASTER);

3. layer.setConnectiontype(mapscript.MS_WMS); should be replaced with
layer.setConnectiontype(MS_CONNECTION_TYPE.MS_WMS);

4. In QueryByAttributeUnicode.java
shapeObj shp = new shapeObj( layer.getType() ); should be replaced with 
shapeObj shp = new shapeObj( layer.getType().swigValue() );
tbonfort commented 12 years ago

Author: unicoletti Date: 2006/08/21 - 09:08

*** Bug 1870 has been marked as a duplicate of this bug. ***
tbonfort commented 12 years ago

Author: unicoletti Date: 2006/08/25 - 10:01

I have fixed this issue in CVS HEAD and will be in the next 4.10 beta.

The handling of enumerations MS_IMAGEMODE.MS_IMAGEMODE_RGB is due to swig which
changed the way enums are handled after 1.3.24 and made the new method the default.
tbonfort commented 12 years ago

Author: dnadeau@pop600.gsfc.nasa.gov Date: 2006/08/28 - 04:17

New Problems with javac

javac -classpath ./:examples/:./mapscript.jar -d examples/
examples/ConnPool.java examples/DrawMap.java examples/DumpShp.java
examples/MakePoint.java examples/QueryByAttribute.java examples/ShapeInfo.java
examples/WxSTest.java examples/Metadata.java examples/RunTimeBuiltWMSClient.java
----------
1. WARNING in examples/QueryByAttribute.java (at line 1)
        import edu.umn.gis.mapscript.imageObj;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import edu.umn.gis.mapscript.imageObj is never used
----------
----------
2. ERROR in examples/RunTimeBuiltWMSClient.java (at line 36)
        output.setImagemode(MS_IMAGEMODE.MS_IMAGEMODE_RGB.swigValue());
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MS_IMAGEMODE cannot be resolved
----------
3. ERROR in examples/RunTimeBuiltWMSClient.java (at line 60)
        layer.setType(MS_LAYER_TYPE.MS_LAYER_RASTER);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MS_LAYER_TYPE cannot be resolved
----------
4. ERROR in examples/RunTimeBuiltWMSClient.java (at line 61)
        layer.setConnectiontype(MS_CONNECTION_TYPE.MS_WMS);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^
MS_CONNECTION_TYPE cannot be resolved
----------
make: *** [test] Erreur 255
tbonfort commented 12 years ago

Author: dnadeau@pop600.gsfc.nasa.gov Date: 2006/08/28 - 04:18

More problems with javac...

javac -classpath ./:examples/:./mapscript.jar -d examples/
examples/ConnPool.java examples/DrawMap.java examples/DumpShp.java
examples/MakePoint.java examples/QueryByAttribute.java examples/ShapeInfo.java
examples/WxSTest.java examples/Metadata.java examples/RunTimeBuiltWMSClient.java
----------
1. WARNING in examples/QueryByAttribute.java (at line 1)
        import edu.umn.gis.mapscript.imageObj;
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The import edu.umn.gis.mapscript.imageObj is never used
----------
----------
2. ERROR in examples/RunTimeBuiltWMSClient.java (at line 36)
        output.setImagemode(MS_IMAGEMODE.MS_IMAGEMODE_RGB.swigValue());
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MS_IMAGEMODE cannot be resolved
----------
3. ERROR in examples/RunTimeBuiltWMSClient.java (at line 60)
        layer.setType(MS_LAYER_TYPE.MS_LAYER_RASTER);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MS_LAYER_TYPE cannot be resolved
----------
4. ERROR in examples/RunTimeBuiltWMSClient.java (at line 61)
        layer.setConnectiontype(MS_CONNECTION_TYPE.MS_WMS);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^
MS_CONNECTION_TYPE cannot be resolved
----------
make: *** [test] Erreur 255
tbonfort commented 12 years ago

Author: unicoletti Date: 2006/08/28 - 11:16

Did you update your code from cvs and what version of swig are you using?

On a fresh checkout from cvs the following works for me:
./configure --with-threads --without-pdf --without-tiff --with-gdal --with-proj
--with-geos
make
cd mapscript/java
make
make test
tbonfort commented 12 years ago

Author: dnadeau@pop600.gsfc.nasa.gov Date: 2006/08/29 - 17:42

I recompiled from CVS and got the same errors.  Here is my java version.

javac -v
Eclipse Java Compiler 0.319_R21x, Copyright IBM Corp 2000-2003. All rights reserved.

java --version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)
tbonfort commented 12 years ago

Author: unicoletti Date: 2006/09/04 - 12:12

You probably have an old copy of swig or of mapserver lyin' around.
I can't reproduce the error.
tbonfort commented 12 years ago

Author: bpitts@emory.edu Date: 2006/12/05 - 23:03

I have issues on RHEL4 with java 1.5.0_06-b05, SWIG 1.3.21, and MapServer 4.10.0.

examples/RunTimeBuiltWMSClient.java:36: package MS_IMAGEMODE does not exist
           output.setImagemode(MS_IMAGEMODE.MS_IMAGEMODE_RGB.swigValue());
                                           ^
examples/RunTimeBuiltWMSClient.java:60: cannot find symbol
symbol  : variable MS_LAYER_TYPE
location: class RunTimeBuiltWMSClient
           layer.setType(MS_LAYER_TYPE.MS_LAYER_RASTER);
                         ^
examples/RunTimeBuiltWMSClient.java:61: cannot find symbol
symbol  : variable MS_CONNECTION_TYPE
location: class RunTimeBuiltWMSClient

           layer.setConnectiontype(MS_CONNECTION_TYPE.MS_WMS);
                                   ^
3 errors
make: *** [test] Error 1
tbonfort commented 12 years ago

Author: unicoletti Date: 2007/05/10 - 08:51 Compiling the tests when using swig 1.3.21 is not supported as stated in the README in the mapscript/java directory. You need at least 1.3.24, 1.3.28 or higher is better. Closing.