Issue 1402 in robotframework-ride: Could not import Java keyword into RIDE and get it into use

10 views
Skip to first unread message

robotfram...@googlecode.com

unread,
Apr 17, 2015, 10:23:27 AM4/17/15
to robotframewo...@googlegroups.com
Status: New
Owner: ----

New issue 1402 by kenji.au...@gmail.com: Could not import Java keyword into
RIDE and get it into use
https://code.google.com/p/robotframework-ride/issues/detail?id=1402

I got the following error message while running my java keyword from RIDE:
Traceback (most recent call last):
File "", line 1, in
File "C:\jython2.7b4\Lib\runpy.py", line 170, in run_module
mod_name, loader, code, fname = _get_module_details(mod_name)
File "C:\jython2.7b4\Lib\runpy.py", line 104, in _get_module_details
if loader.is_package(mod_name):
AttributeError: 'ClasspathPyImporter' object has no attribute 'is_package'

My RF installation details

window 7 - 64bit
python-2.7.9
jython2.7b4
java 7 (jdk1.7.0_75)
latest RF and RIDE
My step details:
1. Create SampleKeywordLibrary.jar and store it at
C:\jython2.7b4\Lib\site-packages
here is the java code

package org.robot.sample.keywords;
public class SampleKeywordLibrary {
public static final String ROBOT_LIBRARY_SCOPE = "GLOBAL";

public static final String ROBOT_LIBRARY_VERSION = "1.0.2";
private int counter = 0;
public int count() {
counter += 1;
return counter;
}

public void clearCounter() {
counter = 0;
}

public void hello(String name) {
System.out.println("Hello, " + name + "!");
}
}


2. Set Classpath= C:\jython2.7b4\Lib\site-packages\SampleKeywordLibrary.jar
3. Open RIDE and Import SampleKeywordLibrary as below
*** Settings ***
Library SampleKeywordLibrary

*** Test Cases ***
test
hello world
4. From RIDE select execution profile=jybot and run

Could anyone please help me figure out what I went wrong. Thank you.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

robotfram...@googlecode.com

unread,
May 13, 2015, 1:36:55 AM5/13/15
to robotframewo...@googlegroups.com
Updates:
Status: Pending

Comment #1 on issue 1402 by janne.t....@gmail.com: Could not import Java
Does your example work from the command line? Specifically, are you able to
run

`jybot <path/to/suite>` and get the tests passing?

It seems to me that at least the library import is wrong (Java libraries
need to be imported with FQDNs, i.e.
`org.robot.sample.keywords.SampleKeywordLibrary` in this case.

robotfram...@googlecode.com

unread,
Jun 2, 2015, 1:20:35 AM6/2/15
to robotframewo...@googlegroups.com
Updates:
Status: Invalid

Comment #2 on issue 1402 by janne.t....@gmail.com: Could not import Java
Closing due to lack of information
Reply all
Reply to author
Forward
0 new messages