Opened 18 years ago

Closed 17 years ago

#1869 closed defect (invalid)

Can't compile test

Reported by: dnadeau@… Owned by: unicoletti
Priority: high Milestone: 4.10 release
Component: MapScript-Java Version: 4.10
Severity: normal Keywords:
Cc:

Description

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

Change History (10)

comment:1 by szekerest, 18 years ago

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() );


comment:2 by unicoletti, 18 years ago

*** Bug 1870 has been marked as a duplicate of this bug. ***

comment:3 by unicoletti, 18 years ago

Milestone: 4.10 release
Resolution: fixed
Status: newclosed
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.


comment:4 by dnadeau@…, 18 years ago

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

comment:5 by dnadeau@…, 18 years ago

Resolution: fixed
Status: closedreopened
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

comment:6 by unicoletti, 18 years ago

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

comment:7 by dnadeau@…, 18 years ago

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)

comment:8 by unicoletti, 18 years ago

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

comment:9 by bpitts@…, 17 years ago

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

comment:10 by unicoletti, 17 years ago

Resolution: invalid
Status: reopenedclosed

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.

Note: See TracTickets for help on using tickets.