0

I have just done intial setup of the geomajas project and trying to config its data source with oracle database. I am following the given example for sqlserver and POSTGIS. My oracle layerroad xml file is like this:

<bean name="layerRoads" class="org.geomajas.layer.geotools.GeoToolsLayer">
              <property name="layerInfo" ref="layerRoadsInfo"/>
              <property name="parameters">
                     <list>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="namespace" />
                                  <property name="value" value="Oracle" />
                           </bean>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="user" />
                                  <property name="value" value="mdsys" />
                           </bean>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="passwd" />
                                  <property name="value" value="mdsys" />
                           </bean>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="database" />
                                  <property name="value" value="mdsys" />
                           </bean>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="host" />
                                  <property name="value" value="localhost" />
                           </bean>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="port" />
                                  <property name="value" value="1521" />
                           </bean>
                           <bean class="org.geomajas.configuration.Parameter">
                                  <property name="name" value="dbtype" />
                                  <property name="value" value="Oracle" />
                           </bean>

In web.xml file I have written this

WEB-INF/example/geotools/oracle/layerRoads.xml

In pom.xml

<dependency>
                     <groupId>org.geotools.jdbc</groupId>
            <artifactId>gt-oracle-spatial</artifactId>
            <version>2.5.5</version>
              </dependency>
              <dependency>
                      <groupId>com.oracle</groupId>
               <artifactId>ojdbc14</artifactId>
              <version>10.2.0.2.0</version>
              </dependency>

When I am running it it gives me this error

[Console scanner] WARN  o.g.layer.geotools.DataStoreFactory - Datastore factory PostGIS(PostGIS Database) is not available
[Console scanner] WARN  o.g.layer.geotools.GeoToolsLayer - The layer could not be correctly initialized: layerRoads
ception: No datastore found. Possible causes are missing factory or missing library for your datastore (e.g. database driver).
Available() method of your DataStoreFactory class to find out which libraries are needed.
factories : PostGIS

2 Answers 2

1

I have no idea how this is all supposed to work. But, assuming that the following refers to a username and password in your Oracle database, then it is wrong;

<bean class="org.geomajas.configuration.Parameter">
    <property name="name" value="user" />
    <property name="value" value="mdsys" />
</bean>
<bean class="org.geomajas.configuration.Parameter">
    <property name="name" value="passwd" />
    <property name="value" value="mdsys" />
</bean>

The MDSYS user is a system user and must not be used by any application, and definitely NOT to store any data. It is locked by default (so you cannot use it anyway). And if unlocked (which should not be done anyway), then its password must definitely not be MDSYS! That account has significant privileges: treat it with the same care as the SYSTEM and SYS accounts.

I cannot comment on the actual error you get, but it looks like your environment still thinks it is connecting to PostGIS. Maybe you are

1

The Oracle datastore factory is not found on the classpath. It should appear in the list after 'factories: POSTGIS'. I think you should have the following dependency in your pom:

<dependency>
        <groupId>org.geotools.jdbc</groupId>
        <artifactId>gt-jdbc-oracle</artifactId>
        <version>2.5.5</version>
</dependency>

Also make sure all geotools versions are the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.