Build the grails application war file using the jenkins is failing - grails

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.

Related

Grails Interactive mode getting "Resource temporarily unavailable" error on Linux

We using Grails 2.4.5 on a project, and normally running interactive mode on our Linux machines work. I'm not sure what changed, we did not alter any java or grails configs.
java.lang.RuntimeException: Error reading input: Resource temporarily unavailable
at grails.build.logging.GrailsConsole.readLine(GrailsConsole.java:793)
at grails.build.logging.GrailsConsole.showPrompt(GrailsConsole.java:779)
at grails.build.logging.GrailsConsole.showPrompt(GrailsConsole.java:805)
at grails.build.logging.GrailsConsole$showPrompt$1.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at org.codehaus.groovy.grails.cli.interactive.InteractiveMode.showPrompt(InteractiveMode.groovy:50)
at org.codehaus.groovy.grails.cli.interactive.InteractiveMode$showPrompt.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:137)
at org.codehaus.groovy.grails.cli.interactive.InteractiveMode.run(InteractiveMode.groovy:114)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:216)
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:236)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:264)
| Error Interactive mode exited with error: Error reading input: Resource temporarily unavailable
Tried creating a new project and has the same error there too.
What's causing this? Do you see clues in the stack trace on why?

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)

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

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.

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

Jigomerge Failing in Jenkins build

Could anyone assist me with this Jigomerge error in Jenkins?
I'm sure its probably a config issue but I don't know what config to change.
Google searches showed Jira tickets that were closed with no comments on what fixed the issue.
class java.lang.RuntimeException # Failed to reset workspace !
java.lang.RuntimeException: Failed to reset workspace !
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
at SvnMergeTool.resetWorkspace(script1000004.groovy:283)
at SvnMergeTool.launchSvnMerge(script1000004.groovy:72)
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:616)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:884)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:704)
at SvnMergeTool.invokeMethod(script1000004.groovy)
at hudson.plugins.jigomerge.JigomergeBuilder.perform(JigomergeBuilder.java:101)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:692)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.build(MavenModuleSetBuild.java:864)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:620)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:462)
at hudson.model.Run.run(Run.java:1404)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Build step 'Perform svn merge with Jigomerge' changed build result to FAILURE
After finding the verbose indicator I looked at the output and noticed that the workspace that Jenkins and jigomerge were trying to update was missing part of the name. This was due to a space in the name of the folder: My CI build.
The name with spaces was seen as /root/.jenkins/My instead of /root/.jenkins/My\ CI\ build.
For this reason, the error that the file or directory did not exist was being returned, failing the merge.

Resources