Ant fails to locate XML catalog resolver - ant

My Ant 1.8.2 build started failing with HTTP 303 responses from the W3C web site in response to requests for SVG DTDs. So I'm trying to introduce an XML Catalog to resolve them locally.
If I make no changes to the classpath, I get:
Warning: XML resolver not found; external catalogs will be ignored
If I add resolver.jar from Apache XML Commons 1.2 to the classpath (e.g. by using -lib on the ant invocation), I get
/Users/mike/..../build.xml:123: java.lang.reflect.InvocationTargetException
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:597)
at org.apache.tools.ant.types.XMLCatalog$ExternalResolver.processExternalCatalogs(XMLCatalog.java:1115)
at org.apache.tools.ant.types.XMLCatalog$ExternalResolver.resolveEntity(XMLCatalog.java:960)
at org.apache.tools.ant.types.XMLCatalog.resolveEntity(XMLCatalog.java:391)
which suggests to me that the resolver.jar I am using has been located, but doesn't have the interface that Ant is expecting.
Where should I get the correct resolver.jar to use with Ant?

I found the solution (well, a workaround...)
The InvocationTargetException turned out to be a red herring - a secondary error. The primary error was as follows: my catalog file catalog.xml contained a relative reference to a DTD catalog.dtd, and Ant (or the resolver) was failing to resolve the reference to catalog.dtd. It was looking in the directory containing my build file, not the directory containing the catalog. This is clearly a bug somewhere; my suspicion, if I were investigating further, would be that Ant is passing the catalog file to the catalog resolver with no base URI, or with an incorrect base URI, so the XML parser has to guess where to find the DTD, and guesses wrong.
My solution was to remove the reference to the DTD. After this, URIs listed in the catalog were correctly resolved to local copies. Interestingly, the references to local copies are also relative to the catalog, so it seems that the catalog resolver knows where the catalog is, but someone isn't telling Xerces at the time it is parsed.

I had the same issue, but for me, the upgrading from Ant 1.8.1 to 1.9.4 solved the problem.
My guess is that the root cause is bug 52754.
EDIT: The same issue resurfaced in a slightly different form, using JDK 1.6.0_18, with a stack trace like this:
java.lang.reflect.InvocationTargetException
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:597)
at org.apache.tools.ant.types.XMLCatalog$ExternalResolver.processExternalCatalogs(XMLCatalog.java:1116)
at org.apache.tools.ant.types.XMLCatalog$ExternalResolver.resolve(XMLCatalog.java:1007)
at org.apache.tools.ant.types.XMLCatalog.resolve(XMLCatalog.java:420)
at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:104)
at net.sf.saxon.style.XSLStylesheet.spliceIncludes(XSLStylesheet.java:754)
at net.sf.saxon.style.XSLStylesheet.preprocess(XSLStylesheet.java:676)
at net.sf.saxon.PreparedStylesheet.setStylesheetDocument(PreparedStylesheet.java:331)
at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:163)
at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:139)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.readTemplates(TraXLiaison.java:300)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.createTransformer(TraXLiaison.java:317)
at org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:178)
at org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:842)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:432)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at java.lang.String.substring(String.java:1904)
at org.apache.xml.resolver.helpers.PublicId.normalize(Unknown Source)
at org.apache.xml.resolver.Catalog.addEntry(Unknown Source)
at org.apache.tools.ant.types.resolver.ApacheCatalog.addEntry(ApacheCatalog.java:118)
at org.apache.xml.resolver.readers.OASISXMLCatalogReader.startElement(Unknown Source)
at org.apache.xml.resolver.readers.SAXCatalogReader.startElement(Unknown Source)
at org.apache.xml.resolver.readers.SAXParserHandler.startElement(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.xml.resolver.readers.SAXCatalogReader.readCatalog(Unknown Source)
at org.apache.xml.resolver.Catalog.parseCatalogFile(Unknown Source)
at org.apache.xml.resolver.Catalog.parsePendingCatalogs(Unknown Source)
at org.apache.xml.resolver.Catalog.parseCatalog(Unknown Source)
at org.apache.tools.ant.types.resolver.ApacheCatalogResolver.parseCatalog(ApacheCatalogResolver.java:118)
... 47 more
Interestingly, the error only occurred on Windows and only sporadically, maybe one time out of seven or so.
The error originates in the normalize function of the PublicId class in the Apache Resolver library.
normal.indexOf(" ") would sometimes return the wrong value. For example, if the input string was -//OASIS//ELEMENTS DITA 1.x Programming Domain//EN, the pos variable would get 50 as its value, even though the public ID string has no extra spaces whatsoever.
That leads me to think that the root cause might be somehow related to JDK bug #6967156, but I can't be sure at all, since in our case, the error was intermittent, but nothing in the bug report suggests that.

Related

Installation of "JavaScript GUI Lib" plugin fails in Jenkins

I am trying to install JavaScript GUI Lib plugin on jenkins. I am getting the following errors.
java.net.SocketTimeoutException: Read timed out
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1243)
Failed to load http://updates.jenkins-ci.org/download/plugins/ace-editor/1.1/ace-editor.hpi to C:\Program Files (x86)\Jenkins\plugins\ace-editor.jpi.tmp
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1250)
Failed to download from http://updates.jenkins-ci.org/download/plugins/ace-editor/1.1/ace-editor.hpi (redirected to: http://mirror.serverion.com/jenkins/plugins/ace-editor/1.1/ace-editor.hpi)
at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1284)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1832)"
I checked if I have access to http://updates.jenkins-ci.org/download/plugins/ace-editor/1.1/ace-editor.hpi""using curl. I was able to reach the URL.
Issue is resolved. Looks like there was a problem with restart. I downloaded the plugin and restarted Jenkins and installed it explicitly. It is working now.

i am getting "java.lang.UnsatisfiedLinkError: The specified module could not be found." in APPIUM , i want to verify toast

this is my error log:
java.lang.UnsatisfiedLinkError: The specified module could not be found.
at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:288)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
at com.sun.jna.Library$Handler.<init>(Library.java:179)
at com.sun.jna.Native.loadLibrary(Native.java:569)
at com.sun.jna.Native.loadLibrary(Native.java:544)
at net.sourceforge.tess4j.util.LoadLibs.getTessAPIInstance(Unknown Source)
at net.sourceforge.tess4j.TessAPI.<clinit>(Unknown Source)
at net.sourceforge.tess4j.Tesseract.init(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at Auto_Email.TC_10_DeleteEmail.OCR(TC_10_DeleteEmail.java:187)
at Auto_Email.TC_10_DeleteEmail.deleteEmail(TC_10_DeleteEmail.java:147)
at Auto_Email.TC_10_DeleteEmail.DeleteMail(TC_10_DeleteEmail.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
i added all JAR files following:
commons-io-2.5
jai-imageio-core-1.3.1
jna-4.4.0
jna-platform-4.4.0
jul-to-slf4j-1.7.2
lept4j-1.6.0
logback-classic-1.2.3
logback-core-1.2.3
selenium-server-standalone-2.7.0-patched-sources
slf4j-api-1.7.5
tess4j-3.4.0
please someone help me to solve this problem..
Thank you.
The error is due to not correctly referencing the required dll files in your project setup. For a tess4j project in eclipse, you may add a line to your VM argument in the run configuration, where you have put the dll files in a 'dlls' folder, and keep the folder in the project's root folder, in your eclipse workspace :
-Djna.library.path=${workspace_loc:/name_of_your_project}/dlls
The dll files are gsdll64.dll, liblept168.dll and libtesseract302.dll for a 64 bit runtime. The dll files are already bundled in the tess4j jar in the win32 folder, that you may extract and add to your own dll folder as mentioned above already.

maven build fails with message in Jenkins

I am running a Jenkins server version 2.36, and intermittently, I am getting these failures when building a maven project:
I searched around, there are many experiencing this problem, but no one really knows what is causing it. Any ideas?
The error is the following:
ERROR: Aborted Maven execution for InterruptedIOException
java.net.SocketTimeoutException: Accept timed out
at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at hudson.maven.AbstractMavenProcessFactory$SocketHandler$AcceptorImpl.accept(AbstractMavenProcessFactory.java:213)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:320)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:295)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:254)
at hudson.remoting.UserRequest.perform(UserRequest.java:121)
at hudson.remoting.UserRequest.perform(UserRequest.java:49)
at hudson.remoting.Request$2.run(Request.java:324)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)
at ......remote call to Channel to /10.0.9.100(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1537)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:822)
at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:256)
at hudson.maven.$Proxy66.accept(Unknown Source)
at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:282)
at hudson.maven.ProcessCache.get(ProcessCache.java:236)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:798)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1729)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
You can try to disable IPv6 by adding -Djava.net.preferIPv4Stack=true to jenkins.xml arguments tag.
I've found that this seems to be caused by some kind of memory and/or CPU usage problem. I was repeatedly getting this error message whilst building my maven application through jenkins whilst on a t2.micro ec2-instance on AWS.
The solution was to change my instance from t2.micro to t2.medium (small may have worked but untested). Not the best solution I'm sure, but I think the error stems from CPU maxing capacity - which was the one consistent factor when this issue occurred.

attempting to unit test and something with RoboGuice.newDefaultRoboModule() is failing with Roboguice 2.0b3 and Robolectric

I've been looking at the astroboy example code and documentation for RoboGuice 2, and I'm honestly stumped. I hope you all can help me out with things to try. The goal here is to test the module to make sure it's loading and that the IoC is working / wired up.
I have a test that is similar to their example:
http://code.google.com/p/roboguice/source/browse/astroboy/src/test/java/org/roboguice/astroboy/controller/Astroboy2Test.java?name=roboguice-2.0b3&r=ba37ef680410c64f7f1fe90f5b7b482958d276b5
Mine is different in two way... My module is in a library class, which is identical by syntax:
public class MyTestModule extends AbstractModule {
#Override
protected void configure() {
bind(Vibrator.class).toInstance(vibratorMock);
}
}
I also have the roboguice.xml in the library class in the value folder
<resources>
<string-array name=roboguice_modules>
<item>com.yourdomain.MyTestModule</item>
</string-array>
<resources>
The test project references the the app project, which references and exports the library project.
In the test project it's like so:
#RunWith(RobolectricTestRunner.class)
public class MyTest {
#Before
public void setup() {
// Override the default RoboGuice module
RoboGuice.setBaseApplicationInjector(Robolectric.application, RoboGuice.DEFAULT_STAGE, Modules.override(RoboGuice.newDefaultRoboModule(Robolectric.application)).with(new MyTestModule()));
}
During the setup, it always errors with some kind of null exception. I've broken this out, and specifically with the newDefaultRoboModule method. I know that Robolectric.application is not null, and I know that new MyTestModule is not null either. Although when stepping through the debugger, I found that MyTestModule.binder is null, so I don't know if that's an issue.
the error stack trace:
java.lang.NoClassDefFoundError: javax/inject/Provider
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at javassist.Loader.findClass(Loader.java:379)
at com.xtremelabs.robolectric.bytecode.RobolectricClassLoader.findClass(RobolectricClassLoader.java:72)
at javassist.Loader.loadClass(Loader.java:311)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.xtremelabs.robolectric.bytecode.RobolectricClassLoader.loadClass(RobolectricClassLoader.java:49)
at roboguice.RoboGuice.newDefaultRoboModule(RoboGuice.java:144)
at test.yourdomain.MyTest.setup(MyTest.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at com.xtremelabs.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:284)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
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: javax.inject.Provider
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at javassist.Loader.delegateToParent(Loader.java:428)
at javassist.Loader.loadClassByDelegation(Loader.java:406)
at javassist.Loader.loadClass(Loader.java:308)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.xtremelabs.robolectric.bytecode.RobolectricClassLoader.loadClass(RobolectricClassLoader.java:49)
... 36 more
Where else should I look? I feel lost at how all this binds via testing.
Thanks for looking,
Kelly
I needed to include the javax.inject.jar from the guice 3.0 zip with my roboguice 2.0 setup.
https://github.com/google/guice/wiki/Guice30
The Roboguice project has a robolectric test in the sample application. Check it out in the source. I am using the same approach and it works just fine for me.
I would definitely suggest to upgrade to 2.x of Roboguice soon. Latest with the release..

jgrapht-jdk1.6 "HelloJGraphT.java" compilation problem

JGraphT package includes some examples to experiment oneself. HelloJGraphT.java is one of them. I can run it, without any error, in Netbeans6.0.1. But, when i use dos command prompt in the following way:
javac -cp jgrapht-jdk1.6.jar HelloJGraphT.java
it compiles. But, if i run it using:
java HelloJGraphT
it gives the following errors:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jgrapht/Graph
Caused by: java.lang.ClassNotFoundException: org.jgrapht.Graph
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Any clue?
I'm using jdk 1.6
You need to import the JGraphT library to your project.

Resources