<DIV><BR>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<DIV>I am using mapserver 4.2.4.</DIV>
<DIV>All I wanted to do is to do any simple mapserver instructions to see that everything works.</DIV>
<DIV>I have tried the demos that apear when you install mapserver, but I wanted to see it work with my own code and deploying my archives to the server.</DIV>
<DIV>For example it will be great if i could manage to just draw a .map file for instance as a response to the client.</DIV>
<DIV>Does&nbsp;anyone know how to do this, or what easy instructions I can use to see if it works?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thank you</DIV>
<DIV>&nbsp;</DIV>
<DIV>Jose Luis<BR><BR><B><I>&lt;sgillies@FRII.COM&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">On Nov 29, 2004, at 4:26 AM, Jose Luis Gonzalez wrote:<BR><BR>&gt; --0-82611386-1101727598=:30831<BR>&gt; Content-Type: text/plain; charset=iso-8859-1<BR>&gt; Content-Transfer-Encoding: 8bit<BR>&gt;<BR>&gt; This is my code:<BR>&gt; First of all I have this file:<BR>&gt;<BR>&gt; package javamaps;<BR>&gt;<BR>&gt; public class MapserverLibLoad{<BR>&gt; public static void loadLibrary() throws UnsatisfiedLinkError{<BR>&gt; System.loadLibrary("mapscript");<BR>&gt; }<BR>&gt; }<BR>&gt;<BR>&gt; Then this is the principal program, as you see it is a servlet:<BR>&gt;<BR>&gt; import javamaps.*;<BR>&gt; import edu.umn.gis.mapscript.*;<BR>&gt; import javax.ejb.*;<BR>&gt; import javax.xml.parsers.*;<BR>&gt; import javax.xml.transform.*;<BR>&gt; import javax.xml.transform.dom.*;<BR>&gt; import org.w3c.dom.*;<BR>&gt; import java.sql.*;<BR>&gt; import javax.sql.*;<BR>&gt; import
 javax.naming.*;<BR>&gt;<BR>&gt; import javax.servlet.*;<BR>&gt; import javax.servlet.http.*;<BR>&gt; import java.io.*;<BR>&gt; public class test2 extends HttpServlet{<BR>&gt;<BR>&gt; InitialContext initialContext=null;<BR>&gt;<BR>&gt; static{<BR>&gt; try{<BR>&gt; MapserverLibLoad.loadLibrary();<BR>&gt; }catch(UnsatisfiedLinkError e){<BR>&gt; e.printStackTrace();<BR>&gt; System.out.println("CONTINUE");<BR>&gt; }<BR>&gt; }<BR>&gt;<BR>&gt;<BR>&gt; /<BR>&gt; /----------------------------------------------------------------------<BR>&gt; ------------------------------------------------------<BR>&gt;<BR>&gt; private Connection createDatabaseConnection()throws EJBException{<BR>&gt; DataSource dataSource;<BR>&gt; Connection connection;<BR>&gt; PreparedStatement stmt;<BR>&gt; try{<BR>&gt; dataSource = (DataSource) initialContext.lookup("jdbc/lbs");<BR>&gt; connection= dataSource.getConnection();<BR>&gt; //System.out.println("<BR>&gt;
 DATABSE:::::"+connection.getMetaData().getUserName());<BR>&gt; return connection;<BR>&gt; }catch (SQLException e){<BR>&gt; throw (new EJBException(e));<BR>&gt; }catch (NamingException e){<BR>&gt; throw (new EJBException(e));<BR>&gt; }<BR>&gt; }<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; /<BR>&gt; /----------------------------------------------------------------------<BR>&gt; ------------------------------------------------------<BR>&gt; public void init (ServletConfig cfg){<BR>&gt; try{<BR>&gt; System.out.println("Try to init servlet");<BR>&gt; System.out.flush();<BR>&gt; initialContext= new InitialContext();<BR>&gt; }catch(Exception e){<BR>&gt; throw (new EJBException(e));<BR>&gt; }<BR>&gt;<BR>&gt; }//fin init<BR>&gt;<BR>&gt; public void service (HttpServletRequest req, HttpServletResponse res){<BR>&gt; Connection conexion=null;<BR>&gt; String imei=null;<BR>&gt; PrintWriter out=null;<BR>&gt; Statement orden=null;<BR>&gt; ResultSet rs=null;<BR>&gt; String SQL=null;<BR>&gt;<BR>&gt; try{ itemObj
 item = new itemObj();<BR>&gt; System.out.println(" BIG NAME<BR>&gt; :&gt;&gt;"+item.getName()+"&lt;&lt;");<BR>&gt;<BR>&gt; conexion=this.createDatabaseConnection();<BR>&gt; imei=req.getParameter("IMEI");<BR>&gt; out=res.getWriter();<BR>&gt; SQL="SELECT * FROM Client WHERE Name=";<BR>&gt; SQL=SQL+"'"+imei+"'";<BR>&gt; orden=conexion.createStatement();<BR>&gt; rs=orden.executeQuery(SQL);<BR>&gt; res.setContentType("text/html");<BR>&gt; out.println("");<BR>&gt; out.println("
<TABLE border=1>");<BR>&gt; rs.next();//I move to the first row<BR>&gt; out.println("
<TBODY>
<TR>
<TD colSpan=3>");<BR>&gt; out.println("</TD></TR>");<BR>&gt; out.println("
<TR>
<TD>"+rs.getString("Name"));<BR>&gt; out.println("</TD>
<TD>"+rs.getString("Mobile"));<BR>&gt;<BR>&gt; out.println("</TD>
<TD>"+rs.getString("Telephone_Number"));<BR>&gt; out.println("</TD></TR>");<BR>&gt; while (rs.next()){<BR>&gt; out.println("
<TR>
<TD>"+rs.getString("Name"));<BR>&gt; out.println("</TD>
<TD>"+rs.getString("Mobile"));<BR>&gt;<BR>&gt; out.println("</TD>
<TD>"+rs.getString("Telephone_Number"));<BR>&gt; out.println("</TD></TR>");<BR>&gt; }<BR>&gt; out.println("</TBODY></TABLE>");<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; }//fin try<BR>&gt; catch (Exception e){<BR>&gt; System.out.println(e);<BR>&gt; }catch (Throwable e){<BR>&gt; System.out.println("WRONGG POINT");<BR>&gt; e.printStackTrace();<BR>&gt; }finally{<BR>&gt; try{<BR>&gt; out.close();<BR>&gt; rs.close();<BR>&gt; conexion.close();<BR>&gt; orden.close();<BR>&gt; }catch(Exception e){<BR>&gt; throw (new EJBException(e));<BR>&gt; }<BR>&gt;<BR>&gt; }//fin service<BR>&gt;<BR>&gt; }<BR>&gt; }<BR>&gt;<BR>&gt; It seems as like he can't reach the mapserver librarys and I don't<BR>&gt; know why.It gives me this error:<BR>&gt;<BR>&gt; java.lang.UnsatisfiedLinkError: new_itemObj<BR>&gt;<BR>&gt; Can someone help me?<BR>&gt; Know what I'm doing wrong?<BR>&gt;<BR>&gt; Thank you<BR>&gt;<BR>&gt; Jose Luis<BR>&gt;<BR><BR>Jose Luis,<BR><BR>1) it is *very* important that you mention which version of
 MapServer<BR>you use! The mapscript module has changed very much from 3.6 to 4.4.<BR><BR>2) do not try to use itemObj, it is not functional. We use SWIG to<BR>generate the mapscript wrapper for Java, and it is very permissive,<BR>with the result that non-functional classes can be accidently<BR>added to mapscript. I'm going to shut itemObj out of the final 4.4<BR>release.<BR><BR>cheers,<BR>Sean<BR><BR><BR><BR>--<BR>Sean Gillies<BR>sgillies at frii dot com<BR>http://users.frii.com/sgillies<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
<BR>
<TABLE>
<TBODY>
<TR>
<TD><A href="http://es.rd.yahoo.com/mail_es/tagline/mail/image/*http://es.mail.yahoo.com"><IMG height=80 alt="Nuevo Correo Yahoo!" src="http://eur.i1.yimg.com/eur.yimg.com/i/es/mail/mails.gif" width=230 align=left border=0></A></TD></TR></TBODY></TABLE></BLOCKQUOTE></DIV><p>
                <hr size=1><br><table><tr><td><a href="http://es.rd.yahoo.com/mail_es/tagline/mail/image/*http://es.mail.yahoo.com"><img src="http://eur.i1.yimg.com/eur.yimg.com/i/es/mail/mails.gif" height=80 width=230 alt="Nuevo Correo Yahoo!" border=0 align="left"></a></td></tr></table>