Mapviewer/JDBC/JGeometry

Hi
I have the Mapviewer java api wrapped in a bean. I want the the user to be able to select a geometry from the map and copy that object into a JGeometry object in the applet. I can easily get the system to identify which object I wish to copy, but how can I read the SDO object into the JGeometry. I know I can do it if I register a new data source in java and then read a record set directly from the database into the JGeom etc, but I don't want the added complication of having to define another data source. Can I reuse the existing connection as defined in the MapViewerConfig.xml and used by mapviewer in the bean? Alternatively is there any other method other than making a second connection to the db?
Thanks
Chris

Hi Chris,
at the java API level you do not have access to the database connection object. But the Java API has some doQuery methods that you may be able to retrieve the geometry as a GML string, and then use some Spatial GML util class to generate the JGeometry. For example:
    String [][]query = mapViewer.doQuery("mvdemo",
             "select state, totpop, SDO_UTIL.TO_GMLGEOMETRY(geom) from states where state_abrv = 'FL'");
     int nlin = 0;
     int ncol = 0;
     String name = null;
     double totPop = 0.;
     if(query != null)
       nlin = query.length;
       ncol = query[0].length;
       for(int i=1;i<nlin;i++)
         name = query[0];
try
totPop = Double.parseDouble(query[i][1]);
} catch (Exception ex)
totPop = 0.;
String geom = query[i][2];
System.out.println("[State] " + name + " [Population] " + totPop +
"\n[Geometry]: " + geom);
// here you can try to use the GML class (I think from sdoutl java library) to generate the JGeometry object
Joao

Similar Messages

  • Failover mapviewer datasource

    Hi all,
    is it possible to configure a mapviewer jdbc datasource with failover cluster?
    Something like this:
    oracle:thin:@(DESCRIPTION=
    (LOAD_BALANCE=on)
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=TCP)(HOST=host1)(PORT=1521))
    (ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=1521)))
    (CONNECT_DATA=(SERVICE_NAME=service_name)))
    A sample based on MVDEMO datasource would be helpful.

    For completion of this thread:
    This can be done by the use of a container defined data source that can be looked up by Mapivewer through JNDI as already discribed in chapter 7.1 of mapviewer documentation.

  • How to set JDBC Data Sources in Oracle MapViewer for Oracle database 12c Release 1 (12.1.0.1)

    How to set JDBC Data Sources in Oracle MapViewer for Oracle database 12c Release 1 (12.1.0.1)?
    The following is my configuration in the conf\mapViewerConfig.xml:
    <map_data_source name="mvdemo12"
    jdbc_host="127.0.0.1"
    jdbc_sid="orcl12c1"
    jdbc_port="1522"
    jdbc_user="mvdemo"
    jdbc_password="7OVl2rJ+hOYxG5T3vKJQb+hW4NPgy9EN"
    jdbc_mode="thin"
    number_of_mappers="3"
    allow_jdbc_theme_based_foi="true"
    editable="true"/>
    <!--  ****  -->
    But it does not work.
    After use "sqlplus mvdemo/[email protected]:1522/pdborcl", it connected to the Oracle database 12c.
    Does anyone know it?
    Thanks,

    For 11.1.1.7.1 use the syntax for jdbc_sid, i.e.
    //mypdb1.foo.com as described in the README,
    - MapViewer native (non-container) data sources can now use database service name in place of SID. To supply a db service name, you will use the same jdbc_sid attribute, but specify the service name with double slashes in front, such as follows:
      <map_data_source name="myds"
        jdbc_host="foo.com"
        jdbc_sid="//mypdb1.foo.com"
        jdbc_port="1522"
      />
    For 11.1.1.7.0 use a container_ds instead.
    i.e. instead of using
    <map_data_source name="my_12c_test"
                       jdbc_host="mydbinstance"
                       jdbc_sid="pdborcl12c"
                       jdbc_port="1522"
                       jdbc_user="mytestuser"
                       jdbc_password="m2E7T48U3LfRjKwR0YFETQcjNb4gCMLG8/X0KWjO00Q="
                       jdbc_mode="thin"
                       number_of_mappers="6"
                       allow_jdbc_theme_based_foi="false"
                       editable="false"
       />
    use
      <map_data_source name="my_12c_test"
                       container_ds="jdbc/db12c"
                       number_of_mappers="6"
                       allow_jdbc_theme_based_foi="false"
                       editable="false"
       />
    In my case the Glassfish 3.1.2.2 JDBC connection pool definition was
    Property
    url  jdbc:oracle:thin:@mydbinstance:1522/pdborcl12c.rest_of.service.name
    Uncheck the Wrap JDBC Objects option in Advanced panel, i.e. the Edit JDBC Connection Pool Advanced properties page.
    Add a JDBC resource for that newly created pool
    Use that in mapviewerconfig.xml as above

  • JDBC insert empty STRUCT (JGeometry) into SDO_GEOMETRY

    Hi!
    I need to insert empty or null value intro oracle table with SDO_GEOMETRY field.
    I'm using prepared statement.
    I have tried pstmt.setNull(1, null), pstmt.setObject(1, null)
    Normaly I do it like this:
    STRUCT obj = JGeometry.store(jgeom, conn);
    pstmt.setObject(1, obj);
    So I probably need to create an empty STRUCT or something.
    I have also tried using :
    StructDescriptor type_descriptor = StructDescriptor.createDescriptor ("MDSYS.SDO_GEOMETRY", conn); but I don't know if I'm using it right.
    The syntax is like:
    StructDescriptor structdesc = StructDescriptor.createDescriptor (sql_type_name, connection); but I don't know what sql_type_name means? Is it tablename, fieldname? Tried them all...no success.
    I've read that JDBC doesn't support that kind of insert with setNull, is there a workaround or any other way of doing this.
    Thanks in advance and have a nice day.
    Simon

    http://www.oracle.com/technology/tech/java/sqlj_jdbc/pdf/a96654.pdf seems to have the clues that you are looking for.
    BTW, we are adding a Connection.createStruct/Array method so that you can create these types of objects in portable with JDBC in JDBC 4

  • Jdbc openProxyConnection and MapViewer (or any packaged EAR)

    Hi,
    I'm cross-posting this from the "Oracle Spatial" forum to here, as the question actually applies to any packaged EAR where we don't have access to the source code.
    Our requirement is to authenticate against an LDAP server, and then bring up MapViewer to access data on the Oracle DB. Once in the DB, we want to know (and record) who the real user is (i.e. charlie_brown), even though MapViewer connects via the data_source in mapViewerConfig.xml (i.e. gis_middletier).
    The additional complication is the use of connection pooling in the middle-tier, which uses a generic account upon which the connection is made.
    So... in a nutshell, is there a way to plug into MapViewer something like "conn.openProxyConnection" in the JDBC connection? If not, how are people passing in the authenticated user name through MapViewer generic datasource user, such that the authorizations are appropriate for the authenticated user (not the connection pool user and not the MapViewer data_source).
    TIA,
    Gary

    Hi, it is recommended that you deploy MapViewer to an OC4J instance external to JDeveloper. MapViewer is not a small application and it may become memory intensive depending on the complexity of your map layers, as such it is better running in its own J2EE container. The embedded OC4J should only be used to run your JSP/ADF pages under development/testing. Also, deploying MapViewer to the embedded OC4J does not in any way simplify development, it may actually complicate things as the embedded OC4J is constantly being started/stopped, unlike a standalone OC4J which once started stays up unaffected by your JDeveloper activities.
    thanks
    LJ

  • JDBC THEME-MAPVIEWER-05517 Request string is too long for Oracle Maps' non-

    hi,
    if I need a quite complex query to be added to dynamic JDBC theme I get this error:
    [MAPVIEWER-05517] Request string is too long for Oracle Maps' non-AJAX remoting.
    -why? I am using Oracle Maps JS API so it is AJAX remoting, or not?
    -what is the limit of a JDBC theme definition?
    regards,
    Brano

    hi,
    yes, having look at MVMapView.enableXMLHTTP(true) in doc explains a lot...
    thanks,
    Brano

  • JGeometry / oracle.jdbc.OracleDriver ClassCastException

    Hi-
    I can't seem to store my JGeometry (from the SDO API) back to the database. The code that causes the problem is this:
    ===== Sample Code ========
    import oracle.jdbc.OracleConnection;
    OracleConnection oc = (OracleConnection) st.getConnection();
    STRUCT struct = JGeometry.store((JGeometry)value,oc);
    ==========================
    That last line of code throws this error:
    ===== Exception ============
    05/01/04 16:50:26 [ERROR] ResultForm - Could not save the ResultBean <java.lang.ClassCastException>java.lang.ClassCastException
         at oracle.jdbc.driver.OracleConnection.unwrapCompletely(OracleConnection.java:5075)
         at oracle.jdbc.driver.OracleConnection.physicalConnectionWithin(OracleConnection.java:5126)
         at oracle.sql.TypeDescriptor.setPhysicalConnectionOf(TypeDescriptor.java:494)
         at oracle.sql.TypeDescriptor.<init>(TypeDescriptor.java:147)
         at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:186)
         at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:118)
         at oracle.spatial.geometry.JGeometry.createDBDescriptors(JGeometry.java:1323)
         at oracle.spatial.geometry.JGeometry.store(JGeometry.java:1257)
         at gov.usgswim.wdnr.fishform.GeometryType.nullSafeSet(GeometryType.java:54)
    =========================
    It looks like the oracle.jdbc.driver.OracleConnection.unwrapCompletely method is assuming the connection to be something that it is not - but I'm stumped without the source code.
    I've seen someone speculate that this is a classloader issue, but I'd have no idea how to resolve that within OC4J.
    Here is my setup:
    Running from JDev 9.0.5.2 using OC4J 9.0.5.
    JDBC connections are provided via JNDI by specifying the datasource thru JDev. I've tried replacing the JDBC drivers that come with OC4J with the newer versions (that is, classes12.jar --> classes14.jar)
    Database version is 10.1.0.3.0
    I'm pretty much stuck until I can work this out, so any help would be appreciated.
    Thanks in advance,
    Eric Everman

    Hi LJ - Thanks for the reply.
    I'm leaving out detail about the framework I'm working within. For instance, the full method that saves the JGeometry back to the db is part of a Hibernate UserType for which I can't change the method signiture - thus the PreparedStatement.getConnection(). The full method looks like this:
    =========== Java Method =================
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    STRUCT struct = null;
    if (value != null) {
    if (value instanceof JGeometry) {
    JGeometry jg = (JGeometry)value;
    System.out.println("Storing a Geom object to the db. Info:");
    System.out.println(" Type: " + jg.getType());
    System.out.println(" # of points: " + jg.getNumPoints());
    System.out.println(" isPoint: " + jg.isPoint());
    System.out.println(" X, Y: " + jg.getFirstPoint()[0] + ", " + jg.getFirstPoint()[1]);
    //System.out.println(" elemInfo length: " + jg.getElemInfo().length); (throws error)
    OracleConnection oc = (OracleConnection) st.getConnection();
    struct = JGeometry.store(jg,oc);
    } else {
    throw new HibernateException("Cannot set GeometryType value to " + value.getClass().getName());
    } //keep null value
    st.setObject(index, struct);
    ==================================
    ==== Typical Output ==============
    05/01/04 20:53:08 Storing a Geom object to the db. Info:
    05/01/04 20:53:08 Type: 1
    05/01/04 20:53:08 # of points: 1
    05/01/04 20:53:08 isPoint: true
    05/01/04 20:53:08 X, Y: 385343.3057, 562597.748
    ==================================
    I've no reason to think that the connection I'd get from the prepared statement would be anything other then the connection returned from JNDI, but I'll try a simplified test to make sure.
    My Geom is point data - would I expect JGeometry.getElemInfo() to return null in that case? Currently it does return null immediately after I load the JGeom from the database.

  • Non-jdbc datasource for MapViewer

    Is it possible to specify a non-jdbc datasource for Oracle MapViewer?
    That is, if I want Mapviewer to access the database through my own data layer, or with an ORM, is it possible?
    Thanks,
    Rupesh

    I copied jdbcdrv.zip intp C:\Program Files\Sybase\SQL
    Anywhere 9\java
    and using Java page in CF admin, added C:\Program
    Files\Sybase\SQL Anywhere 9\java to classpath, restarted CF
    Application server.
    I then defined new datasources using existing ODBC dsns as
    described in
    http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbpgen9/000001 52.htm
    (doesn't seem kosher but that's what my model showed).
    It's not exactly speedy but I've not gotten any errors yet
    (maybe because it isn't speedy)
    Anybody have any idea if there is another way that doesn't
    use anODBC dsn ?

  • Mapviewer map_request limitations for when using wms and jdbc themes?

    Are there limitations to not use either the bounding_themes or the center option when a basemap requests both a jdbc and a wms theme? I would like to have the bounding_theme be the jdbc theme. I can see how this could pose challenges in that there would be a need to retrieve the jdbc theme and calc the mbr before issuing the wms requests w/ the correct bbox. Would be a nice feature though.

    woops, sorry LJ -- it works. Do you have suggestions though for dealing w/ case where the jdbc theme returns one point? id like to use something like the border_margin to pad the point out to a box, but seems to always just return just the point. mkaes sense since multiplying 0 by anything is zero. we are planning on writing a servlet that instead uses sdo_buffer then construct the coordinates tag w/ the sdo_aggr_mbr. that should accommodate 1..n points returned.
    <bounding_themes border_margin="0.05">

  • DISPLAY SPATIAL DATA USING JDBC ON A JAVA FRAME

    I am trying to set up some spatial data and need help in getting some sample
    code for displaying the data on a Java Frame using JDBC.
    The shapes I am setting up are simple polygons, lines, circles. I was going
    through the samples in the demo directory under $ORACLE_HOME/md/demo/examples, but could not find any JDBC
    I would really appreciate if you can point me towards some sample code and any other spatial resources.
    Madhukar

    Here you go. It uses JDBC to fetch geoms, convert them into Java JGeometry objects, which then create Java2D shapes (these are functions of the public sdoapi.jar library). It then uses some class in the sdovis.jar library (the rendering engine of MapViewer) to setup the necessary viewport transform. If you know how to setup the viewport transform, then you dont even need sdovis. sdovis.jar is found in an deployed MapViewer's WEB-INF/lib directory. Or you can extract it from the mapviewer.ear's web.war file.
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.sql.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import oracle.jdbc.OracleDriver;
    import oracle.sdovis.*;
    import oracle.sdovis.style.*;
    import oracle.sdovis.util.*;
    import oracle.spatial.geometry.JGeometry;
    import oracle.sql.STRUCT;
    * A very simple program that shows stuff from db in a JFrame
    * <p>
    public class tilsvgui2 extends JFrame
      final static int mapWidth  = 640;
      final static int mapHeight = 480;
      static JSDOGeometry geom = null;
      public tilsvgui2()
        setSize(mapWidth+40, mapHeight+40);
                    setVisible(true);
        this.addWindowListener(new java.awt.event.WindowAdapter() {
          public void windowClosing(WindowEvent e) { System.exit(0); }
            public void paint(Graphics g)
                    super.paint(g);
        int w = this.getWidth(), h = this.getHeight();
        Insets inset = this.getInsets();
        double[] mbr = geom.getMBR();
        //from sdovis; it will setup the viewport transform
        XFViewPort xfp = new XFViewPort();
        xfp.setDeviceView(inset.left, inset.top, w-inset.left-inset.right-1, h-inset.top-inset.bottom-1);
        xfp.setDataView(mbr[0], mbr[1], mbr[2], mbr[3]);
        AffineTransform af = xfp.getAffineTransform();    //get the viewport transform
        Shape shp = geom.createShape(af);    //create a proper shape that fits the viewport
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.red);
        g2.drawRect(inset.left, inset.top, w-inset.left-inset.right-1, h-inset.top-inset.bottom-1);
        //draw the shape itself
        g2.setColor(Color.blue);
        g2.draw(shp);
      public static void getStuff() throws Exception
        System.out.println("Loading geometry...");
        Connection conn = getConnection("mapsrus.us.oracle.com", "1521", "orcl", "scott", "tiger");
        Statement  stmt = conn.createStatement();
        ResultSet  rset = stmt.executeQuery("select geom, totpop from counties where county='Merrimack' and state_abrv='NH'");
        while(rset.next())
          STRUCT st = (STRUCT) rset.getObject(1);
          geom = JSDOGeometry.loadFromDB(st);
          int population = rset.getInt(2);
          break; //displaying only the first geometry
        rset.close();
        stmt.close();
        conn.close();
      private static Connection getConnection(String host,
                                              String port,
                                              String sid,
                                              String username,
                                              String password)
        throws SQLException
        String thinConn = "jdbc:oracle:thin:@"+host+":"+port+":"+sid;
        Driver d = new OracleDriver();
        Connection conn = DriverManager.getConnection(thinConn,username,password);
        conn.setAutoCommit(false);
        return conn;
      public static void main(String[] args)
        try{
          getStuff();
        }catch(Exception e)
          e.printStackTrace(System.err);
        new tilsvgui2();
    }

  • Problem while adding a new data source for the demo for mapviewer...

    hello,
    i use oracle 10g enterprise edition. i imported the necessary dump files and get the necessary scripts worked. i want to see the demo results in mapviewer. for that, i have to add a datasource. the XML code in order to realize this purpose is:
    <?xml version="1.0" standalone="yes"?>
    <non_map_request>
    <add_data_source
    name="mvdemo"
    jdbc_host="c-0y5wp0jvd2bf8"
    jdbc_port="1521"
    jdbc_sid="mvdemo"
    jdbc_user="!mvdemo"
    jdbc_password="tiger"
    jdbc_mode="thin"
    number_of_mappers="3" />
    </non_map_request>
    i press the submit button. then it wants me to enter a username and password. the default is admin/welcome. then i see this result on the browser:
    This XML file does not appear to have any style information associated with it. The document tree is shown below.
         <oms_error>
    Message:[MapperConfig] eşleme verileri kaynağı eklenemiyor.
    Sat Feb 26 02:29:19 EET 2005
    Severity: 0
    Description:
         at oracle.lbs.mapserver.core.MapperConfig.addMapDataSource(MapperConfig.java:583)
         at oracle.lbs.mapserver.MapServerImpl.addMapDataSource(MapServerImpl.java:315)
         at oracle.lbs.mapserver.oms.addDataSource(oms.java:1241)
         at oracle.lbs.mapserver.oms.doPost(oms.java:409)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:810)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:322)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    </oms_error>
    by the way, the error message on the application server screen:
    05/02/26 02:29:16 INFO [oracle.lbs.mapserver.MapServerImpl] adding a map data sr
    c [name=mvdemo]
    05/02/26 02:29:18 WARN [oracle.sdovis.ds.nods] java.sql.SQLException: G/╟ istisn
    as²: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :137)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :174)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :286)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:321)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    414)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:149)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
    n.java:31)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:551)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at oracle.sdovis.ds.NativeOracleDataSource.<init>(NativeOracleDataSource
    .java:120)
    at oracle.sdovis.ds.DSManager.registerOracleJdbcDS(DSManager.java:86)
    at oracle.lbs.mapserver.core.MapperConfig.createMappers(MapperConfig.jav
    a:613)
    at oracle.lbs.mapserver.core.MapperConfig.addMapDataSource(MapperConfig.
    java:582)
    at oracle.lbs.mapserver.MapServerImpl.addMapDataSource(MapServerImpl.jav
    a:315)
    at oracle.lbs.mapserver.oms.addDataSource(oms.java:1241)
    at oracle.lbs.mapserver.oms.doPost(oms.java:409)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:810)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:322)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    05/02/26 02:29:18 WARN [oracle.sdovis.ds.nods] connecting to database using jdbc
    thin driver...
    05/02/26 02:29:19 ERROR [oracle.sdovis.ds.nods] java.sql.SQLException: G/╟ istis
    nas²: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :137)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :174)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :286)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:321)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    414)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:149)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
    n.java:31)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:551)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at oracle.sdovis.ds.NativeOracleDataSource.<init>(NativeOracleDataSource
    .java:136)
    at oracle.sdovis.ds.DSManager.registerOracleJdbcDS(DSManager.java:86)
    at oracle.lbs.mapserver.core.MapperConfig.createMappers(MapperConfig.jav
    a:613)
    at oracle.lbs.mapserver.core.MapperConfig.addMapDataSource(MapperConfig.
    java:582)
    at oracle.lbs.mapserver.MapServerImpl.addMapDataSource(MapServerImpl.jav
    a:315)
    at oracle.lbs.mapserver.oms.addDataSource(oms.java:1241)
    at oracle.lbs.mapserver.oms.doPost(oms.java:409)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:810)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:322)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    05/02/26 02:29:19 ERROR [oracle.sdovis.ds.nods] java.sql.SQLException: G/╟ istis
    nas²: The Network Adapter could not establish the connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :137)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :174)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
    :286)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:321)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    414)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:149)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
    n.java:31)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:551)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at oracle.sdovis.ds.NativeOracleDataSource.<init>(NativeOracleDataSource
    .java:136)
    at oracle.sdovis.ds.DSManager.registerOracleJdbcDS(DSManager.java:86)
    at oracle.lbs.mapserver.core.MapperConfig.createMappers(MapperConfig.jav
    a:613)
    at oracle.lbs.mapserver.core.MapperConfig.addMapDataSource(MapperConfig.
    java:582)
    at oracle.lbs.mapserver.MapServerImpl.addMapDataSource(MapServerImpl.jav
    a:315)
    at oracle.lbs.mapserver.oms.addDataSource(oms.java:1241)
    at oracle.lbs.mapserver.oms.doPost(oms.java:409)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:810)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:322)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    05/02/26 02:29:19 ERROR [oracle.lbs.mapserver.core.MapperConfig] java.lang.Illeg
    alArgumentException: Error creating NativeOracleDataSource.
    at oracle.sdovis.ds.NativeOracleDataSource.<init>(NativeOracleDataSource
    .java:196)
    at oracle.sdovis.ds.DSManager.registerOracleJdbcDS(DSManager.java:86)
    at oracle.lbs.mapserver.core.MapperConfig.createMappers(MapperConfig.jav
    a:613)
    at oracle.lbs.mapserver.core.MapperConfig.addMapDataSource(MapperConfig.
    java:582)
    at oracle.lbs.mapserver.MapServerImpl.addMapDataSource(MapServerImpl.jav
    a:315)
    at oracle.lbs.mapserver.oms.addDataSource(oms.java:1241)
    at oracle.lbs.mapserver.oms.doPost(oms.java:409)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletReque
    stDispatcher.java:810)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(Ser
    vletRequestDispatcher.java:322)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpReques
    tHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.ja
    va:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    if someone could help about what to do, i would be grateful..

    when defining a data source through the admin web page, don't add '!' in front of the password.
    ! is needed only when configuring a data source in the mapViewerConfig.xml file.

  • Terrmap.jsp is not working (mapviewer 10.1.3)

    Hi I cannot seem to get the terrmap demo to work. All I get is this error:
    Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
    Which tells me absolutely nothing.
    I created a datasource like this:
    <data-source class="com.evermind.sql.DriverManagerDataSource" name="MVDemoDS"
    location="jdbc/OracleCoreDS"
    xa-location="jdbc/xa/OracleXADS"
    ejb-location="jdbc/MVDemoDS"
    connection-driver="oracle.jdbc.driver.OracleDriver" username="mvdemo" password="mvdemo"
    url="jdbc:oracle:thin:@localhost:1521:orcl"
    inactivity-timeout="30"
    />
    and restarted the oc4j
    What am I doing wrong?

    Hi Wendy,
    It seems you are creating data source in Oracle Application Server configuration file. But, data source for Oracle MapViewer should be declared in Oracle MapViewer configuration file.
    Oracle MapViewer configuration file, mapViewerConfig.xml is located in the $ORACLE_HOME/lbs/mapviewer/web/WEB-INF/conf. You should modify permanent map data source, defined in the <map_data_source>. Sample map data source declaration:
    <map_data_source name="mvdemo"
                jdbc_host="elocation.us.oracle.com"
                jdbc_sid="orcl"
                dbc_port="1521"
                dbc_user="scott"
                jdbc_password="!tiger"
                jdbc_mode="thin"
                number_of_mappers="3"
    />Also, map data sources can be managed through web based Oracle MapViewer manager.
    Regards,
    Andrejus

  • ORA 00600 Error when using Mapviewer addJDBCTheme

    Hello
    I am receiveing the 600 error via my OC4J window when using mapviewers addJDBCTheme with the passTthrough boolean set to false (the query is rewitten by mapviewer to limit it to the results to the map view). If I perfrom the same query with passThrough set to true, no problems. I have a feeling this may relate to the index on my table. OC4J output for error below.
    Any ideas appriciated.
    Chris
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.oms] request.getRemoteUser = null
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.oms] request= <?xml version="1.0" standalone="yes"?>
    <map_request
    datasource="atrium2"
    srid="81989"
    width="500"
    height="500"
    bgcolor="#ffffff"
    antialiase="true"
    format="PNG_URL">
    <center size="800.0">
    <geoFeature>
    <geometricProperty typeName="center">
    <Point>
    <coordinates>278872.6,187144.0</coordinates>
    </Point>
    </geometricProperty>
    </geoFeature>
    </center>
    <themes>
    <theme name="BUIDLING" user_clickable="false" />
    <theme name="BLOCKS" user_clickable="false">
    <jdbc_query
    label_column="mbl_title"
    spatial_column="spat_data"
    label_style="TEXTBLACK"
    render_style="TEST3"
    jdbc_srid="81989"
    datasource="atrium2"
    asis="false">select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c
    </jdbc_query>
    </theme>
    </themes>
    </map_request>
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.JSDOGeometry] exception while getting srid from a geometry node: For input string: ""
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] getMapper(atrium2) begins...
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] getMapper() succeeded.
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.SRS] got srs object for :81989
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding additional themes...
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding a predefined theme BUIDLING
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.DBMapMaker] adding predefined theme [name=BUIDLING]
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.lbs.mapserver.core.RealWorker] adding a JDBC Theme:
    ThemeDescriptor=
    name=BLOCKS
    type=2
    minScale=Infinity
    maxScale=-Infinity
    srid=81989
    host=null
    sid=null
    port=null
    user=null
    mode=null
    query=select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c
    spatialColumn=spat_data
    renderStyleName=TEST3
    labelColumn=mbl_title
    labelStyleName=TEXTBLACK
    renderStyleDef=null
    labelStyleDef=null
    localThem=null
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.SRS] *** isGeodetic=false, unit=METER
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.DBMapMaker] LoadThemeData running thread: Thread-67
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.theme.pgtp] [ BUIDLING ]: 278472.6,186744.0,279272.6,187544.0
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.theme.pgtp] [ BUIDLING ]: SELECT ROWID, GEOLOC, 'PRISM_ADM:BROWN_LINE', null, 'null', -1 FROM SPAT_BUILDING WHERE MDSYS.SDO_FILTER(GEOLOC, MDSYS.SDO_GEOMETRY(2003, 81989, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(?, ?, ?, ?)), 'querytype=WINDOW') = 'TRUE'
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.DBMapMaker] LoadThemeData running thread: Thread-68
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.theme.DGTP] [Master scale] 153.60000000000002 [Theme scale factor] 1.0
    Tue Aug 09 10:58:38 BST 2005 FINEST [oracle.sdovis.theme.DGTP] [DynGeomTheme] rewritten query: SELECT * FROM ( select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c ) WHERE MDSYS.SDO_FILTER(spat_data, MDSYS.SDO_GEOMETRY(2003, 81989, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(278472.6,186744.0,279272.6,187544.0)), 'querytype=WINDOW') = 'TRUE'
    Tue Aug 09 10:58:38 BST 2005 DEBUG [oracle.sdovis.theme.pgtp] [ BUIDLING ] sql exec time: 15ms, total time loading 209 features: 125ms.
    Tue Aug 09 10:58:53 BST 2005 WARN [oracle.sdovis.theme.DGTP] java.sql.SQLException: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
         at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:969)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2387)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2660)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:777)
         at oracle.sdovis.theme.DynGeomThemeProducer.prepareData(DynGeomThemeProducer.java:241)
         at oracle.sdovis.Theme.prepareData(Theme.java:174)
         at oracle.sdovis.DBMapMaker$LoadThemeData.run(DBMapMaker.java:1740)
    Tue Aug 09 10:58:53 BST 2005 ERROR [oracle.sdovis.DBMapMaker] Message:null
    Description: Nested exception is:
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], []
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478)
         at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java:969)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2387)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2660)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:777)
         at oracle.sdovis.theme.DynGeomThemeProducer.prepareData(DynGeomThemeProducer.java:241)
         at oracle.sdovis.Theme.prepareData(Theme.java:174)
         at oracle.sdovis.DBMapMaker$LoadThemeData.run(DBMapMaker.java:1740)
    Tue Aug 09 10:58:53 BST 2005 INFO [oracle.sdovis.DBMapMaker] **** time spent on loading features: 15250ms.
    Tue Aug 09 10:58:53 BST 2005 FINEST [oracle.sdovis.RE] xfm: 0.625 0.0 0.0 -0.625 -174045.375 117215.0
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to render theme BUIDLING with 209 styled features: 15ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to render theme BLOCKS with 0 styled features: 0ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to label theme BLOCKS with 0 styled features: 0ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.sdovis.VectorRenderer] time to label theme BUIDLING with 209 styled features: 0ms
    Tue Aug 09 10:58:53 BST 2005 INFO [oracle.sdovis.DBMapMaker] **** time spent on rendering: 15ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] freeMapper() begins...
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] preparation time: 16ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] querying/rendering time: 15265ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] packing time: 31ms
    Tue Aug 09 10:58:53 BST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] --------------- total time: 15312ms

    Chris,
    Can you run this rewritten query
    SELECT * FROM ( select spat_data, mbl_bka_id, mbl_title from WPE_SPATIAL_BLOCKS_VIEW_10G c ) WHERE MDSYS.SDO_FILTER(spat_data, MDSYS.SDO_GEOMETRY(2003, 81989, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(278472.6,186744.0,279272.6,187544.0)), 'querytype=WINDOW') = 'TRUE'
    in sql*plus without any errors?
    The asumptions is there is a spatial index on spat_data and all the geometries are valid.
    Also there will be a trace file on the db server. That'll give more details on what the likely cause is.
    Jayant

  • Using Mapviewer with Oracle Locator

    We're currently using Oracle Locator as a datasource for Mapviewer 10g and we're running into a slight problem when loading simple points from a table. We have the table containing these ponits added to the USER_SDO_GEOM_METADATA table and the spatial index is created on the specific column with the SDO_GEOMETRY type. When the map loads up the following error is generated when a dynamic jdbc query is run:
    MAPVIEWER-06009: Error processing an FOI request.
    Root cause:FOIServlet:ORA-29900: operator binding does not exist
    ORA-06540: PL/SQL: compilation error
    ORA-06553: PLS-907: cannot load library unit MDSYS.SDO_3GL (referenced by MDSYS.SDO_FILTER)
    I've looked in the database for the MDSYS.SDO_3GL object and it's definitely there, so I'm a little lost on what could be causing this. I thought perhaps that our user schema may not have execute privileges associated with that specific procedure, but I believe the entire point of MDSYS is that it's available to any user on the database.
    Any help with this would be greatly appreciated.
    Edited by: user1175540 on Oct 29, 2010 7:10 PM

    We're currently using the javascript api for oracle maps (using the matching javascript file, oraclemaps.js, that came directly from the mapviewer application download). All that I'm calling is a single table and then getting some hidden info columns as well off of it too. I've tried this on a different schema and database that's also only running Locator and the query runs just fine with the points on the map displaying as intended.
    Here's the current theme request that I'm submitting:
    <theme name= 'lowerTheme' >
    <jdbc_query spatial_column='GEOMETRY' jdbc_srid='8307' render_style= 'V.AVCD_BUILD' datasource='mvdemo' >
    select * from build where subtype in('ABC','123','DEF')
    <hidden_info>
    <field column='SUBTYPE' name='Type'/>
    <field column='NAME' name='Name'/>
    <field column='ADDR' name='Address'/>
    <field column='CITY' name='City'/>
    <field column='STATE' name='State'/>
    <field column='ZIP_CODE' name='ZIP Code'/>
    </hidden_info>
    </jdbc_query>
    <rendering>
    <style name='V.AVCD_BUILD' value_columns='SUBTYPE'/>
    </rendering>
    </theme>
    Within the actual function adding that theme to the 'mapview' variable I'm creating a new MVThemeBasedFOI object using the name 'lowerTheme' and the above definition for the second parameter in the constructor.
    Is there a listing of procedures on the MDSYS schema that I should check to make sure they're valid for spatial queries to work?
    Thanks in advance for the help.

  • MapViewer with XML data source

    Hello all,
    We have the MapViewer read data from JDBC data source doing spatial queries. Can any one tell me if I can use XML data source as input to the MapViewer.
    We have a data source that is only available thru Web services, we cannot make a database view on the schema.
    If not is it planned in the production version.
    Thanks

    How does the xml data look like? in GML?
    If the xml data set is not too large, maybe you can add them (after your application has parsed them) as additional MapViewer GeoFeatures in a map request.
    Currently MapViewer (preview or production release of 9.0.4) does not support xml-only datasource.
    We will look into incorporating GML or other standard-based xml datasource for a future release of MapViewer.

Maybe you are looking for