[ 
http://jira.codehaus.org/browse/JBEHAVE-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222268#action_222268
 ] 

Mauro Talevi commented on JBEHAVE-292:
--------------------------------------

Tom, your problem seems to be a classpath one.  I could not reproduce it 
because I did you manually download all the jars in the list.  Instead I used 
transitive dependencies from the following 3 dependencies: 

    <dependency>
      <groupId>org.jbehave</groupId>
      <artifactId>jbehave-ant</artifactId>
      <version>2.5.6</version>
    </dependency>
    <dependency>
      <groupId>org.jbehave.web</groupId>
      <artifactId>jbehave-web-selenium</artifactId>
      <version>2.1.6</version>
    </dependency>
    <dependency>
      <groupId>org.seleniumhq.selenium.server</groupId>
      <artifactId>selenium-server</artifactId>
      <version>1.0.1</version>
    </dependency>

which produced the following list of jars:

ant-1.7.1.jar
ant-launcher-1.7.1.jar
bcprov-jdk15-135.jar
commons-codec-1.3.jar
commons-collections-3.2.1.jar
commons-io-1.4.jar
commons-lang-2.4.jar
commons-logging-1.0.4.jar
freemarker-2.3.16.jar
hamcrest-all-1.1.jar
jbehave-ant-2.5.6.jar
jbehave-core-2.5.6.jar
jbehave-web-selenium-2.1.6.jar
junit-dep-4.4.jar
org.mortbay.jetty-5.1.12.jar
selenium-core-1.0.1.jar
selenium-java-client-driver-1.0.1.jar
selenium-server-1.0.1.jar
selenium-server-coreless-1.0.1.jar
servlet-api-2.4.ja

Note that you can fetch these dependencies via Maven or via Ivy or any other 
tools that supports transitive dependencies. 

With these jars I was able to run the scenario:


run-scenarios:
[scenarioRunner] Running scenario LoginScenario
[scenarioRunner] java.io.FileNotFoundException: selenium/epson/results.html (No 
such file or directory)
[scenarioRunner]        at java.io.FileOutputStream.open(Native Method)
[scenarioRunner]        at 
java.io.FileOutputStream.<init>(FileOutputStream.java:179)
[scenarioRunner]        at 
java.io.FileOutputStream.<init>(FileOutputStream.java:70)
[scenarioRunner]        at 
LoginScenario$1.forReportingScenarios(LoginScenario.java:28)
[scenarioRunner]        at 
org.jbehave.scenario.ScenarioRunner.run(ScenarioRunner.java:53)
[scenarioRunner]        at 
org.jbehave.scenario.ScenarioRunner.run(ScenarioRunner.java:42)
[scenarioRunner]        at 
org.jbehave.scenario.AbstractScenario.runScenario(AbstractScenario.java:75)
[scenarioRunner]        at 
org.jbehave.scenario.JUnitScenario.runScenario(JUnitScenario.java:54)
[scenarioRunner]        at 
org.jbehave.ant.ScenarioRunnerTask.execute(ScenarioRunnerTask.java:35)
[scenarioRunner]        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[scenarioRunner]        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
[scenarioRunner]        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[scenarioRunner]        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[scenarioRunner]        at java.lang.reflect.Method.invoke(Method.java:597)
[scenarioRunner]        at 
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[scenarioRunner]        at org.apache.tools.ant.Task.perform(Task.java:348)
[scenarioRunner]        at org.apache.tools.ant.Target.execute(Target.java:357)
[scenarioRunner]        at 
org.apache.tools.ant.Target.performTasks(Target.java:385)
[scenarioRunner]        at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
[scenarioRunner]        at 
org.apache.tools.ant.Project.executeTarget(Project.java:1306)
[scenarioRunner]        at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[scenarioRunner]        at 
org.apache.tools.ant.Project.executeTargets(Project.java:1189)
[scenarioRunner]        at org.apache.tools.ant.Main.runBuild(Main.java:758)
[scenarioRunner]        at org.apache.tools.ant.Main.startAnt(Main.java:217)
[scenarioRunner]        at 
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[scenarioRunner]        at 
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
[scenarioRunner] 
[scenarioRunner] (login_scenario.scenario)
[scenarioRunner] Scenario: 
[scenarioRunner] 10:09:59.198 INFO - Java: Apple Inc. 14.3-b01-101
[scenarioRunner] 10:09:59.199 INFO - OS: Mac OS X 10.5.8 x86_64
[scenarioRunner] 10:09:59.204 INFO - vnull [null], with Core v...@version@ 
[...@revision@]
[scenarioRunner] 10:09:59.289 INFO - Version Jetty/5.1.12
[scenarioRunner] 10:09:59.291 INFO - Started 
HttpContext[/selenium-server/driver,/selenium-server/driver]
[scenarioRunner] 10:09:59.292 INFO - Started 
HttpContext[/selenium-server,/selenium-server]
[scenarioRunner] 10:09:59.292 INFO - Started HttpContext[/,/]
[scenarioRunner] 10:09:59.301 INFO - Started SocketListener on 0.0.0.0:4444
[scenarioRunner] 10:09:59.301 INFO - Started org.mortbay.jetty.ser...@4090c06f
[scenarioRunner] 10:09:59.375 INFO - Checking Resource aliases
[scenarioRunner] 10:09:59.381 INFO - Command request: 
getNewBrowserSession[*firefox, http://www.epson.co.uk, ] on session null
[scenarioRunner] 10:09:59.383 INFO - creating new remote session
[scenarioRunner] 10:09:59.520 INFO - Allocated session 
81090682b8b74701bfd41ffae62b9f1a for http://www.epson.co.uk, launching...
[scenarioRunner] 10:09:59.577 INFO - Preparing Firefox profile...
[scenarioRunner] 10:10:10.999 INFO - Launching Firefox...
[scenarioRunner] Failure in running scenarios: 
[scenarioRunner] LoginScenario: Method Method.startSystem1, annotated with 
BeforeScenario failed.

Note that it fails to write report, because the reporter is misconfigured.  
Check the documentation on how to configure it properly:

http://jbehave.org/reference/stable/reports.html






> Failed To Instantiate Scenario - ClassNotFoundException
> -------------------------------------------------------
>
>                 Key: JBEHAVE-292
>                 URL: http://jira.codehaus.org/browse/JBEHAVE-292
>             Project: JBehave
>          Issue Type: Task
>          Components: Ant extension
>    Affects Versions: 2.5.4
>         Environment: Windows 7, JDK 1.6.18, JBehave 2.5.4, Selenium Server 
> and Selenium-Java client.
>            Reporter: Tom Little
>         Attachments: LoginProject.zip
>
>
> Hi,
> I'm having an issue with a very basic project using Jbehave and Selenium and 
> hopefully someone can help me out.
>  I have managed to create a .scenario, LoginScenario.java and LoginSteps.java 
> basic test with Selenium built in to test a login of a website. This is all 
> setup in Eclipse with the correct .jars on the classpath and buildpath, it 
> runs and works correctly. There is also a base.properties file that the test 
> uses to determine the URL to test.
>  I've been trying to migrate the project into a command line build using an 
> Ant script. I have almost carbon copied the build.xml from the Trader example 
> from the Jbehave website except rather than reading in the dependencies from 
> the pom.xml it copies local JARs into the classpath. Hopefully I have all the 
> Jars I need. I've also left out the reporting stuff as I just want the tests 
> to run firstly.
> It fails to instantiate the LoginScenario.java file and further down in the 
> error list is a ClassNotFoundError which makes me think the classpath isn't 
> including the compiled classes even though the output says the compilation 
> has been sucessful and prints out a very long classpath with the Jars in and 
> the path C:\LoginProject\target\classes which is the destdir of the compile 
> target.
> I'm sure its just me missing something in the build.xml, I'm sure its not an 
> issue with the Java classes themselves as they work fine in Eclipse when you 
> run LoginScenario.java
> Ive attached the project and under /lib there is a list of the JARS I would 
> have in List of JARS.txt, sorry I know this is a bit of a rubbish way of 
> doing things I'm just not particularly familiar with Maven and how to use its 
> functionality.
> Many Thanks, 
> Tom.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to