You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by André Rodrigues Pena <an...@gmail.com> on 2007/01/29 12:25:48 UTC

Problems compiling

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 to
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 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 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 and
classpath can find packages properly)

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

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

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

<sqlMapConfig>

  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="
com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
      <property name="JDBC.Username" value="sa"/>
      <property name="JDBC.Password" value="ph4r400h"/>
      <property name="JDBC.ServerName" value="localhost"/>
      <property name="JDBC.DatabaseName" value="PDV"/>
      <property name="JDBC.PortNumber" value="1455"/>
    </dataSource>
  </transactionManager>

<sqlMap resource="Translation.xml"/>

</sqlMapConfig>

***** Translation.XML *****

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

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

<sqlMap namespace="Translation">


  <resultMap id="TranslationResult" class="Translation">
    <result property="id" column="id"/>
    <result property="label" column="label"/>
  </resultMap>

  <select id="selectAllTranslations" resultMap="TranslationResult">
    SELECT * FROM _translations
  </select>

</sqlMap>

***** 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 = Resources.getResourceAsReader("
SqlMapConfig.xml");
              sqlMapper = 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 = 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.

-- 
André Rodrigues Pena

Re: Problems compiling

Posted by Brandon Goodin <br...@gmail.com>.
A few links should be of great help to you:

http://ibatis.apache.org/

SQL Map Doc:
http://ibatis.apache.org/docs/java/pdf/iBATIS-SqlMaps-2_en.pdf

SQL Map Tutorial:
http://ibatis.apache.org/docs/java/pdf/iBATIS-SqlMaps-2-Tutorial_en.pdf

Hope that helps,
Brandon

On 1/29/07, André Rodrigues Pena <an...@gmail.com> wrote:
>
> Hi Graeme, thanks for replying
>
> >FYI http://jtds.sourceforge.net/
>
> The DataSource and driver provided by Microsoft are working fine. The
> problem is that, during the mapping process in the XML, I dont know what
> properties are available for setting. I don't know exactly how it works
>
> >Is Tests your Main-Class in the mainfest?
>
> I don't have a MANIFEST file because I'm not packaging it into a JAR. I'm
> just compiling and executing it locally :)
>
>
>
>
> On 1/29/07, Graeme J Sweeney <ib...@gjsweeney.com> wrote:
> >
> > On Mon, 29 Jan 2007, André Rodrigues Pena wrote:
> >
> > > 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 to
> >
> > FYI http://jtds.sourceforge.net/
> >
> > > 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 main
> > > class. It's not my case. Also there aren't version compatibility
> > issues.
> >
> > Is Tests your Main-Class in the mainfest?
> >
> > <snip/>
> >
> > > Does anybody know the problem? Any tips are welcome,
> >
> > Try putting Tests in a package e.g. foo.Tests
> >
> > --
> > Graeme -
> >
>
>
>
> --
> André Rodrigues Pena

Re: Problems compiling

Posted by André Rodrigues Pena <an...@gmail.com>.
And another question:

In the transaction manager mapping file, I have to define JDBC properties.

My question is: How can I know what properties are available for setting?

For instance, in the DOC it mentions some properties like username and
password but what about the others? How can I know if the DatabaseName
property exists? I need to set it.

Actually I think that, if JDBC is a standard, so it might define common
properties so that systems can access it through an interface. Right? So do
I have to look at what properties are available in a JDBC documentation? I
tried and didn't find anything.

I'm lost.

=/



On 1/29/07, André Rodrigues Pena <an...@gmail.com> wrote:
>
> Brandon, thanks, in this moment I'm seeing some of the material you
> suggested me
>
> Chris, thanks but my project seems ok. As you know, After the application
> initializes it crashes with that message: "Could not find the main class.
> The program will exit". I did'nt mentioned it yet. May be it will help, but
> at the console, the first phrase is:
>
> SEVERE: SimpleDataSource: Error while loading properties. Cause:
> java.lang.RuntimeException: SimpleDataSource: Some properties were not
> set.
>
> At my first post I wrote the configuration XML file.
>
> Do you think a mis-configuration may be generating a message like that, or
> do you think that the mis-configuration error message is due to other
> issues?
>
> Thank you all in advance
>
>
>
> On 1/29/07, Chris Lamey <cl...@localmatters.com> wrote:
> >
> > On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> > > On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> > >
> > > > >Is Tests your Main-Class in the mainfest?
> > > >
> > > > I don't have a MANIFEST file because I'm not packaging it into a
> > JAR.
> > > > I'm just compiling and executing it locally :)
> > >
> > > Sounds like a CLASSPATH issue.
> > >
> > > Here's what I would do.
> > >
> > > - Select your main class in the Package Explorer
> > > - Right-click and select the "Run As"->"Run..." item
> > > - In the Main tab, verify that "Tests" is in the "Main class"
> > textfield
> > > - In the Classpath tab, verify the project is listed in the "User
> > > Entries" list.
> > >
> > > If that is correct, I would delete that Run configuration for the
> > class
> > > Tests and create a new one.
> >
> > Whups!  I meant to say, if that looks correct *and* the problem still
> > happens, I would delete the current Run config and create a new one.
> >
> > Sorry about that.
> >
> > > If it's still not running your class correctly, I would:
> > >
> > > - Select the project in the Package Explorer
> > > - Right-click and select the "Properties" item
> > > - In the Source tab, verify that the "Default build folder" exists on
> > > the filesystem and you have read/write access to it
> > > - Also take a look at the "Order and Export" tab and make sure it all
> > > looks ok
> > >
> > > If after that it's still failing, I would exit Eclipse and use java
> > and
> > > javac (probably with ant) at the shell to build and run the
> > class.  Then
> > > I would set Eclipse to use the same directories.
> > >
> > > Cheers,
> > > topher
> >
>
>
>
> --
> André Rodrigues Pena




-- 
André Rodrigues Pena

Re: Problems compiling

Posted by André Rodrigues Pena <an...@gmail.com>.
Jeff, your ConnectionURL property saved my life. As Chris said, the "cant
find main class" was a false message due to misconfiguration.

Thank you all guys. You have been so useful and kind.

On 1/29/07, Jeff Butler <je...@gmail.com> wrote:
>
> See here:
>
> http://msdn2.microsoft.com/en-us/library/ms378428.aspx
>
> I think it will be this value in your case:
>
> jdbc:sqlserver://localhost:1455;databaseName=PDV
>
>
> Jeff Butler
>
>
>
> On 1/29/07, André Rodrigues Pena <an...@gmail.com> wrote:
> >
> > Jeff, thanks for replying
> >
> > I really skipped ConnectionURL property because the DataSource component
> > that comes with the JDBC driver I'm using does ask for connection URL and I
> > don't know how to set it.
> >
> > On 1/29/07, Jeff Butler <jeffgbutler@gmail.com > wrote:
> > >
> > > You are missing the JDBC.ConnectionURL property in your datasource
> > > configuration.  SIMPLE datasource is documented in the iBATIS developers
> > > guide.
> > >
> > > Jeff Butler
> > >
> > >
> > >
> > > On 1/29/07, André Rodrigues Pena < andre.ufrj@gmail.com > wrote:
> > > >
> > > > Brandon, thanks, in this moment I'm seeing some of the material you
> > > > suggested me
> > > >
> > > > Chris, thanks but my project seems ok. As you know, After the
> > > > application initializes it crashes with that message: "Could not find the
> > > > main class. The program will exit". I did'nt mentioned it yet. May be it
> > > > will help, but at the console, the first phrase is:
> > > >
> > > > SEVERE: SimpleDataSource: Error while loading properties. Cause:
> > > > java.lang.RuntimeException: SimpleDataSource: Some properties were
> > > > not set.
> > > >
> > > > At my first post I wrote the configuration XML file.
> > > >
> > > > Do you think a mis-configuration may be generating a message like
> > > > that, or do you think that the mis-configuration error message is due to
> > > > other issues?
> > > >
> > > > Thank you all in advance
> > > >
> > > >
> > > >
> > > > On 1/29/07, Chris Lamey <clamey@localmatters.com > wrote:
> > > > >
> > > > > On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> > > > > > On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> > > > > >
> > > > > > > >Is Tests your Main-Class in the mainfest?
> > > > > > >
> > > > > > > I don't have a MANIFEST file because I'm not packaging it into
> > > > > a JAR.
> > > > > > > I'm just compiling and executing it locally :)
> > > > > >
> > > > > > Sounds like a CLASSPATH issue.
> > > > > >
> > > > > > Here's what I would do.
> > > > > >
> > > > > > - Select your main class in the Package Explorer
> > > > > > - Right-click and select the "Run As"->"Run..." item
> > > > > > - In the Main tab, verify that "Tests" is in the "Main class"
> > > > > textfield
> > > > > > - In the Classpath tab, verify the project is listed in the
> > > > > "User
> > > > > > Entries" list.
> > > > > >
> > > > > > If that is correct, I would delete that Run configuration for
> > > > > the class
> > > > > > Tests and create a new one.
> > > > >
> > > > > Whups!  I meant to say, if that looks correct *and* the problem
> > > > > still
> > > > > happens, I would delete the current Run config and create a new
> > > > > one.
> > > > >
> > > > > Sorry about that.
> > > > >
> > > > > > If it's still not running your class correctly, I would:
> > > > > >
> > > > > > - Select the project in the Package Explorer
> > > > > > - Right-click and select the "Properties" item
> > > > > > - In the Source tab, verify that the "Default build folder"
> > > > > exists on
> > > > > > the filesystem and you have read/write access to it
> > > > > > - Also take a look at the "Order and Export" tab and make sure
> > > > > it all
> > > > > > looks ok
> > > > > >
> > > > > > If after that it's still failing, I would exit Eclipse and use
> > > > > java and
> > > > > > javac (probably with ant) at the shell to build and run the
> > > > > class.  Then
> > > > > > I would set Eclipse to use the same directories.
> > > > > >
> > > > > > Cheers,
> > > > > > topher
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > André Rodrigues Pena
> > >
> > >
> > >
> >
> >
> > --
> > André Rodrigues Pena
>
>
>


-- 
André Rodrigues Pena

Re: Problems compiling

Posted by Jeff Butler <je...@gmail.com>.
See here:

http://msdn2.microsoft.com/en-us/library/ms378428.aspx

I think it will be this value in your case:

jdbc:sqlserver://localhost:1455;databaseName=PDV


Jeff Butler



On 1/29/07, André Rodrigues Pena <an...@gmail.com> wrote:
>
> Jeff, thanks for replying
>
> I really skipped ConnectionURL property because the DataSource component
> that comes with the JDBC driver I'm using does ask for connection URL and I
> don't know how to set it.
>
> On 1/29/07, Jeff Butler <je...@gmail.com> wrote:
> >
> > You are missing the JDBC.ConnectionURL property in your datasource
> > configuration.  SIMPLE datasource is documented in the iBATIS developers
> > guide.
> >
> > Jeff Butler
> >
> >
> >
> > On 1/29/07, André Rodrigues Pena < andre.ufrj@gmail.com> wrote:
> > >
> > > Brandon, thanks, in this moment I'm seeing some of the material you
> > > suggested me
> > >
> > > Chris, thanks but my project seems ok. As you know, After the
> > > application initializes it crashes with that message: "Could not find the
> > > main class. The program will exit". I did'nt mentioned it yet. May be it
> > > will help, but at the console, the first phrase is:
> > >
> > > SEVERE: SimpleDataSource: Error while loading properties. Cause:
> > > java.lang.RuntimeException: SimpleDataSource: Some properties were not
> > > set.
> > >
> > > At my first post I wrote the configuration XML file.
> > >
> > > Do you think a mis-configuration may be generating a message like
> > > that, or do you think that the mis-configuration error message is due to
> > > other issues?
> > >
> > > Thank you all in advance
> > >
> > >
> > >
> > > On 1/29/07, Chris Lamey <clamey@localmatters.com > wrote:
> > > >
> > > > On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> > > > > On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> > > > >
> > > > > > >Is Tests your Main-Class in the mainfest?
> > > > > >
> > > > > > I don't have a MANIFEST file because I'm not packaging it into a
> > > > JAR.
> > > > > > I'm just compiling and executing it locally :)
> > > > >
> > > > > Sounds like a CLASSPATH issue.
> > > > >
> > > > > Here's what I would do.
> > > > >
> > > > > - Select your main class in the Package Explorer
> > > > > - Right-click and select the "Run As"->"Run..." item
> > > > > - In the Main tab, verify that "Tests" is in the "Main class"
> > > > textfield
> > > > > - In the Classpath tab, verify the project is listed in the "User
> > > > > Entries" list.
> > > > >
> > > > > If that is correct, I would delete that Run configuration for the
> > > > class
> > > > > Tests and create a new one.
> > > >
> > > > Whups!  I meant to say, if that looks correct *and* the problem
> > > > still
> > > > happens, I would delete the current Run config and create a new one.
> > > >
> > > > Sorry about that.
> > > >
> > > > > If it's still not running your class correctly, I would:
> > > > >
> > > > > - Select the project in the Package Explorer
> > > > > - Right-click and select the "Properties" item
> > > > > - In the Source tab, verify that the "Default build folder" exists
> > > > on
> > > > > the filesystem and you have read/write access to it
> > > > > - Also take a look at the "Order and Export" tab and make sure it
> > > > all
> > > > > looks ok
> > > > >
> > > > > If after that it's still failing, I would exit Eclipse and use
> > > > java and
> > > > > javac (probably with ant) at the shell to build and run the
> > > > class.  Then
> > > > > I would set Eclipse to use the same directories.
> > > > >
> > > > > Cheers,
> > > > > topher
> > > >
> > >
> > >
> > >
> > > --
> > > André Rodrigues Pena
> >
> >
> >
>
>
> --
> André Rodrigues Pena

Re: Problems compiling

Posted by André Rodrigues Pena <an...@gmail.com>.
Jeff, thanks for replying

I really skipped ConnectionURL property because the DataSource component
that comes with the JDBC driver I'm using does ask for connection URL and I
don't know how to set it.

On 1/29/07, Jeff Butler <je...@gmail.com> wrote:
>
> You are missing the JDBC.ConnectionURL property in your datasource
> configuration.  SIMPLE datasource is documented in the iBATIS developers
> guide.
>
> Jeff Butler
>
>
>
> On 1/29/07, André Rodrigues Pena <an...@gmail.com> wrote:
> >
> > Brandon, thanks, in this moment I'm seeing some of the material you
> > suggested me
> >
> > Chris, thanks but my project seems ok. As you know, After the
> > application initializes it crashes with that message: "Could not find the
> > main class. The program will exit". I did'nt mentioned it yet. May be it
> > will help, but at the console, the first phrase is:
> >
> > SEVERE: SimpleDataSource: Error while loading properties. Cause:
> > java.lang.RuntimeException: SimpleDataSource: Some properties were not
> > set.
> >
> > At my first post I wrote the configuration XML file.
> >
> > Do you think a mis-configuration may be generating a message like that,
> > or do you think that the mis-configuration error message is due to other
> > issues?
> >
> > Thank you all in advance
> >
> >
> >
> > On 1/29/07, Chris Lamey <clamey@localmatters.com > wrote:
> > >
> > > On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> > > > On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> > > >
> > > > > >Is Tests your Main-Class in the mainfest?
> > > > >
> > > > > I don't have a MANIFEST file because I'm not packaging it into a
> > > JAR.
> > > > > I'm just compiling and executing it locally :)
> > > >
> > > > Sounds like a CLASSPATH issue.
> > > >
> > > > Here's what I would do.
> > > >
> > > > - Select your main class in the Package Explorer
> > > > - Right-click and select the "Run As"->"Run..." item
> > > > - In the Main tab, verify that "Tests" is in the "Main class"
> > > textfield
> > > > - In the Classpath tab, verify the project is listed in the "User
> > > > Entries" list.
> > > >
> > > > If that is correct, I would delete that Run configuration for the
> > > class
> > > > Tests and create a new one.
> > >
> > > Whups!  I meant to say, if that looks correct *and* the problem still
> > > happens, I would delete the current Run config and create a new one.
> > >
> > > Sorry about that.
> > >
> > > > If it's still not running your class correctly, I would:
> > > >
> > > > - Select the project in the Package Explorer
> > > > - Right-click and select the "Properties" item
> > > > - In the Source tab, verify that the "Default build folder" exists
> > > on
> > > > the filesystem and you have read/write access to it
> > > > - Also take a look at the "Order and Export" tab and make sure it
> > > all
> > > > looks ok
> > > >
> > > > If after that it's still failing, I would exit Eclipse and use java
> > > and
> > > > javac (probably with ant) at the shell to build and run the
> > > class.  Then
> > > > I would set Eclipse to use the same directories.
> > > >
> > > > Cheers,
> > > > topher
> > >
> >
> >
> >
> > --
> > André Rodrigues Pena
>
>
>


-- 
André Rodrigues Pena

Re: Problems compiling

Posted by Jeff Butler <je...@gmail.com>.
You are missing the JDBC.ConnectionURL property in your datasource
configuration.  SIMPLE datasource is documented in the iBATIS developers
guide.

Jeff Butler



On 1/29/07, André Rodrigues Pena <an...@gmail.com> wrote:
>
> Brandon, thanks, in this moment I'm seeing some of the material you
> suggested me
>
> Chris, thanks but my project seems ok. As you know, After the application
> initializes it crashes with that message: "Could not find the main class.
> The program will exit". I did'nt mentioned it yet. May be it will help, but
> at the console, the first phrase is:
>
> SEVERE: SimpleDataSource: Error while loading properties. Cause:
> java.lang.RuntimeException: SimpleDataSource: Some properties were not
> set.
>
> At my first post I wrote the configuration XML file.
>
> Do you think a mis-configuration may be generating a message like that, or
> do you think that the mis-configuration error message is due to other
> issues?
>
> Thank you all in advance
>
>
>
> On 1/29/07, Chris Lamey <cl...@localmatters.com> wrote:
> >
> > On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> > > On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> > >
> > > > >Is Tests your Main-Class in the mainfest?
> > > >
> > > > I don't have a MANIFEST file because I'm not packaging it into a
> > JAR.
> > > > I'm just compiling and executing it locally :)
> > >
> > > Sounds like a CLASSPATH issue.
> > >
> > > Here's what I would do.
> > >
> > > - Select your main class in the Package Explorer
> > > - Right-click and select the "Run As"->"Run..." item
> > > - In the Main tab, verify that "Tests" is in the "Main class"
> > textfield
> > > - In the Classpath tab, verify the project is listed in the "User
> > > Entries" list.
> > >
> > > If that is correct, I would delete that Run configuration for the
> > class
> > > Tests and create a new one.
> >
> > Whups!  I meant to say, if that looks correct *and* the problem still
> > happens, I would delete the current Run config and create a new one.
> >
> > Sorry about that.
> >
> > > If it's still not running your class correctly, I would:
> > >
> > > - Select the project in the Package Explorer
> > > - Right-click and select the "Properties" item
> > > - In the Source tab, verify that the "Default build folder" exists on
> > > the filesystem and you have read/write access to it
> > > - Also take a look at the "Order and Export" tab and make sure it all
> > > looks ok
> > >
> > > If after that it's still failing, I would exit Eclipse and use java
> > and
> > > javac (probably with ant) at the shell to build and run the
> > class.  Then
> > > I would set Eclipse to use the same directories.
> > >
> > > Cheers,
> > > topher
> >
>
>
>
> --
> André Rodrigues Pena

Re: Problems compiling

Posted by André Rodrigues Pena <an...@gmail.com>.
Brandon, thanks, in this moment I'm seeing some of the material you
suggested me

Chris, thanks but my project seems ok. As you know, After the application
initializes it crashes with that message: "Could not find the main class.
The program will exit". I did'nt mentioned it yet. May be it will help, but
at the console, the first phrase is:

SEVERE: SimpleDataSource: Error while loading properties. Cause:
java.lang.RuntimeException: SimpleDataSource: Some properties were not set.

At my first post I wrote the configuration XML file.

Do you think a mis-configuration may be generating a message like that, or
do you think that the mis-configuration error message is due to other
issues?

Thank you all in advance



On 1/29/07, Chris Lamey <cl...@localmatters.com> wrote:
>
> On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> > On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> >
> > > >Is Tests your Main-Class in the mainfest?
> > >
> > > I don't have a MANIFEST file because I'm not packaging it into a JAR.
> > > I'm just compiling and executing it locally :)
> >
> > Sounds like a CLASSPATH issue.
> >
> > Here's what I would do.
> >
> > - Select your main class in the Package Explorer
> > - Right-click and select the "Run As"->"Run..." item
> > - In the Main tab, verify that "Tests" is in the "Main class" textfield
> > - In the Classpath tab, verify the project is listed in the "User
> > Entries" list.
> >
> > If that is correct, I would delete that Run configuration for the class
> > Tests and create a new one.
>
> Whups!  I meant to say, if that looks correct *and* the problem still
> happens, I would delete the current Run config and create a new one.
>
> Sorry about that.
>
> > If it's still not running your class correctly, I would:
> >
> > - Select the project in the Package Explorer
> > - Right-click and select the "Properties" item
> > - In the Source tab, verify that the "Default build folder" exists on
> > the filesystem and you have read/write access to it
> > - Also take a look at the "Order and Export" tab and make sure it all
> > looks ok
> >
> > If after that it's still failing, I would exit Eclipse and use java and
> > javac (probably with ant) at the shell to build and run the class.  Then
> > I would set Eclipse to use the same directories.
> >
> > Cheers,
> > topher
>



-- 
André Rodrigues Pena

Re: Problems compiling

Posted by Chris Lamey <cl...@localmatters.com>.
On Mon, 2007-01-29 at 09:26 -0700, Chris Lamey wrote:
> On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:
> 
> > >Is Tests your Main-Class in the mainfest?
> > 
> > I don't have a MANIFEST file because I'm not packaging it into a JAR.
> > I'm just compiling and executing it locally :)
> 
> Sounds like a CLASSPATH issue.
> 
> Here's what I would do.
> 
> - Select your main class in the Package Explorer
> - Right-click and select the "Run As"->"Run..." item
> - In the Main tab, verify that "Tests" is in the "Main class" textfield
> - In the Classpath tab, verify the project is listed in the "User
> Entries" list.
> 
> If that is correct, I would delete that Run configuration for the class
> Tests and create a new one.

Whups!  I meant to say, if that looks correct *and* the problem still
happens, I would delete the current Run config and create a new one.

Sorry about that.

> If it's still not running your class correctly, I would:
> 
> - Select the project in the Package Explorer
> - Right-click and select the "Properties" item
> - In the Source tab, verify that the "Default build folder" exists on
> the filesystem and you have read/write access to it
> - Also take a look at the "Order and Export" tab and make sure it all
> looks ok
> 
> If after that it's still failing, I would exit Eclipse and use java and
> javac (probably with ant) at the shell to build and run the class.  Then
> I would set Eclipse to use the same directories.
> 
> Cheers,
> topher

Re: Problems compiling

Posted by Chris Lamey <cl...@localmatters.com>.
On Mon, 2007-01-29 at 11:43 -0200, André Rodrigues Pena wrote:

> >Is Tests your Main-Class in the mainfest?
> 
> I don't have a MANIFEST file because I'm not packaging it into a JAR.
> I'm just compiling and executing it locally :)

Sounds like a CLASSPATH issue.

Here's what I would do.

- Select your main class in the Package Explorer
- Right-click and select the "Run As"->"Run..." item
- In the Main tab, verify that "Tests" is in the "Main class" textfield
- In the Classpath tab, verify the project is listed in the "User
Entries" list.

If that is correct, I would delete that Run configuration for the class
Tests and create a new one.

If it's still not running your class correctly, I would:

- Select the project in the Package Explorer
- Right-click and select the "Properties" item
- In the Source tab, verify that the "Default build folder" exists on
the filesystem and you have read/write access to it
- Also take a look at the "Order and Export" tab and make sure it all
looks ok

If after that it's still failing, I would exit Eclipse and use java and
javac (probably with ant) at the shell to build and run the class.  Then
I would set Eclipse to use the same directories.

Cheers,
topher

Re: Problems compiling

Posted by André Rodrigues Pena <an...@gmail.com>.
Hi Graeme, thanks for replying

>FYI http://jtds.sourceforge.net/

The DataSource and driver provided by Microsoft are working fine. The
problem is that, during the mapping process in the XML, I dont know what
properties are available for setting. I don't know exactly how it works

>Is Tests your Main-Class in the mainfest?

I don't have a MANIFEST file because I'm not packaging it into a JAR. I'm
just compiling and executing it locally :)




On 1/29/07, Graeme J Sweeney <ib...@gjsweeney.com> wrote:
>
> On Mon, 29 Jan 2007, André Rodrigues Pena wrote:
>
> > 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 to
>
> FYI http://jtds.sourceforge.net/
>
> > 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
> main
> > class. It's not my case. Also there aren't version compatibility issues.
>
> Is Tests your Main-Class in the mainfest?
>
> <snip/>
>
> > Does anybody know the problem? Any tips are welcome,
>
> Try putting Tests in a package e.g. foo.Tests
>
> --
> Graeme -
>



-- 
André Rodrigues Pena

Re: Problems compiling

Posted by Graeme J Sweeney <ib...@gjsweeney.com>.
On Mon, 29 Jan 2007, Andr� Rodrigues Pena wrote:

> 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 to

FYI http://jtds.sourceforge.net/

> 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 main
> class. It's not my case. Also there aren't version compatibility issues.

Is Tests your Main-Class in the mainfest?

<snip/>

> Does anybody know the problem? Any tips are welcome,

Try putting Tests in a package e.g. foo.Tests

-- 
Graeme -