ERROR : Invalid endian flag value encountered.

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

ERROR : Invalid endian flag value encountered.

orkun
hello

I run into this error


Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian
flag value encountered.
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
[postgresql-9.1-901-1.jdbc4.jar:]

---

I generated jts geometry as:

WKTReader fromText = new WKTReader(new GeometryFactory(new
PrecisionModel(PrecisionModel.FLOATING), 4326));

Geometry geom = null;
  geom = fromText.read("POINT(10 20)");
  //geom.setSRID(4326);


I use postgresql 9.2 / postgis 2.1.0SVN


I will appreciate if you find solution

regards


--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı

Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535
________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR : Invalid endian flag value encountered.

Jan Boonen
Hi Ahmet,

Please check this entry on stackoverflow for details (it seems to me
that you are encountering the same problem).

http://stackoverflow.com/questions/12215212/postgis-geometry-saving-invalid-endian-flag-value-encountered

Cheers,

Jan

On 22-11-2012 21:15, Ahmet Temiz wrote:

> hello
>
> I run into this error
>
>
> Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian
> flag value encountered.
>      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
> [postgresql-9.1-901-1.jdbc4.jar:]
>
> ---
>
> I generated jts geometry as:
>
> WKTReader fromText = new WKTReader(new GeometryFactory(new
> PrecisionModel(PrecisionModel.FLOATING), 4326));
>
> Geometry geom = null;
>    geom = fromText.read("POINT(10 20)");
>    //geom.setSRID(4326);
>
>
> I use postgresql 9.2 / postgis 2.1.0SVN
>
>
> I will appreciate if you find solution
>
> regards
>
>
> --
> Ahmet Temiz
> Jeoloji Müh.
> Afet ve Acil Durum Yönetimi Başkanlığı
> Planlama ve Zarar Azaltma Dairesi Başkanlığı
>
> Eskişehir Yolu 10. km.
> Lodumlu / Ankara
> Tel : 0 312 2872680 / 1535
> ________________________
>
> Ahmet Temiz
> Geological Eng.
> Information Systems - GIS Group
> Disaster and Emergency Management
> of Presidency
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users


_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR : Invalid endian flag value encountered.

orkun
the problem still continues...

( Caused by: org.postgresql.util.
PSQLException: ERROR: Invalid endian
flag value encountered.
)

Is creation of geom object and persisting  correct ?


---
        String wktPoint="POINT(10 5)";
                  Geometry geom = new WKTReader(new
GeometryFactory(new PrecisionModel(), 4326)).read(wktPoint);

        log.info("**** geom isValid ****   "+geom.isValid()); >> TRUE


        member.setId((long) 11);
        member.setAddress("ddress");
        member.setEmail("ahmet@email");
        member.setName("name1");
        member.setPhoneNumber("05054466457");
        member.setLocation((Point) geom); // without geom it works

       em.persist(member);

        // using Hibernate session(Native API) and JPA entitymanager
        Session session = (Session) em.getDelegate();
        session.persist(member);
        memberEventSrc.fire(member);
-----

         where am I doing ?

          kind regards




        ---




On Thu, Nov 22, 2012 at 10:20 PM, Jan Boonen <[hidden email]> wrote:

> Hi Ahmet,
>
> Please check this entry on stackoverflow for details (it seems to me that
> you are encountering the same problem).
>
> http://stackoverflow.com/questions/12215212/postgis-geometry-saving-invalid-endian-flag-value-encountered
>
> Cheers,
>
> Jan
>
>
> On 22-11-2012 21:15, Ahmet Temiz wrote:
>>
>> hello
>>
>> I run into this error
>>
>>
>> Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian
>> flag value encountered.
>>      at
>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>> [postgresql-9.1-901-1.jdbc4.jar:]
>>
>> ---
>>
>> I generated jts geometry as:
>>
>> WKTReader fromText = new WKTReader(new GeometryFactory(new
>> PrecisionModel(PrecisionModel.FLOATING), 4326));
>>
>> Geometry geom = null;
>>    geom = fromText.read("POINT(10 20)");
>>    //geom.setSRID(4326);
>>
>>
>> I use postgresql 9.2 / postgis 2.1.0SVN
>>
>>
>> I will appreciate if you find solution
>>
>> regards
>>
>>
>> --
>> Ahmet Temiz
>> Jeoloji Müh.
>> Afet ve Acil Durum Yönetimi Başkanlığı
>> Planlama ve Zarar Azaltma Dairesi Başkanlığı
>>
>> Eskişehir Yolu 10. km.
>> Lodumlu / Ankara
>> Tel : 0 312 2872680 / 1535
>> ________________________
>>
>> Ahmet Temiz
>> Geological Eng.
>> Information Systems - GIS Group
>> Disaster and Emergency Management
>> of Presidency
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>>
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users



--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı

Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535
________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR : Invalid endian flag value encountered.

Jan Boonen
Hi Ahmed,

You are providing little information, which makes it difficult to see
where things are going wrong. It would be better if you could post your
entity, mapping file, Hibernate configuration and ddl for the table
you're persisting to. Also, it would be nice if you could post the query
Hibernate is generating (use show_sql=true in your Hibernate configuration).

Cheers,

Jan

On 24-11-2012 16:20, Ahmet Temiz wrote:

> the problem still continues...
>
> ( Caused by: org.postgresql.util.
> PSQLException: ERROR: Invalid endian
> flag value encountered.
> )
>
> Is creation of geom object and persisting  correct ?
>
>
> ---
>          String wktPoint="POINT(10 5)";
>                    Geometry geom = new WKTReader(new
> GeometryFactory(new PrecisionModel(), 4326)).read(wktPoint);
>
>          log.info("**** geom isValid ****   "+geom.isValid()); >> TRUE
>
>
>          member.setId((long) 11);
>          member.setAddress("ddress");
>          member.setEmail("ahmet@email");
>          member.setName("name1");
>          member.setPhoneNumber("05054466457");
>          member.setLocation((Point) geom); // without geom it works
>
>         em.persist(member);
>
>          // using Hibernate session(Native API) and JPA entitymanager
>          Session session = (Session) em.getDelegate();
>          session.persist(member);
>          memberEventSrc.fire(member);
> -----
>
>           where am I doing ?
>
>            kind regards
>
>
>
>
>          ---
>
>
>
>
> On Thu, Nov 22, 2012 at 10:20 PM, Jan Boonen <[hidden email]> wrote:
>> Hi Ahmet,
>>
>> Please check this entry on stackoverflow for details (it seems to me that
>> you are encountering the same problem).
>>
>> http://stackoverflow.com/questions/12215212/postgis-geometry-saving-invalid-endian-flag-value-encountered
>>
>> Cheers,
>>
>> Jan
>>
>>
>> On 22-11-2012 21:15, Ahmet Temiz wrote:
>>> hello
>>>
>>> I run into this error
>>>
>>>
>>> Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian
>>> flag value encountered.
>>>       at
>>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>>> [postgresql-9.1-901-1.jdbc4.jar:]
>>>
>>> ---
>>>
>>> I generated jts geometry as:
>>>
>>> WKTReader fromText = new WKTReader(new GeometryFactory(new
>>> PrecisionModel(PrecisionModel.FLOATING), 4326));
>>>
>>> Geometry geom = null;
>>>     geom = fromText.read("POINT(10 20)");
>>>     //geom.setSRID(4326);
>>>
>>>
>>> I use postgresql 9.2 / postgis 2.1.0SVN
>>>
>>>
>>> I will appreciate if you find solution
>>>
>>> regards
>>>
>>>
>>> --
>>> Ahmet Temiz
>>> Jeoloji Müh.
>>> Afet ve Acil Durum Yönetimi Başkanlığı
>>> Planlama ve Zarar Azaltma Dairesi Başkanlığı
>>>
>>> Eskişehir Yolu 10. km.
>>> Lodumlu / Ankara
>>> Tel : 0 312 2872680 / 1535
>>> ________________________
>>>
>>> Ahmet Temiz
>>> Geological Eng.
>>> Information Systems - GIS Group
>>> Disaster and Emergency Management
>>> of Presidency
>>> _______________________________________________
>>> hibernatespatial-users mailing list
>>> [hidden email]
>>>
>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>
>>
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>


_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR : Invalid endian flag value encountered.

orkun
Firstly, thank you for your real help

I attached src and jboss log (as zip).

here is the postgis side of the entity:

turkiye=> \d memberhibernate4demo
        Table "public.memberhibernate4demo"
    Column    |          Type          | Modifiers
--------------+------------------------+-----------
 id           | bigint                 | not null
 address      | character varying(255) |
 email        | character varying(255) | not null
 name         | character varying(25)  | not null
 phone_number | character varying(12)  | not null
 location     | geometry(Point,4326)   |
Indexes:
    "memberhibernate4demo_pkey" PRIMARY KEY, btree (id)


thanks again

On Sun, Nov 25, 2012 at 3:55 PM, Jan Boonen <[hidden email]> wrote:

> Hi Ahmed,
>
> You are providing little information, which makes it difficult to see where
> things are going wrong. It would be better if you could post your entity,
> mapping file, Hibernate configuration and ddl for the table you're
> persisting to. Also, it would be nice if you could post the query Hibernate
> is generating (use show_sql=true in your Hibernate configuration).
>
> Cheers,
>
> Jan
>
>
> On 24-11-2012 16:20, Ahmet Temiz wrote:
>>
>> the problem still continues...
>>
>> ( Caused by: org.postgresql.util.
>> PSQLException: ERROR: Invalid endian
>> flag value encountered.
>> )
>>
>> Is creation of geom object and persisting  correct ?
>>
>>
>> ---
>>          String wktPoint="POINT(10 5)";
>>                    Geometry geom = new WKTReader(new
>> GeometryFactory(new PrecisionModel(), 4326)).read(wktPoint);
>>
>>          log.info("**** geom isValid ****   "+geom.isValid()); >> TRUE
>>
>>
>>          member.setId((long) 11);
>>          member.setAddress("ddress");
>>          member.setEmail("ahmet@email");
>>          member.setName("name1");
>>          member.setPhoneNumber("05054466457");
>>          member.setLocation((Point) geom); // without geom it works
>>
>>         em.persist(member);
>>
>>          // using Hibernate session(Native API) and JPA entitymanager
>>          Session session = (Session) em.getDelegate();
>>          session.persist(member);
>>          memberEventSrc.fire(member);
>> -----
>>
>>           where am I doing ?
>>
>>            kind regards
>>
>>
>>
>>
>>          ---
>>
>>
>>
>>
>> On Thu, Nov 22, 2012 at 10:20 PM, Jan Boonen <[hidden email]> wrote:
>>>
>>> Hi Ahmet,
>>>
>>> Please check this entry on stackoverflow for details (it seems to me that
>>> you are encountering the same problem).
>>>
>>>
>>> http://stackoverflow.com/questions/12215212/postgis-geometry-saving-invalid-endian-flag-value-encountered
>>>
>>> Cheers,
>>>
>>> Jan
>>>
>>>
>>> On 22-11-2012 21:15, Ahmet Temiz wrote:
>>>>
>>>> hello
>>>>
>>>> I run into this error
>>>>
>>>>
>>>> Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian
>>>> flag value encountered.
>>>>       at
>>>>
>>>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>>>> [postgresql-9.1-901-1.jdbc4.jar:]
>>>>
>>>> ---
>>>>
>>>> I generated jts geometry as:
>>>>
>>>> WKTReader fromText = new WKTReader(new GeometryFactory(new
>>>> PrecisionModel(PrecisionModel.FLOATING), 4326));
>>>>
>>>> Geometry geom = null;
>>>>     geom = fromText.read("POINT(10 20)");
>>>>     //geom.setSRID(4326);
>>>>
>>>>
>>>> I use postgresql 9.2 / postgis 2.1.0SVN
>>>>
>>>>
>>>> I will appreciate if you find solution
>>>>
>>>> regards
>>>>
>>>>
>>>> --
>>>> Ahmet Temiz
>>>> Jeoloji Müh.
>>>> Afet ve Acil Durum Yönetimi Başkanlığı
>>>> Planlama ve Zarar Azaltma Dairesi Başkanlığı
>>>>
>>>> Eskişehir Yolu 10. km.
>>>> Lodumlu / Ankara
>>>> Tel : 0 312 2872680 / 1535
>>>> ________________________
>>>>
>>>> Ahmet Temiz
>>>> Geological Eng.
>>>> Information Systems - GIS Group
>>>> Disaster and Emergency Management
>>>> of Presidency
>>>> _______________________________________________
>>>> hibernatespatial-users mailing list
>>>> [hidden email]
>>>>
>>>>
>>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>>
>>>
>>>
>>> _______________________________________________
>>> hibernatespatial-users mailing list
>>> [hidden email]
>>>
>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>
>>
>>
>
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users


--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı

Eskişehir Yolu 10. km.
Lodumlu / Ankara
Tel : 0 312 2872680 / 1535
________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users

src.zip (131K) Download Attachment
log_out.txt.zip (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ERROR : Invalid endian flag value encountered.

Jan Boonen
Hi Ahmet,

As I wrote before, I think the problem is that you are mixing
annotations on fields with annotations on methods (getter). If Hibernate
encouters an annotation on a field it will ignore properties on methods.
Therefore it doesn't see your @Type annotation for the Geometry property
location.

Also see the warning in the Hibernate Annotations documentation
(http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html_single/#entity-mapping-entity).


Cheers,

Jan


On 25-11-2012 18:53, Ahmet Temiz wrote:

> Firstly, thank you for your real help
>
> I attached src and jboss log (as zip).
>
> here is the postgis side of the entity:
>
> turkiye=> \d memberhibernate4demo
>          Table "public.memberhibernate4demo"
>      Column    |          Type          | Modifiers
> --------------+------------------------+-----------
>   id           | bigint                 | not null
>   address      | character varying(255) |
>   email        | character varying(255) | not null
>   name         | character varying(25)  | not null
>   phone_number | character varying(12)  | not null
>   location     | geometry(Point,4326)   |
> Indexes:
>      "memberhibernate4demo_pkey" PRIMARY KEY, btree (id)
>
>
> thanks again
>
> On Sun, Nov 25, 2012 at 3:55 PM, Jan Boonen <[hidden email]> wrote:
>> Hi Ahmed,
>>
>> You are providing little information, which makes it difficult to see where
>> things are going wrong. It would be better if you could post your entity,
>> mapping file, Hibernate configuration and ddl for the table you're
>> persisting to. Also, it would be nice if you could post the query Hibernate
>> is generating (use show_sql=true in your Hibernate configuration).
>>
>> Cheers,
>>
>> Jan
>>
>>
>> On 24-11-2012 16:20, Ahmet Temiz wrote:
>>> the problem still continues...
>>>
>>> ( Caused by: org.postgresql.util.
>>> PSQLException: ERROR: Invalid endian
>>> flag value encountered.
>>> )
>>>
>>> Is creation of geom object and persisting  correct ?
>>>
>>>
>>> ---
>>>           String wktPoint="POINT(10 5)";
>>>                     Geometry geom = new WKTReader(new
>>> GeometryFactory(new PrecisionModel(), 4326)).read(wktPoint);
>>>
>>>           log.info("**** geom isValid ****   "+geom.isValid()); >> TRUE
>>>
>>>
>>>           member.setId((long) 11);
>>>           member.setAddress("ddress");
>>>           member.setEmail("ahmet@email");
>>>           member.setName("name1");
>>>           member.setPhoneNumber("05054466457");
>>>           member.setLocation((Point) geom); // without geom it works
>>>
>>>          em.persist(member);
>>>
>>>           // using Hibernate session(Native API) and JPA entitymanager
>>>           Session session = (Session) em.getDelegate();
>>>           session.persist(member);
>>>           memberEventSrc.fire(member);
>>> -----
>>>
>>>            where am I doing ?
>>>
>>>             kind regards
>>>
>>>
>>>
>>>
>>>           ---
>>>
>>>
>>>
>>>
>>> On Thu, Nov 22, 2012 at 10:20 PM, Jan Boonen <[hidden email]> wrote:
>>>> Hi Ahmet,
>>>>
>>>> Please check this entry on stackoverflow for details (it seems to me that
>>>> you are encountering the same problem).
>>>>
>>>>
>>>> http://stackoverflow.com/questions/12215212/postgis-geometry-saving-invalid-endian-flag-value-encountered
>>>>
>>>> Cheers,
>>>>
>>>> Jan
>>>>
>>>>
>>>> On 22-11-2012 21:15, Ahmet Temiz wrote:
>>>>> hello
>>>>>
>>>>> I run into this error
>>>>>
>>>>>
>>>>> Caused by: org.postgresql.util.PSQLException: ERROR: Invalid endian
>>>>> flag value encountered.
>>>>>        at
>>>>>
>>>>> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
>>>>> [postgresql-9.1-901-1.jdbc4.jar:]
>>>>>
>>>>> ---
>>>>>
>>>>> I generated jts geometry as:
>>>>>
>>>>> WKTReader fromText = new WKTReader(new GeometryFactory(new
>>>>> PrecisionModel(PrecisionModel.FLOATING), 4326));
>>>>>
>>>>> Geometry geom = null;
>>>>>      geom = fromText.read("POINT(10 20)");
>>>>>      //geom.setSRID(4326);
>>>>>
>>>>>
>>>>> I use postgresql 9.2 / postgis 2.1.0SVN
>>>>>
>>>>>
>>>>> I will appreciate if you find solution
>>>>>
>>>>> regards
>>>>>
>>>>>
>>>>> --
>>>>> Ahmet Temiz
>>>>> Jeoloji Müh.
>>>>> Afet ve Acil Durum Yönetimi Başkanlığı
>>>>> Planlama ve Zarar Azaltma Dairesi Başkanlığı
>>>>>
>>>>> Eskişehir Yolu 10. km.
>>>>> Lodumlu / Ankara
>>>>> Tel : 0 312 2872680 / 1535
>>>>> ________________________
>>>>>
>>>>> Ahmet Temiz
>>>>> Geological Eng.
>>>>> Information Systems - GIS Group
>>>>> Disaster and Emergency Management
>>>>> of Presidency
>>>>> _______________________________________________
>>>>> hibernatespatial-users mailing list
>>>>> [hidden email]
>>>>>
>>>>>
>>>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>>>
>>>>
>>>> _______________________________________________
>>>> hibernatespatial-users mailing list
>>>> [hidden email]
>>>>
>>>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>>>
>>>
>>
>> _______________________________________________
>> hibernatespatial-users mailing list
>> [hidden email]
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
> --
> Ahmet Temiz
> Jeoloji Müh.
> Afet ve Acil Durum Yönetimi Başkanlığı
> Planlama ve Zarar Azaltma Dairesi Başkanlığı
>
> Eskişehir Yolu 10. km.
> Lodumlu / Ankara
> Tel : 0 312 2872680 / 1535
> ________________________
>
> Ahmet Temiz
> Geological Eng.
> Information Systems - GIS Group
> Disaster and Emergency Management
> of Presidency
>
>
> _______________________________________________
> hibernatespatial-users mailing list
> [hidden email]
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users


_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users