The question is - if possible, on the basis of OSM write offline GIS on JEE platform? Visualize some of the objects over the map, whose coordinates are specified in the database.
What tools are needed for this and where to start?
Any GIS should be able to visualize OSM data from a PostGIS schema created with Osm2pgsql or from Shapefiles, see GIS software.
You may hava a look at GeoServer: “Java (J2EE) servlet-based, can run in any servlet container”, see also GeoServer and OpenStreetMap. For more open source GIS software and libraries (some in Java) visit OSGeo.
My question is - how to use WMS in GeoServer? I download the OpenStreetMap data and import it to GeoServer and now i want to use this data as a WMS layer. Is it possible? I would be very grateful for the information!
Of course it is possible and you can see one example on home page of Geoserver http://geoserver.org/display/GEOS/Welcome
What you see is an OpenLayers application but Geoserver can generate the same maps into WMS too. I am sure that you will find a lot of reading by doing a search with Geoserver and OpenStreetMap.
However, OpenStreetMap data are just geospatial data like all the other geospatial data. OSM just happens to have a bit peculiar native format. I would start with a simple way by downloading some OSM shapefiles from Cloudmade or Geofabrik. Use them for making some shapefile data stores for Geoserver and start playing with styles. The SLD cookbook is a good introduction to SLD styles. But if you want to do something really interesting with OSM data and not just dull WMS or even more dull tiles, start to play with WFS.