SOS-Importer NullPointerException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SOS-Importer NullPointerException

Adrian_O
Hello,

my setup is:
Linux RaspberryPi 4.4.16-v7+
Apache Tomcat 7.0.56 (Debian)
Java JDK 7.0
SOS 4.3.7
SOS importer 0.4.0

i managed to deploy a SOS and inserted a sensor and a observation via POX which was successful and the test data was visible in my database. I then downloaded the Importer from [0] since i was not able to build it myself. I used the wizard to create a config and then tried to use the feeder to insert data into my SOS but i get following message:

pi@raspberrypi:~/Desktop/SOS/sosimporter/Feeder $ java -jar 52n-sos-importer-feeder-0.4.0-bin.jar -c /home/pi/Desktop/SOS/test/temperature.csv.52n-sos-import-config.xml
15:17:45.344 [main] INFO  Feeder - Application started
                Manifest-Version: 1.0"
                Created-By: 1.7.0_65 (Oracle Corporation)"
                HeapSize Information: max: 448MB" total now: 14MB free now: 9MB used now: 4MB
                os.name: Linux" os.arch: arm os.version: 4.4.16-v7+
15:17:47.380 [OneTimeFeeder] INFO  OneTimeFeeder - Starting feeding data from file via configuration 'temperature.csv.52n-sos-import-config.xml' to SOS instance
15:17:47.493 [OneTimeFeeder] TRACE SensorObservationService - SensorObservationService(Configuration [file=/home/pi/Desktop/SOS/test/temperature.csv.52n-sos-import-config.xml])
15:17:48.640 [OneTimeFeeder] DEBUG SimpleHttpClient - executing POST method to 'http://localhost:8080/52n-sos-webapp/service'.
15:17:57.408 [OneTimeFeeder] DEBUG SensorObservationService - OperationsMetadata found: org.n52.oxf.ows.capabilities.OperationsMetadata@1bbe38d
15:17:57.411 [OneTimeFeeder] DEBUG SensorObservationService - Found all required operations: (RegisterSensor|InsertSensor), InsertObservation
15:17:57.429 [OneTimeFeeder] DEBUG OneTimeFeeder - Check counter file '/home/pi/.SOSImporter/6836f288bdd5b943eaefaaa3151f9dbf'.
15:17:57.431 [OneTimeFeeder] DEBUG OneTimeFeeder - Counter file does not exist.
15:17:57.433 [OneTimeFeeder] TRACE SensorObservationService - importData()
15:17:57.522 [OneTimeFeeder] DEBUG SensorObservationService - Handling CSV line #1: [TemperaturesensorAdrian, TemperaturesensorAdrian, 20.10.2016 11:50, 48.14935 11.567826, Temperature, CEL, 24]
15:17:57.524 [OneTimeFeeder] DEBUG SensorObservationService - Parsing measured value column 6
15:17:57.539 [OneTimeFeeder] DEBUG SensorObservationService - Sensor: Sensor [name=TemperaturesensorAdrian, uri=TemperaturesensorAdrian]
15:17:57.557 [OneTimeFeeder] DEBUG SensorObservationService - Feature of Interest: FeatureOfInterest [p=null, name=TemperaturesensorAdrian, uri=TemperaturesensorAdrian]
15:17:57.576 [OneTimeFeeder] DEBUG SensorObservationService - Value: 24.0
15:17:57.634 [OneTimeFeeder] DEBUG SensorObservationService - Timestamp: 2016-10-20T11:50:00+02:00
15:17:57.645 [OneTimeFeeder] DEBUG SensorObservationService - UomCode: 'UnitOfMeasurement [name=CEL, uri=CEL]'
15:17:57.656 [OneTimeFeeder] DEBUG SensorObservationService - ObservedProperty: ObservedProperty [name=Temperature, uri=Temperature]
15:17:57.679 [OneTimeFeeder] DEBUG SensorObservationService - Offering: Offering [name=, uri=]
15:17:57.694 [OneTimeFeeder] DEBUG SensorObservationService - Found '1' Observed Properties for Sensor 'TemperaturesensorAdrian': '[ObservedProperty [name=Temperature, uri=Temperature]]'
15:17:57.698 [OneTimeFeeder] DEBUG SensorObservationService - Found '1' Measured value types for observed properties of sensor 'TemperaturesensorAdrian': '{ObservedProperty [name=Temperature, uri=Temperature]=NUMERIC}'.
15:17:57.703 [OneTimeFeeder] DEBUG SensorObservationService - Found '1' units of measurement for observed properties of sensor 'TemperaturesensorAdrian': '{ObservedProperty [name=Temperature, uri=Temperature]=CEL}'.
Exception in thread "OneTimeFeeder" java.lang.NullPointerException
        at org.n52.sos.importer.feeder.model.requests.RegisterSensor.getLongitudeUnit(RegisterSensor.java:107)
        at org.n52.sos.importer.feeder.util.DescriptionBuilder.createSML(DescriptionBuilder.java:79)"
        at org.n52.sos.importer.feeder.SensorObservationService.createInsertSensorParametersFromRS(SensorObservationService.java:1018)
        at org.n52.sos.importer.feeder.SensorObservationService.registerSensor(SensorObservationService.java:940)
        at org.n52.sos.importer.feeder.SensorObservationService.insertObservationsForOneLine(SensorObservationService.java:667)
        at org.n52.sos.importer.feeder.SensorObservationService.importData(SensorObservationService.java:304)"
        at org.n52.sos.importer.feeder.task.OneTimeFeeder.run(OneTimeFeeder.java:203)"
        at java.lang.Thread.run(Thread.java:745)"

I then tried to use another config.file for a non-registered sensor but i still get the same NullPointerException. How do i avoid these NullPointerExceptions?
Am i correct to assume that i need to Insert a Sensor first before i can use the Importer or is the Importer automatically creating the procedure?

Here is my Configfile temperature.xml and my sample csv file  temperature.csv
Please let me know if u need further information.

Kind regards,
Adrian

Reply | Threaded
Open this post in threaded view
|

Re: SOS-Importer NullPointerException

Eike Hinderk Jürrens
Hi Adrian,
I created an issue [0] regarding your bug.

On 03.11.2016 15:35, Adrian_O wrote:
> Am i correct to assume that i need to Insert a Sensor first before i can use
> the Importer or is the Importer automatically creating the procedure?

There is no need to register the sensors beforehand. When everything is
working fine, the importer should register the sensor.
Kind regards,
Eike

Links
[0] https://github.com/52North/sos-importer/issues/58

--
Eike Hinderk Jürrens
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-33
Fax: +49-(0)-251–396371-11
http://52north.org/
Twitter: @FiveTwoN
General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines
Reply | Threaded
Open this post in threaded view
|

Re: SOS-Importer NullPointerException

Eike Hinderk Jürrens
On 06.12.2016 16:16, Eike Hinderk Jürrens wrote:
> Hi Adrian,
> I created an issue [0] regarding your bug.

Hi Adrian,
the issue #58 is fixed and you should be able to create a working
configuration or feed the data with your configuration. Your problem had
strong links to #57 [1].
You should be able to build the latest development version following the
instructions in our wiki [2]. If not, feel free to come back here and ask.
Kind regards,
Eike

Link
[0] https://github.com/52North/sos-importer/issues/58
    Null Pointer Exception (NPE) when feeder tries to register a sensor
[1] https://github.com/52North/sos-importer/issues/57
    Feeder fails to read FoI position
[2] https://wiki.52north.org/SensorWeb/SosImporter#How_to_Build

--
Eike Hinderk Jürrens
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-33
Fax: +49-(0)-251–396371-11
http://52north.org/
Twitter: @FiveTwoN
General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines