[Geoserver-devel] Layer preview error

Hello there

I found a problem that may be related to issue GEOS-4025 ("Layer preview cause Error")

Good thing is, this one is easy to reproduce on GeoServer 2.0.2. It seems to be related to GeoServer not being able to cope with missing files in the data dir.

The steps are the following (obs: regarding environment, I'm on Windows XP)

1. Install GeoServer 2.0.2 from scratch (I installed it stand-alone)
2. OK, everything is working right? Now stop GeoServer, go to its data dir and delete everything in there.
3. Start GeoServer. It will create some files in the data dir and work properly (Layer preview page opens OK)
4. Stop GeoServer and start again. Everything seems to be in place, but when you go to the layer preview page, you get an "Ooops" error (see attachment)

Codewise, when debugging the 2.0.2 code, the problem seemed to be caused by org.geoserver.wms.WMS getting a null value when calling serviceInfo.getMetadata() within the getSvgRenderer() method.

That's it. Andrea, do you want me to place this as a comment to GEOS-4025, or should I open a new JIRA here?

Cheers
Milton

PS: I haven't tested it using the SNAPSHOT code or nightly build..

--

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502

(attachments)

GeoServer_Oops.pdf (134 KB)

Milton Jonathan ha scritto:
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hello there

I found a problem that may be related to issue GEOS-4025 ("Layer preview cause Error")

Good thing is, this one is easy to reproduce on GeoServer 2.0.2. It seems to be related to GeoServer not being able to cope with missing files in the data dir.

The steps are the following (obs: regarding environment, I'm on Windows XP)

1. Install GeoServer 2.0.2 from scratch (I installed it stand-alone)
2. OK, everything is working right? Now stop GeoServer, go to its data dir and delete everything in there.
3. Start GeoServer. It will create some files in the data dir and work properly (Layer preview page opens OK)
4. Stop GeoServer and start again. Everything seems to be in place, but when you go to the layer preview page, you get an "Ooops" error (see attachment)

Codewise, when debugging the 2.0.2 code, the problem seemed to be caused by org.geoserver.wms.WMS getting a null value when calling serviceInfo.getMetadata() within the getSvgRenderer() method.

That's it. Andrea, do you want me to place this as a comment to GEOS-4025, or should I open a new JIRA here?

Eh, not sure how to handle that one. GeoServer is simply not designed
to start from a completely empty data directory. The minimum
is here:
http://svn.codehaus.org/geoserver/trunk/data/minimal/

Well, actually even that contains a few unecessary directories,
like capabilities, coverages, images, mbdemos, plugins, templates,
validation. But once you remove those you get the bare minimum.

It would be actually nice to be able and start from a totally empty
data directory. Want to try making a patch?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hey there

Hmm, so I understand that that minimal corresponds to having all those folders empty, right? What about the xml files? Must the file have any contents?

In any case, I have the impression that GeoServer almost succeeds in creating everything on its own. Not sure about making a patch there (no idea how GeoServer creates that stuff), but I may be able to spare some time to at least find out what is the missing part (by trial and error, that's all I can imagine doing right now)

Andrea Aime wrote:

Milton Jonathan ha scritto:

--

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502

Milton Jonathan ha scritto:

Hey there

Hmm, so I understand that that minimal corresponds to having all those folders empty, right? What about the xml files? Must the file have any contents?

Yes, they need at the very least that content afaik.

In any case, I have the impression that GeoServer almost succeeds in creating everything on its own. Not sure about making a patch there (no idea how GeoServer creates that stuff), but I may be able to spare some time to at least find out what is the missing part (by trial and error, that's all I can imagine doing right now)

That specific error is about the WMS code not dealing with the missing
SVG setting. It does not have a default in case of null.
That should be easy to fix, but the thing is, afaik, we never actually
try to start from an empty dir, so other issues like that one
can pop up here and there

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hmm

Well, the funny thing is that GeoServer DOES work when you start it up on an empty directory. It just stops working when you shut it down and start up again (!). So it seems that it creates whatever it needs in memory but forgets to save that info somewhere.. does that make sense?

Milton

Andrea Aime wrote:

Milton Jonathan ha scritto:

Hey there

Hmm, so I understand that that minimal corresponds to having all those folders empty, right? What about the xml files? Must the file have any contents?

Yes, they need at the very least that content afaik.

In any case, I have the impression that GeoServer almost succeeds in creating everything on its own. Not sure about making a patch there (no idea how GeoServer creates that stuff), but I may be able to spare some time to at least find out what is the missing part (by trial and error, that's all I can imagine doing right now)

That specific error is about the WMS code not dealing with the missing
SVG setting. It does not have a default in case of null.
That should be easy to fix, but the thing is, afaik, we never actually
try to start from an empty dir, so other issues like that one
can pop up here and there

Cheers
Andrea

--

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502

Milton Jonathan ha scritto:

Hmm

Well, the funny thing is that GeoServer DOES work when you start it up on an empty directory. It just stops working when you shut it down and start up again (!). So it seems that it creates whatever it needs in memory but forgets to save that info somewhere.. does that make sense?

I guess it does. Ok, add everything to the jira issue.
Not sure when we'll be able to fix that one though. Sigh, we need more
contributors..

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

I think the fix for this one is actually relatively straight forward and involves the xstream service loaders properly initializing when reading from xml representation. See attached patch.

But as andrea said there are probably a few other issues hiding out there.

On 10-08-05 9:26 AM, Andrea Aime wrote:

Milton Jonathan ha scritto:

Hmm

Well, the funny thing is that GeoServer DOES work when you start it up
on an empty directory. It just stops working when you shut it down and
start up again (!). So it seems that it creates whatever it needs in
memory but forgets to save that info somewhere.. does that make sense?

I guess it does. Ok, add everything to the jira issue.
Not sure when we'll be able to fix that one though. Sigh, we need more
contributors..

Cheers
Andrea

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

(attachments)

patch (1.71 KB)

Spoke too soon. Poking the server a little harder none of the styles get copied over properly so wms basically does not function at all. So some work to do indeed.

On 10-08-06 9:54 AM, Justin Deoliveira wrote:

I think the fix for this one is actually relatively straight forward and
involves the xstream service loaders properly initializing when reading
from xml representation. See attached patch.

But as andrea said there are probably a few other issues hiding out there.

On 10-08-05 9:26 AM, Andrea Aime wrote:

Milton Jonathan ha scritto:

Hmm

Well, the funny thing is that GeoServer DOES work when you start it up
on an empty directory. It just stops working when you shut it down and
start up again (!). So it seems that it creates whatever it needs in
memory but forgets to save that info somewhere.. does that make sense?

I guess it does. Ok, add everything to the jira issue.
Not sure when we'll be able to fix that one though. Sigh, we need more
contributors..

Cheers
Andrea

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hey there

Sorry for the late answer (I was out of office last week)

Justin, I checked your patch and it works OK for the layer preview page. From what I could see, the only other thing needed to make GeoServer work completely from an empty data dir was to add a "styles" folder there, which GeoServer does not create on its own. After I create one manually, everything works fine.

So, what should we do JIRA-wise then? Create a new issue with Justin's current patch and all these comments?

Thanks
Milton

Justin Deoliveira wrote:

Spoke too soon. Poking the server a little harder none of the styles get copied over properly so wms basically does not function at all. So some work to do indeed.

On 10-08-06 9:54 AM, Justin Deoliveira wrote:

I think the fix for this one is actually relatively straight forward and
involves the xstream service loaders properly initializing when reading
from xml representation. See attached patch.

But as andrea said there are probably a few other issues hiding out there.

On 10-08-05 9:26 AM, Andrea Aime wrote:

Milton Jonathan ha scritto:

Hmm

Well, the funny thing is that GeoServer DOES work when you start it up
on an empty directory. It just stops working when you shut it down and
start up again (!). So it seems that it creates whatever it needs in
memory but forgets to save that info somewhere.. does that make sense?

I guess it does. Ok, add everything to the jira issue.
Not sure when we'll be able to fix that one though. Sigh, we need more
contributors..

Cheers
Andrea

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev

_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502

Hi Milton,

The patch has already been applied to svn. An issue was created, sorry i should have added you as a watcher.

http://jira.codehaus.org/browse/GEOS-4088

I updated the patch there and it should handle the style case. Let me know how it works.

-Justin

On Mon, Aug 16, 2010 at 3:39 PM, Milton Jonathan <milton@anonymised.com> wrote:

Hey there

Sorry for the late answer (I was out of office last week)

Justin, I checked your patch and it works OK for the layer preview page. From what I could see, the only other thing needed to make GeoServer work completely from an empty data dir was to add a “styles” folder there, which GeoServer does not create on its own. After I create one manually, everything works fine.

So, what should we do JIRA-wise then? Create a new issue with Justin’s current patch and all these comments?

Thanks
Milton

Justin Deoliveira wrote:

Spoke too soon. Poking the server a little harder none of the styles get copied over properly so wms basically does not function at all. So some work to do indeed.

On 10-08-06 9:54 AM, Justin Deoliveira wrote:

I think the fix for this one is actually relatively straight forward and
involves the xstream service loaders properly initializing when reading
from xml representation. See attached patch.

But as andrea said there are probably a few other issues hiding out there.

On 10-08-05 9:26 AM, Andrea Aime wrote:

Milton Jonathan ha scritto:

Hmm

Well, the funny thing is that GeoServer DOES work when you start it up
on an empty directory. It just stops working when you shut it down and
start up again (!). So it seems that it creates whatever it needs in
memory but forgets to save that info somewhere… does that make sense?

I guess it does. Ok, add everything to the jira issue.
Not sure when we’ll be able to fix that one though. Sigh, we need more
contributors…

Cheers
Andrea


This SF.net email is sponsored by

Make an app they can’t live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev


Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hey Justin

Yep, it works perfectly! Thanks!

Milton

Justin Deoliveira wrote:

Hi Milton,

The patch has already been applied to svn. An issue was created, sorry i should have added you as a watcher.

http://jira.codehaus.org/browse/GEOS-4088

I updated the patch there and it should handle the style case. Let me know how it works.

-Justin

On Mon, Aug 16, 2010 at 3:39 PM, Milton Jonathan <milton@anonymised.com <mailto:milton@anonymised.com>> wrote:

    Hey there

    Sorry for the late answer (I was out of office last week)

    Justin, I checked your patch and it works OK for the layer preview
    page. From what I could see, the only other thing needed to make
    GeoServer work completely from an empty data dir was to add a
    "styles" folder there, which GeoServer does not create on its own.
    After I create one manually, everything works fine.

    So, what should we do JIRA-wise then? Create a new issue with
    Justin's current patch and all these comments?

    Thanks
    Milton

    Justin Deoliveira wrote:

        Spoke too soon. Poking the server a little harder none of the
        styles get copied over properly so wms basically does not
        function at all. So some work to do indeed.

        On 10-08-06 9:54 AM, Justin Deoliveira wrote:

            I think the fix for this one is actually relatively straight
            forward and
            involves the xstream service loaders properly initializing
            when reading
            from xml representation. See attached patch.

            But as andrea said there are probably a few other issues
            hiding out there.

            On 10-08-05 9:26 AM, Andrea Aime wrote:

                Milton Jonathan ha scritto:

                    Hmm

                    Well, the funny thing is that GeoServer DOES work
                    when you start it up
                    on an empty directory. It just stops working when
                    you shut it down and
                    start up again (!). So it seems that it creates
                    whatever it needs in
                    memory but forgets to save that info somewhere..
                    does that make sense?

                I guess it does. Ok, add everything to the jira issue.
                Not sure when we'll be able to fix that one though.
                Sigh, we need more
                contributors..

                Cheers
                Andrea

            ------------------------------------------------------------------------------
            This SF.net email is sponsored by

            Make an app they can't live without
            Enter the BlackBerry Developer Challenge
            http://p.sf.net/sfu/RIM-dev2dev

            _______________________________________________
            Geoserver-devel mailing list
            Geoserver-devel@lists.sourceforge.net
            <mailto:Geoserver-devel@lists.sourceforge.net>
            https://lists.sourceforge.net/lists/listinfo/geoserver-devel

    --

    Milton Jonathan
    Grupo GIS e Meio Ambiente
    Tecgraf/PUC-Rio
    Tel: +55-21-3527-2502

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

--

Milton Jonathan
Grupo GIS e Meio Ambiente
Tecgraf/PUC-Rio
Tel: +55-21-3527-2502