Prasad, I suspect the problem is that file (however it's named) is not actually in the classpath, hence the exception.
The issue probably stems from the fact that while the Scenario java class lookup is done on the src folder (either main or test), the textual scenarios are loaded from the classpath. What you need to ensure is that the textual scenarios (call them *.scenario just to be concrete) are copied to the classpath. Please check the target directory that contains the .class files to see if the *.scenario files are also present. If not, simply copy them over after compilation and before running the scenarios. Cheers On 10/03/2010 11:34, Prasad Shindikar wrote: > I have tried to use the ScenarioNameResolver by renaming my scenario > file as 'netstat_scenarios.scenario'. > > Please find the attached java Scenario class. > > I am still getting the same error :( Any help is appreciated. > > Regards, > > Prasad Shindikar > > > On Wed, Mar 10, 2010 at 3:32 PM, Prasad Shindikar > <[email protected] <mailto:[email protected]>> wrote: > > The text scenario file, the Scenario file and the steps file are > all in the same com.mypackage package. > > Do you think, it will be necessary to specify the 'src' before the > PATH that is used for searching the text based scenario file > 'netstat_scenarios' ? > > Regards, > > Prasad Shindikar > > > > On Wed, Mar 10, 2010 at 3:30 PM, Mauro Talevi > <[email protected] <mailto:[email protected]>> > wrote: > > No, you can use either. One extends the other. > > > > On 10 Mar 2010, at 09:21, Prasad Shindikar > <[email protected] > <mailto:[email protected]>> wrote: > >> btw, in my java scenario class i am extending the >> org.jbehave.scenario.*Scenario* >> >> while browsing through a couple of similar problem mails, i >> figured that people have also extended *JUnitScenario*. >> >> Am i making some mistake here ? >> >> Regards, >> >> Prasad Shindikar >> >> >> On Wed, Mar 10, 2010 at 2:24 PM, Prasad Shindikar >> <[email protected] >> <mailto:[email protected]>> wrote: >> >> I am not using any extension. My file is simply >> 'netstat_scenarios' >> >> Regards, >> >> Prasad Shindikar >> >> >> >> On Wed, Mar 10, 2010 at 2:23 PM, Mauro Talevi >> <[email protected] >> <mailto:[email protected]>> wrote: >> >> You need to configure in your Scenario class the >> ScenarioNameResolver to whatever extension you're >> using, e.g. new >> UnderscoredCamelCaseResolver(".scenario"). By >> default, it uses no extension. >> >> Cheers >> >> >> On 10/03/2010 08:50, Prasad Shindikar wrote: >>> Hi Mauro, >>> >>> Thanks! The script is able to find the scenario java >>> file. However, the classloader is unable to find the >>> text based scenario file - 'netstat_scenarios'. >>> >>> This is the stack trace that I get when I run the >>> ant script. >>> >>> *Buildfile: jbehave.xml >>> [scenarioRunner] Running scenario >>> com.mypackage.NetstatScenarios >>> [scenarioRunner] Failure in runing scenarios: >>> [scenarioRunner] com.mypackage.NetstatScenarios: >>> Path 'com/mypackage/netstat_scenarios' could not be >>> found by classloader >>> [org.jbehave.scenario.ScenarioClassLoader urls=[]] >>> [renderReports] log4j:ERROR A >>> "org.apache.log4j.ConsoleAppender" object is not >>> assignable to a "org.apache.log4j.Appender" variable.* >>> >>> PS: The file is present at the above mentioned >>> location. I am thinking does the PATH for the >>> classloader require 'src' as a part of the PATH. ie >>> the PATH should be >>> 'src/com/mypackage/netstat_scenarios' instead of the >>> above mentioned path? >>> >>> Regards, >>> >>> Prasad Shindikar >>> >>> >>> On Wed, Mar 10, 2010 at 2:02 PM, Mauro Talevi >>> <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> Hi, >>> >>> I think the problem in locating the scenario >>> stems from the configuration of the source >>> directory + includes: the directory should not >>> include the package, ie 'src' instead of >>> 'src/com/mypackage', and the includes should not >>> include the directory: >>> >>> <scenarioRunner >>> scenarioIncludes="com/mypackage/NetstatScenarios.java" >>> scenarioExcludes="**/*Steps.java" >>> classLoaderInjected="false" >>> skip="false" >>> ignoreFailure="true" >>> batch="true" >>> scope="compile" >>> sourceDirectory="src" >>> testSourceDirectory="src/test/java" /> >>> >>> >>> Also, if the the scenarios are located in the >>> test directory you need to specify scope="test". >>> >>> Cheers >>> >>> >>> On 10/03/2010 07:19, Prasad Shindikar wrote: >>>> Hi, >>>> * >>>> I am trying to run jbehave using ANT. However, >>>> I get the following stack trace. >>>> >>>> Buildfile: jbehave.xml >>>> [scenarioRunner] No scenarios to run. >>>> [renderReports] Rendering reports in >>>> './target/jbehave-reports' using formats '[txt, >>>> html, xml]' and template properties >>>> '{defaultFormats=stats >>>> [renderReports] renderedDirectory=rendered}' >>>> >>>> Please find the attached build file that I am >>>> using. >>>> >>>> The text based scenario file, java scenario >>>> file and steps classes are all located under >>>> the same folder. >>>> >>>> Can you please guide me why the scenarios are >>>> not getting called from the build file ? >>>> >>>> *Regards, >>>> >>>> Prasad Shindikar >>>> >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe from this list, please visit: >>>> >>>> http://xircles.codehaus.org/manage_email >>>> >>> >>> >> >> >> > > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email >
