Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 83914 invoked from network); 29 Jan 2007 11:26:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2007 11:26:17 -0000 Received: (qmail 22456 invoked by uid 500); 29 Jan 2007 11:26:20 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 22355 invoked by uid 500); 29 Jan 2007 11:26:19 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 22344 invoked by uid 99); 29 Jan 2007 11:26:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 03:26:19 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of andre.ufrj@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nf-out-0910.google.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 03:26:10 -0800 Received: by nf-out-0910.google.com with SMTP id l24so1844913nfc for ; Mon, 29 Jan 2007 03:25:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=mlnXT2V9GwSUmHIIRHt/CLhuzBufmLqrYStS3m2Ss6bMyo2QEya+jsVLBqq7lHar0jHAsNlfuE73YdED6x6gU4NrwGRRYTYzZOQ4q7vmqi2TlKXxhStdGkuPsawG5BilsYkcMTfTsqKQbj7EJy2q71dGWhSmpqNmlup98gDM3Mg= Received: by 10.49.41.3 with SMTP id t3mr4822335nfj.1170069948895; Mon, 29 Jan 2007 03:25:48 -0800 (PST) Received: by 10.48.164.12 with HTTP; Mon, 29 Jan 2007 03:25:48 -0800 (PST) Message-ID: Date: Mon, 29 Jan 2007 09:25:48 -0200 From: "=?ISO-8859-1?Q?Andr=E9_Rodrigues_Pena?=" To: "user-java@ibatis.apache.org" , "=?ISO-8859-1?Q?Marco_Aur=E9lio_F._Rozo?=" Subject: Problems compiling MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_29042_14235021.1170069948850" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_29042_14235021.1170069948850 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi all, I'm new to iBatis, this is my first project. I'm trying to use it with a JDBC driver provided by Microsoft to access MS SQL 2005. Every time I try t= o run it on Eclipse I get the same error message: "Could not find the main class. Program will exit". This error is often retrieved when you try to execute a JAR file that hasn't it's MANIFEST.MF file set to specify the mai= n class. It's not my case. Also there aren't version compatibility issues. I thought this error could have been generated due to mis-configuration. While configuring the transaction manager in the XML , I didn't find the list of available properties so that I can set what I need. So I set the properties I thought would be available: Here is the source-code of my 3 files: (They are all at the same package an= d classpath can find packages properly) ***** SqlMapsConfig.XML ***** ***** Translation.XML ***** ***** Tests.java ***** import java.io.IOException; import java.io.Reader; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.ibatis.common.resources.Resources; import com.ibatis.sqlmap.client.SqlMapClient; import com.ibatis.sqlmap.client.SqlMapClientBuilder; public class Tests { private static SqlMapClient sqlMapper; static { try { Reader reader =3D Resources.getResourceAsReader(" SqlMapConfig.xml"); sqlMapper =3D SqlMapClientBuilder.buildSqlMapClient(reader); reader.close(); } catch (IOException e) { // Fail fast. throw new RuntimeException("Something bad happened while building the SqlMapClient instance." + e, e); } } public static List selectAllTranslations() throws SQLException { return sqlMapper.queryForList("selectAllTranslations"); } public static void main(String args[]) { ArrayList myList; try { myList =3D new ArrayList(Tests.selectAllTranslations()); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Does anybody know the problem? Any tips are welcome, Thanks in advance. --=20 Andr=E9 Rodrigues Pena ------=_Part_29042_14235021.1170069948850 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi all,

I'm new to iBatis, this is my first project. I'm try= ing to use it with a JDBC driver provided by Microsoft to access MS SQL 200= 5. Every time I try to run it on Eclipse I get the same error message: &quo= t;Could not find the main class. Program will exit". This error is oft= en retrieved when you try to execute a JAR file that hasn't it's=20 MANIFEST.MF file set to specify the main class. It's not my case. Also = there aren't version compatibility issues.

I thought this error = could have been generated due to mis-configuration. While configuring the t= ransaction manager in the XML , I didn't find the list of available pro= perties so that I can set what I need. So I set the properties I thought wo= uld be available:

Here is the source-code of my 3 files: (They are all at the same pa= ckage and classpath can find packages properly)

***** SqlMapsConfig.= XML *****

<?xml version=3D"1.0" encoding=3D"UTF-8&= quot; ?>

<!DOCTYPE sqlMapConfig     
 &= nbsp;  PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN&q= uot;     
    "http://ibatis.apache.org= /dtd/sql-map-config-2.dtd ">

<sqlMapConfig>

  <transactionMan= ager type=3D"JDBC" commitRequired=3D"false">
&nbs= p;   <dataSource type=3D"SIMPLE">
  =     <property name=3D"JDBC.Driver " value=3D"com.microsoft.sqlserver.jdbc.SQLServerDriver"/>= ;
      <property name=3D"JDBC.Username= " value=3D"sa"/>
      <pr= operty name=3D"JDBC.Password" value=3D"ph4r400h"/>
      <property name=3D"JDBC.ServerNam= e" value=3D"localhost"/>
     = ; <property name=3D"JDBC.DatabaseName" value=3D"PDV"= />
      <property name=3D"JDBC.Port= Number " value=3D"1455"/>
    </dataSource&= gt;
  </transactionManager>

<sqlMap resource=3D&quo= t;Translation.xml"/>

</sqlMapConfig>

***** Translatio= n.XML *****

<?xml version=3D"1.0" encoding=3D"UTF-= 8" ?>

<!DOCTYPE sqlMap     
=     PUBLIC "-//ibatis.apache.org//DTD SQL Map=20 2.0//EN"     
    "http://ibatis.apache.o= rg/dtd/sql-map-2.dtd">

<sqlMap namespace=3D"Tran= slation">


  <resultMap id=3D"TranslationRes= ult" class=3D"Translation">
    <result property=3D"id" column=3D"= id"/>
    <result property=3D"label"= column=3D"label"/>
  </resultMap>

 = <select id=3D"selectAllTranslations" resultMap=3D"Transl= ationResult">
    SELECT * FROM _translations
  </select>= ;

</sqlMap>

***** Tests.java *****
import java.io.IOException;
import java.io.Reader;
import java.sql.S= QLException;
import=20 java.util.ArrayList;
import java.util.List;

import com.ibatis.com= mon.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class = Tests {
    private static SqlMapClient sqlMapper;
 &nbs= p;   static {
         &nbs= p;  try {
           &= nbsp;  Reader reader =3D Resources.getResourceAsReader("SqlMapCon= fig.xml");
           =    sqlMapper =3D SqlMapClientBuilder.buildSqlMapClient (reader);
            =   reader.close();
         &nbs= p;  } catch (IOException e) {
       =       // Fail fast.
     &= nbsp;        throw new RuntimeException("= ;Something bad happened while building the SqlMapClient instance." + e= , e);
            }
 &nb= sp;        }
     
 = ;   public static List selectAllTranslations() throws SQLExceptio= n {
        return sqlMapper.queryForList(= "selectAllTranslations");
       = ;
    }
   
    public static void main(String args[]) {
  =       ArrayList myList;
     &nb= sp;  try {
           = myList =3D new ArrayList(Tests.selectAllTranslations());
  &n= bsp;     } catch (SQLException e) {
    &n= bsp;       // TODO Auto-generated catch block
            e.printStackTr= ace();
        }
    }}

Does anybody know the problem? Any tips are welcome,
Thanks i= n advance.

--
Andr=E9 Rodrigues Pena ------=_Part_29042_14235021.1170069948850--