Getting class not found exception

4 views
Skip to first unread message

super fan 911

unread,
Oct 27, 2009, 3:03:57 PM10/27/09
to tellurium-users
I'm getting this error, see stack trace:

java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.tellurium.bootstrap.TelluriumSupport.class$
(TelluriumSupport.groovy)
at org.tellurium.bootstrap.TelluriumSupport.$get$$class$org$tellurium
$framework$TelluriumFrameworkMetaClass(TelluriumSupport.groovy)
at org.tellurium.bootstrap.TelluriumSupport.addSupport
(TelluriumSupport.groovy:17)
at org.tellurium.test.java.TelluriumJavaTestCase.setUpForClass
(TelluriumJavaTestCase.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.junit.internal.runners.ClassRoadie.runBefores(ClassRoadie.java:
49)
at org.junit.internal.runners.ClassRoadie.runProtected
(ClassRoadie.java:36)
at org.junit.internal.runners.JUnit4ClassRunner.run
(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run
(JUnit4TestReference.java:46)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException:
org.tellurium.builder.SelectMenuBuilder
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.codehaus.groovy.runtime.callsite.CallSiteClassLoader.loadClass
(CallSiteClassLoader.java:51)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
org.codehaus.groovy.reflection.ClassLoaderForClassArtifacts.loadClass
(ClassLoaderForClassArtifacts.java:43)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at java_lang_Class$forName.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:125)
at org.tellurium.config.TelluriumConfigurator
$_configUiObjectBuilder_closure1.doCall(TelluriumConfigurator.groovy:
113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.reflection.CachedMethod.invoke
(CachedMethod.java:86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod
(ClosureMetaClass.java:272)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at groovy.lang.Closure.call(Closure.java:280)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry
(DefaultGroovyMethods.java:2031)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each
(DefaultGroovyMethods.java:1188)
at org.codehaus.groovy.runtime.dgm$109.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite
$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:
307)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call
(PogoMetaMethodSite.java:63)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:125)
at org.tellurium.config.TelluriumConfigurator.configUiObjectBuilder
(TelluriumConfigurator.groovy:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite
$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:
266)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent
(PogoMetaMethodSite.java:51)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent
(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent
(AbstractCallSite.java:143)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent
(AbstractCallSite.java:151)
at org.tellurium.config.TelluriumConfigurator.config
(TelluriumConfigurator.groovy:191)
at org.tellurium.config.Configurator$config.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
(AbstractCallSite.java:125)
at org.tellurium.framework.TelluriumFramework.<init>
(TelluriumFramework.groovy:73)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.codehaus.groovy.reflection.CachedConstructor.invoke
(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite
$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:
107)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor
(CallSiteArray.java:52)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor
(AbstractCallSite.java:192)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor
(AbstractCallSite.java:196)
at org.tellurium.framework.TelluriumFrameworkMetaClass.<clinit>
(TelluriumFrameworkMetaClass.groovy:11)
... 19 more



this is my test class,

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.tellurium.test.java.TelluriumJavaTestCase;


public class SampleGroovyJavaTest extends TelluriumJavaTestCase {

public SampleGroovyJavaTest() {}

@BeforeClass
public static void initUi() {
}

@AfterClass
public static void tearDownAfterClass() throws Exception {
}

@Before
public void setUp() throws Exception {
}

@After
public void tearDown() throws Exception {
}

@Test
public void testNothing() throws Exception {

}

}

I made sure that the JAR that contains the
"org.tellurium.builder.SelectMenuBuilder" class is in the class path.

Jian Fang

unread,
Oct 27, 2009, 3:10:56 PM10/27/09
to telluri...@googlegroups.com
Make sure you have the builder wired in TelluriumConfig.groovy file.

uiobject{
        builder{
            //user can specify custom UI objects here by define the builder for each UI object
            //the custom UI object builder must extend UiObjectBuilder class
            //and implement the following method:
            //
            // public build(Map map, Closure c)
            //
            //For container type UI object, the builder is a bit more complicated, please
            //take the TableBuilder or ListBuilder as an example

            //example:
           SelectMenu="org.tellurium.builder.SelectMenuBuilder"

super fan 911

unread,
Oct 27, 2009, 3:25:55 PM10/27/09
to tellurium-users
It is already in the TelluriumConfig.groovy file, here is my file:

/**
* The global place to Tellurium configuration
*
* @author Jian Fang (John.Ji...@gmail.com)
*
* Date: Aug 2, 2008
*
*/

tellurium{
//embedded selenium server configuration
embeddedserver {
//port number
port = "4444"
//whether to use multiple windows
useMultiWindows = false

//whether to run the embedded selenium server. If false, you need to
manually set up a selenium server
runInternally = true
//runInternally = false

//the log file for selenium server
// logFile = "selenium.log"
//profile location
profile = "/Users/xyz/firefox_profiles/ff3_winxp"
//user-extension.js file
userExtension = ""
}
//event handler
eventhandler{
//whether we should check if the UI element is presented
checkElement = true
//wether we add additional events like "mouse over"
extraEvent = true
}
//data accessor
accessor{
//whether we should check if the UI element is presented
checkElement = false
}
//the configuration for the connector that connects the selenium
client to the selenium server
connector{
//selenium server host
//please change the host if you run the Selenium server
remotely
serverHost = "localhost"
//server port number the client needs to connect
port = "4444"
//base URL
baseUrl = "http://localhost:8080"
//Browser setting, valid options are
// *firefox [absolute path]
// *iexplore [absolute path]
// *chrome
// *iehta

browser = "*chrome"


//user's class to hold custom selenium methods associated with
user-extensions.js
//should in full class name, for instance,
"org.tellurium.test.MyCommand"
customClass = ""
}
datadriven{
dataprovider{
//specify which data reader you like the data provider to
use
//the valid options include "PipeFileReader",
"CVSFileReader" at this point
reader = "PipeFileReader"
}
}
test{
//at current stage, the result report is only for tellurium
data driven testing
//we may add the result report for regular tellurium test case
result{
//specify what result reporter used for the test result
//valid options include "SimpleResultReporter",
"XMLResultReporter", and "StreamXMLResultReporter"
reporter = "XMLResultReporter"
//the output of the result
//valid options include "Console", "File" at this point
//if the option is "File", you need to specify the file
name, other wise it will use the default
//file name "TestResults.output"
output = "Console"
//test result output file name
filename = "TestResult.output"
}
exception{
//whether Tellurium captures the screenshot when exception
occurs.
//Note that the exception is the one thrown by Selenium
Server
//we do not care the test logic errors here
captureScreenshot = true
//we may have a series of screenshots, specify the file
name pattern here
//Here the ? will be replaced by the timestamp and you
might also want to put
//file path in the file name pattern
filenamePattern = "Screenshot?.png"
}
}
uiobject{
builder{
//user can specify custom UI objects here by define the
builder for each UI object
//the custom UI object builder must extend UiObjectBuilder
class
//and implement the following method:
//
// public build(Map map, Closure c)
//
//For container type UI object, the builder is a bit more
complicated, please
//take the TableBuilder or ListBuilder as an example

//example:
SelectMenu="org.tellurium.builder.SelectMenuBuilder"

ClickableRadioButton="org.tellurium.builder.ClickableRadioButtonBuilder"
}
}
widget{
module{
//define your widget modules here, for example Dojo or
ExtJs
// included="dojo, extjs"
included=""

Jian Fang

unread,
Oct 27, 2009, 3:30:38 PM10/27/09
to telluri...@googlegroups.com
Still looks like a class path issue. Put a breakpoint at the following line and see if you can load up the class.

       at org.tellurium.config.
TelluriumConfigurator.configUiObjectBuilder
(TelluriumConfigurator.groovy:112)

super fan 911

unread,
Oct 27, 2009, 7:01:52 PM10/27/09
to tellurium-users
OK. I got it to work with a workaround. But, would like to know how
to fix it.

I commented out these lines from the TelluriumConfig.groovy file, and
it started to work. Like I said initially, the tellurium jar is in my
classpath, so i don't know why including those 2 lines will cause it
to bomb out.

//SelectMenu="org.tellurium.builder.SelectMenuBuilder"
//
ClickableRadioButton="org.tellurium.builder.ClickableRadioButtonBuilder"

On Oct 27, 12:30 pm, Jian Fang <john.jian.f...@gmail.com> wrote:
> Still looks like a class path issue. Put a breakpoint at the following line
> and see if you can load up the class.
>
>        at org.tellurium.config.
> TelluriumConfigurator.configUiObjectBuilder
> (TelluriumConfigurator.groovy:112)
>
> On Tue, Oct 27, 2009 at 3:25 PM, super fan 911 <superfan...@yahoo.com>wrote:
>
>
>
> > It is already in the TelluriumConfig.groovy file,  here is my file:
>
> > /**
> >  * The global place to Tellurium configuration
> >  *
> >  * @author Jian Fang (John.Jian.F...@gmail.com)
> ...
>
> read more »

John

unread,
Oct 27, 2009, 7:45:29 PM10/27/09
to tellurium-users
Sorry, tellurium core jar file does not include the SelectMenu class
and it is an example on how to create custom UI objects in the
reference projects.
Thus, it only exists in the reference projects.

You should comment out the two lines.

Thanks,

Jian
> ...
>
> read more »
Reply all
Reply to author
Forward
0 new messages