[Geoserver-users] No map features are displayed

Hi,

I tried to install GeoServer 1.6.0 to CentOS according to "CentOS (Red
Hat) 5.1 Install"
http://docs.codehaus.org/display/GEOSDOC/CentOS%20(Red%20Hat)%205.1%20Install

I finished "Install Java" and "Install Apache Tomcat ", and deployed
GeoServer 1.6.0.
However, no map features are displayed in OpenLayers map preview, at
/geoserver/mapPreview.do
On the other hand, in SVG map preview, map features are displayed and
WFS request working well (I can get WFS features using uDig).

What do I have to do to display map features in OpenLayers?

Working environment is below.
CentOS 5 (final)
Apache Tomcat/6.0.16
Java version "1.6.0_04"

Thanks

------------------------------------------------------------
Nobusuke IWASAKI Ph.D., Researcher
Ecosystem Informatics Division
National Institute for Agro-Environmental Sciences
Tsukuba, Ibaraki 305-8604, JAPAN
Tel / Fax 81-29-838-8226 Email: niwasaki@anonymised.com
--
View this message in context: http://www.nabble.com/No-map-features-are-displayed-tp15494740p15494740.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Nobusuke ha scritto:

Hi,

I tried to install GeoServer 1.6.0 to CentOS according to "CentOS (Red
Hat) 5.1 Install"
http://docs.codehaus.org/display/GEOSDOC/CentOS%20(Red%20Hat)%205.1%20Install

I finished "Install Java" and "Install Apache Tomcat ", and deployed
GeoServer 1.6.0.
However, no map features are displayed in OpenLayers map preview, at
/geoserver/mapPreview.do
On the other hand, in SVG map preview, map features are displayed and
WFS request working well (I can get WFS features using uDig).

What do I have to do to display map features in OpenLayers?

Well, nothing, it should just work. Let's try to isolate the
issue.
First, can you try the following straight GetMap request (adjust
the host name as needed):
http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&Format=image/png&request=GetMap&layers=topp:states&width=550&height=250&srs=EPSG:4326

If this one works, then I bet you have a javascript issue: is
javascript enabled in your browser?

If it does not, can you go into the geoserver data directory,
logs sub-folder, and see if you can find any stack trace
or error message?

Cheers
Andrea

> Well, nothing, it should just work. Let's try to isolate the
> issue.
> First, can you try the following straight GetMap request (adjust
> the host name as needed):
> http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&styles=population&Format=image/png&request=GetMap&layers=topp:states&width=550&height=250&srs=EPSG:4326

I try it. Only error massage is returned.

>> -
>> <ServiceExceptionReport version="1.1.1">
>> -
>> <ServiceException>
>>
>> java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
>> Could not initialize class sun.awt.X11GraphicsEnvironment
>> </ServiceException>
>> </ServiceExceptionReport>

  And, I find error massage in "geoserver.log"

>> 2008-02-15 19:06:20,855 WARN [geoserver.ows] - java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:169)
>> at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
>> at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135)
>> at org.vfny.geoserver.wms.responses.ImageUtils.prepareTransparency(ImageUtils.java:114)
>> at org.vfny.geoserver.wms.responses.DefaultRasterMapProducer.produceMap(DefaultRasterMapProducer.java:217)
>> at org.vfny.geoserver.wms.responses.GetMapResponse.execute(GetMapResponse.java:432)
>> at org.geoserver.ows.adapters.ResponseAdapter.getMimeType(ResponseAdapter.java:48)
>> at org.geoserver.ows.Dispatcher.response(Dispatcher.java:602)
>> at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:192)
>> at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
>> at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
>> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
>> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
>> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
>> at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
>> at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>> at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>> at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>> at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
>> at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>> at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
>> at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>> at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
>> at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>> at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
>> at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>> at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
>> at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
>> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>> at java.lang.Thread.run(Thread.java:619)

Thanks,
Nobusuke

Nobusuke IWASAKI ha scritto:

I try it. Only error massage is returned.

...

And, I find error massage in "geoserver.log"

>> 2008-02-15 19:06:20,855 WARN [geoserver.ows] - java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:169)
>> at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)

Aaah, your PC is headless (no X windows running).
You'll have to add the -Djava.awt.headless=true option to your Tomcat install. I think
export JAVA_OPTS = -Djava.awt.headless=true
in the environment that runs Tomcat should do the trick.

Cheers
Andrea

I try it. Only error massage is returned.

...

And, I find error massage in "geoserver.log"

>> 2008-02-15 19:06:20,855 WARN [geoserver.ows] - java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:169)
>> at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)

Aaah, your PC is headless (no X windows running).
You'll have to add the -Djava.awt.headless=true option to your Tomcat install. I think
export JAVA_OPTS = -Djava.awt.headless=true
in the environment that runs Tomcat should do the trick.

Yeah!
I can get map feature!
I add
export JAVA_OPTS="-Djava.awt.headless=true"
in the .bashrc

Thank you!

Nobusuke