I recently have a problem using the antbuilder mail task in groovy. It always throws the following exception:
[mail] Sending email: null
[mail] Failed to send email: 0
Caught: : java.lang.ArrayIndexOutOfBoundsException: 0
I think the problem just occurred with the release of the new 1.7.2 version, but I cannot be sure of it.
Here is the snippet:
ant = new AntBuilder()
ant.mail(mailhost:'localhost',mailport:'25',subject:'Hello Ant World',messagemimetype:'text/html') {
from(address:'changed#to.protect.the.innocent')
to(address:'changed#to.protect.the.innocent')
message('Hello ant world!')
}
Any idea how to get this working?
Thanks, Ingo
I found the problem was that i had GroovyWS in my classpath. See: http://jira.codehaus.org/browse/GMOD-55
Yes, you are absolutely right. By just removing that jar it works. Thanks. But since I use the groovyws lib I had to work it out with plain javax.mail code...
Related
I'm currently using Neovim 6.0. And I also use the following neovim-config : https://github.com/rafi/vim-config.
After installation, I created a python program to test and a problem encountered which are as follows:
treesitter/highlighter: Error executing lua: ...im/0.6.0/share/nvim/runtime/lua/vim/treesitter/query.lua:161: query: invalid node type at position 5622
~ pdb~ тоб Snippet [VSnip] st
I had a similar issue. I ran :TSUpdate in Neovim to update Treesitter plugin and the error message disapear after relaunching.
I just solved it using :TSInstall vim.
Actually, run :checkhealth and the error in there would help in figuring out what is missing.
Remember, in treesitter 'c', 'help', 'lua', and 'vim' are part of the core functionality of Neovim. But that means if you are seeing this error, a sure fire way to make sure they are all installed is to run:
:TSInstall c help lua vim
For me helped adding cmake to ensure_installed in the treesitter config section of .config/nvim/init.lua:
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'typescript', 'help', 'cmake' },
Configuration was based on https://github.com/nvim-lua/kickstart.nvim
We are trying to use response.outputStream in Grails 3.3.0 under Tomcat 7.0.57. However, when any bytes are written to the stream, we get this error:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/WriteListener
This seems to come from the 3.1 Servlet spec? But Tomcat 7 doesn't support 3.1, only 3.0. However, we've targeted the Grails app to the Tomcat version we are deploying to by doing this in dependencies:
provided "org.springframework.boot:spring-boot-starter-tomcat"
And this, later in the build.gradle file:
war {
ext['tomcat.version'] = '7.0.57'
}
Anything else to try?
Turns out the problem was caused by Groovy introspection upon loading the class OnCommittedResponseWrapper, which has this:
public void setWriteListener(WriteListener writeListener) {
this.delegate.setWriteListener(writeListener);
}
Adding a #GrailsCompileStatic to the method(s) which use the response outputStream in ways like this:
response.outputStream << someBytes
will avoid the introspection which then makes it work on Tomcat 7.
I have a problem with the Aptana Studio 3.
It is a fresh installation. I have imported a Ruby on Rails - project that a edited with a texteditor before. I want to use Aptana, for a more comfortable development but the Content Assist fails.
If I try to use the Content Assist it throws the following exception and write it to the Console:
[2013-03-08 16:34:40] An error occurred while processing the invoke block for the command ERb Content Assist in C:\Users\Chris\Aptana Rubles\rails.ruble\commands\content_assist.rb: (NoMethodError) undefined method `getInstance' for Java::ComAptanaIndexCore::IndexManager:Class
org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `getInstance' for Java::ComAptanaIndexCore::IndexManager:Class
at Rails::ContentAssistant.index_manager(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:87)
at Rails::ContentAssistant.gem_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:79)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:229)
at Java::JavaUtil::Collection.each(C:/Users/Chris/AppData/Local/Aptana Studio 3/plugins/org.jruby_1.6.4.1331328108/lib/ruby/site_ruby/shared/builtin/java/java.util.rb:7)
at org.jruby.RubyEnumerable.collect(org/jruby/RubyEnumerable.java:706)
at Rails::ContentAssistant.gem_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:79)
at Rails::ContentAssistant.gem_and_project_indices(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:74)
at Rails::ContentAssistant.assist(C:/Users/Chris/Aptana Rubles/rails.ruble/lib/content_assistant.rb:31)
at #<Class:0x101f95cf6>.define_content_assist(C:\Users\Chris\Aptana Rubles\rails.ruble\commands\content_assist.rb:7)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:274)
at org.jruby.RubyProc.call(org/jruby/RubyProc.java:233)
The Aptana Log File contains this message:
!ENTRY org.eclipse.ui 4 4 2013-03-08 16:34:40.465
!MESSAGE "Content Assist" did not complete normally. Please see the log for more information.
!ENTRY org.eclipse.ui 4 0 2013-03-08 16:34:40.465
!MESSAGE (Errno::EINVAL) =::
!STACK 0
org.jruby.exceptions.RaiseException: (Errno::EINVAL) =::
at org.jruby.RubyHash.replace(org/jruby/RubyHash.java:1623)
I don't know how to handle this error. Do I have to install anything else to use the Content Assist with Ruby on Rails?
I found a solution at https://jira.appcelerator.org/browse/APSTUD-2718
As a workaround:
1) Commands > Rails Bundle > Edit this Bundle will grab a copy of the
new code
This removed the error messages for me.
I have found this link, that describes my problem as "Unresolved" (reported in 12/Sep/12):
https://jira.appcelerator.org/browse/APSTUD-7406
But this is "Aptana Studio 3.2.2" and I have got Version 3.3.3, I can't believe that this problem isn't solved.
Anybody else using Aptana knowing this problem?
I'm trying to use the release 2.0.4 plugin to deploy my war through grails 2.1.1 to artifactory server.
My BuildConfig.groovy has:
grails.project.repos.snap.url = "http://server:8080/artifactory/apps-snapshot-local"
grails.project.repos.snap.username = "user"
grails.project.repos.snap.password = "password"
grails.project.repos.rel.url = "http://server:8080/artifactory/apps-release-local"
grails.project.repos.rel.username = "user"
grails.project.repos.rel.password = "password"
grails.project.repos.default = "rel"
When I just do the "grails maven-deploy" it works and deploys to my rel server as expected. When I try to override the default target through the command line I get failures.
grails maven-deploy --repository=snap
I get this:
| Done creating WAR snap
| POM generated: C:\dev-git\DBUpdateWeb\target/pom.xml.
| Error Error deploying artifact: C:\dev-git\DBUpdateWeb\target\DBUpdateWeb.war (The system cannot find the file specified)
| Error Have you specified a configured repository to deploy to (--repository argument) or specified distributionManagement in your POM?
When I do specify the --repository tag it doesn't generate a war even though it says it did. Any help is appreciated. Thanks in advance.
Try grails maven-deploy "--repository=snap".
Also, specify app.version in application.properties so that the WAR will be standard compliant (1.0-SNAPSHOT for publishing to the snapshots repository and 1.0 for releases), and comment out the grails.project.war.file line in BuildConfig.groovy.
When I create a production war (grails war --nojars) my doWithDynamicMethods is not being called in a production environment. The code works in the dev env (ie grails run-app)
Here is some of my code:
PDFFormsGrailsPlugin.groovy (in PDFForms (plugin) directory) :-
def doWithDynamicMethods = { ctx ->
println "Adding renderPDFForm to controller";
for (controllerClass in application.controllerClasses) {
updateControllers controllerClass.metaClass
}
}
BuildConfig.groovy (in Application using Plugin) :-
grails.plugin.location.'pdff-orms' = "../PDFForms"
We are using Grails 1.3.5 on Windows XP, The Build is called from STS 2.3.3.CI-R5462-B20
Thanks in advance.
Check if the plugin is referenced in your grails.xml.
Read this Nabble thread
And this jira
P.S. Why not you upgrade to grails 1.3.7 at least?!