2 Replies Latest reply on Aug 19, 2005 6:14 AM by Darran Lofthouse

    command line ANT vs Eclipse ANT

    steve mcqueen Newbie


      I"m running 4.0.3RC2 with JBoss Eclipse 3.1 IDE and ant 1.6.5.

      I also downloaded the tutorial files from this site, and I am trying to the stateless example to run.

      I am able to run it from the command line using 'ant run' so I know everything is up and running, but I can't run this from inside Eclipse.

      There is Client.java that I try and run by right clicking and saying "Run As Java Application" but I think my Run Configuration is wrong.

      Here is the run configuration from Ant

      <target name="run" depends="ejbjar">
       <java classname="org.jboss.tutorial.stateless.client.Client" fork="yes" dir=".">
       <classpath refid="classpath"/>

      My Run configuration within Eclipse for classpath shows for User Entries:
      "statelessTest" - my project name

      I don't see how I can point my client.java to my bean in eclipse, they are both in the same project, and I don't see how I can set the classpath of my run configuration.

      Any pointers are appriciated.


        • 1. Re: command line ANT vs Eclipse ANT
          steve mcqueen Newbie


          Here is the exact error:
          "exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial"

          I belive the code is fine, because it runs with 'ant run' and I think my general config is fine, because I can deploy and run .jsp, but my run configuration must be off.


          • 2. Re: command line ANT vs Eclipse ANT
            Darran Lofthouse Master

            Can you post the link to the tutorial you are actually following.

            The error you are getting is saying that the properties required to initialise the JNDI lookup have not been set. It is not about the classpath to find the bean.

            It is likely that the ant script you are using has a file called jndi.properties on the classpath and this will contain the settings.