Error generating web.xml file when running grails run-app - grails

I downloaded grails 2.0.4 and ran these commands:
grails create-app contactmanager
cd contactmanager
grails clean
grails run-app
The last command is returning with this error stack trace:
| Error Error generating web.xml file
org.apache.xml.utils.WrappedRuntimeException: org.apache.xml.serializer.ToXMLSAXHandler cannot be cast to org.apache.xml.serializer.SerializationHandler
at org.apache.xml.serializer.SerializerFactory.getSerializer(SerializerFactory.java:137)
at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:214)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:278)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.writeWebDescriptorResult(DefaultGrailsPluginManager.java:682)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.doWebDescriptor(DefaultGrailsPluginManager.java:667)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.doWebDescriptor(DefaultGrailsPluginManager.java:643)
at org.codehaus.groovy.grails.plugins.GrailsPluginManager$doWebDescriptor.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at _GrailsPackage_groovy$_run_closure5_closure10.doCall(_GrailsPackage_groovy:121)
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 com.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1231)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:226)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at _GrailsPackage_groovy$_run_closure5_closure10.doCall(_GrailsPackage_groovy)
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 .........

Did you at any point of time manipulated the jre/lib/ext directory ?
I did that to setup saml environment on weblogic. I copied these files
serializer-2.10.0.jar
xalan-2.7.1.jar
xercesImpl-2.10.0.jar
xml-apis-2.10.0.jar
xml-resolver-1.2.jar
This caused problem in xml parsing. I removed these files from jre/lib/ext and it started working. Wondering if you have the same problem.

Related

Build the grails application war file using the jenkins is failing

I have configured the jenkins job for building the grails application war file as shown in the picture. I have checked the output console i got the following error.
Output console Error: [JENKINS-7702] sanitizing $JAVA_OPTS
[workspace] $ cmd.exe /C '"G:\practice\jenkins\tools\com.g2one.hudson.grails.GrailsInstallation\grails-2.2.4\bin\grails.bat -Dgrails.work.dir=/G:/practice/jenkins/jobs/Grails-Jenkins/workspace//target clean --non-interactive --plain-output && exit %%ERRORLEVEL%%"'
Can't load log handler "1catalina.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.util.logging.LogManager$4.run(LogManager.java:808)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:802)
at java.util.logging.LogManager.addLogger(LogManager.java:1008)
at java.util.logging.LogManager$1.run(LogManager.java:209)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:181)
at java.util.logging.Logger.demandLogger(Logger.java:339)
at java.util.logging.Logger.getLogger(Logger.java:393)
at org.codehaus.groovy.runtime.DefaultGroovyMethodsSupport.<clinit>(DefaultGroovyMethodsSupport.java:33)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:96)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:73)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33)
at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:62)
at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
at groovy.lang.Closure.<init>(Closure.java:221)
at groovy.lang.Closure.<init>(Closure.java:238)
at groovy.lang.Closure$1.<init>(Closure.java:205)
at groovy.lang.Closure.<clinit>(Closure.java:205)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.<clinit>(GrailsScriptRunner.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)
Please assist me on the grails build configuration.
Refresh dependiences before compile:
clean refresh-dependencies "war target/ROOT.war"
btw we usually use field Exec command and add there custom bash script to control flow and place of generated files.
Updated:
Basing on this thread:
That looks like your logging.properties file contains invalid
settings.
or
It appears that the JMX agent is using Tomcat's logging.properties but
with the unmodified java.util.logging package from the JRE rather than
JULI from Tomcat. Can you show us what the eventual command line is
that launches Tomcat? The parameter specifying
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager looks like it's missing.

got error when run mahout cat ponut.csv

when i run
mahout cat ponut.csv
got this error
Running on hadoop, using /usr/local/bin/hadoop and HADOOP_CONF_DIR=
MAHOUT-JOB: /Users/shawn/Code/mahout/examples/target/mahout-examples-0.9-job.jar
Exception in thread "main" java.io.FileNotFoundException: donut.csv (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at org.apache.mahout.classifier.sgd.TrainLogistic.open(TrainLogistic.java:315)
at org.apache.mahout.classifier.sgd.PrintResourceOrFile.main(PrintResourceOrFile.java:36)
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.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72)
at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:145)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:153)
at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:195)
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.hadoop.util.RunJar.main(RunJar.java:212)
Mahout version is 0.9.
I run mvn install form source.
The file name is donut.csv :)
And it is present at-
examples/src/main/resources/donut.csv
You can try :
bin/mahout cat examples/src/main/resources/donut.csv

Building Kettle with Ant error: impossible to configure ivy:settings with given file

I'm trying to build Kettle5.0 with ant_1.8.2, but I'm getting this following error
D:\IDE\workspace\MyEclipse8.6\Kettle_5.0>ant
Buildfile: D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\build.xml
antcontrib.download-check:
antcontrib.download:
install-antcontrib:
build-publish-modules:
Duplicated project name in import. Project subfloor defined first in D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\build-res\subfloor.xml and again in D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\core\build-re
s\subfloor.xml
antcontrib.download-check:
antcontrib.download:
install-antcontrib:
install-ivy:
resolve-init:
clean-jars:
resolve-default.default:
No ivy:settings found for the default reference 'ivy.instance'. A default instance will be used
[ivy:resolve] :: Ivy 2.0.0-beta1 - 20071206070608 :: http://ant.apache.org/ivy/ ::
:: loading settings :: file = D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\core\ivysettings.xml
BUILD FAILED
D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\build.xml:945: The following error occurred while executing this line:
D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\build.xml:950: The following error occurred while executing this line:
D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\core\build-res\subfloor.xml:694: impossible to configure ivy:settings with given file: D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\core\ivysettings.xml :java.text
.ParseException: failed to load settings from file:/D:/IDE/workspace/MyEclipse8.6/Kettle_5.0/core/ivysettings.xml: unable to load properties from null. Tried both as an url and a file, with no success
. File exception: java.lang.NullPointerException. URL exception: java.net.MalformedURLException
at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:96)
at org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:84)
at org.apache.ivy.core.settings.IvySettings.load(IvySettings.java:369)
at org.apache.ivy.Ivy.configure(Ivy.java:395)
at org.apache.ivy.ant.IvyAntSettings.createIvyEngine(IvyAntSettings.java:246)
at org.apache.ivy.ant.IvyAntSettings.getConfiguredIvyInstance(IvyAntSettings.java:219)
at org.apache.ivy.ant.IvyTask.getIvyInstance(IvyTask.java:92)
at org.apache.ivy.ant.IvyTask.prepareTask(IvyTask.java:254)
at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:274)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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.taskdefs.Sequential.execute(Sequential.java:68)
at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
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.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at net.sf.antcontrib.logic.ForTask.doSequentialIteration(ForTask.java:259)
at net.sf.antcontrib.logic.ForTask.doToken(ForTask.java:268)
at net.sf.antcontrib.logic.ForTask.doTheTasks(ForTask.java:299)
at net.sf.antcontrib.logic.ForTask.execute(ForTask.java:244)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
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:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
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.IllegalArgumentException: unable to load properties from null. Tried both as an url and a file, with no success. File exception: java.lang.NullPointerException. URL exception: jav
a.net.MalformedURLException
at org.apache.ivy.core.settings.XmlSettingsParser.startElement(XmlSettingsParser.java:230)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:92)
... 68 more
Total time: 0 seconds
D:\IDE\workspace\MyEclipse8.6\Kettle_5.0>
I just check out kettle 5.0 with svn, and just run ant command after that.D:\IDE\workspace\MyEclipse8.6\Kettle_5.0\build.xml is exesting, I googled, but can't help. How can i deal with it~~
Here's the relevent error message:
Caused by: java.lang.IllegalArgumentException: unable to load properties from null. Tried both as an url and a file, with no success. File exception: java.lang.NullPointerException. URL exception: jav
a.net.MalformedURLException
Are you trying to load an ivy file from a URL? If so could you supply the code? I'm guessing you're doing something like the following construct:
<ivy:settings url="${mybuild.settings.url}" />
With a ANT property that is unset.

Grails 2.3.4: test-app on new app fails with "java.lang.ClassNotFoundException: org.grails.ide.eclipse.runtime.GrailsEclipseConsole"

The test-app command run with the below errors...
I'm execute the Grails on the Windows platform, the following recomended solutions ( that I found... ) doesn't help.
1. grails clean ; grails compile --refresh-dependencies
2. Deleted he data from .grails directory
Environment Variables JAVA_PATH,GRAILS_PATH, PATH defined properly.
Someone have idea how to fix this problem?
Loading Grails 2.3.4
|Configuring classpath
.
|Environment set to test
......................................
|Running without daemon...
java.lang.ClassNotFoundException: org.grails.ide.eclipse.runtime.GrailsEclipseConsole
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at grails.build.logging.GrailsConsole.createInstance(GrailsConsole.java:282)
at grails.build.logging.GrailsConsole.getInstance(GrailsConsole.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1725)
at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1140)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3461)
at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1152)
at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.getProperty(ClassMetaClassGetPropertySite.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at org.codehaus.groovy.grails.resolve.DependencyManagerConfigurer.configureIvy(DependencyManagerConfigurer.groovy:126)
at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1281)
at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1219)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1115)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1087)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1073)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy)
at grails.util.BuildSettings$loadConfig$1.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:1053)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy)
at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.initializeBuildSettings(ForkedGrailsProcess.groovy:736)
at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProjectClassExecutor.initializeProjectInstance(ForkedGrailsProjectClassExecutor.groovy:80)
at org.codehaus.groovy.grails.cli.fork.ForkedGrailsProjectClassExecutor.run(ForkedGrailsProjectClassExecutor.groovy:73)
at org.codehaus.groovy.grails.cli.fork.testing.ForkedGrailsTestRunner.main(ForkedGrailsTestRunner.groovy:76)

Grails unit test failing in GGTS 3.1 with NoClassDefFoundError error for BytecodeInterface8

I am using GGST 3.1 with a Grails 1.3.7 app. I created a unit test for a service method, and ran it successfully. (And it passed, too!) I then modified the method under test, modified the unit test, and tried to run it again. The test failed to run with the following stack trace
java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/BytecodeInterface8
at com.fxpal.querium.QuerySpecService.extractQueryFields(QuerySpecService.groovy:133)
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.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
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:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at com.fxpal.querium.QuerySpecServiceTests.testExtractQuery(QuerySpecServiceTests.groovy:18)
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 junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
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: org.codehaus.groovy.runtime.BytecodeInterface8
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 30 more
This seems similar to other instances of this error I've seen related to deploying WAR files, but in my case, I was just running a unit test through the IDE. (Not grails test-app but by selecting Run as/JUnit test from the context menu.)
What should I be trying next?
I believe this error is because (both in the war and our case) there are two groovy versions (console and IDE), trying to run the same test cases, and sometimes they are taking each others bytecode. One thing to make sure is if they are not sharing the folder where the bytecode is saved.
Something else you can try is to verify the groovy libraries are in the test's classpath, last time this happened to me, I just added them to the classpath and it run normally.
Ger

Resources