Emacs Org-mode: org-agenda-custom-commands and hiding future scheduled tasks - emacs

I have set my org-agenda-custom-commands to (among others) this:
(setq org-agenda-custom-commands
`(
("x"
"Scheduled tasks with Prio"
((tags-todo "+PRIORITY={A}"
((org-agenda-overriding-header "Scheduled Prio-A TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(tags-todo "+PRIORITY={B}"
((org-agenda-overriding-header "Scheduled Prio-B TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(tags-todo "+PRIORITY={C}"
((org-agenda-overriding-header "Scheduled Prio-C TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(tags-todo "+PRIORITY={D}"
((org-agenda-overriding-header "Scheduled Prio-D TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(agenda)))
;; snip
Now I would like to hide all tasks scheduled in the future. I can do this via
(progn
(setq org-agenda-todo-ignore-scheduled 'future)
(setq org-agenda-tags-todo-honor-ignore-options t))
But this affects all of my other org-agenda-custom-commands. I would like to limit it to just one custom command.
So how can I modify my custom command so that it hides the future tasks?

The doc string for org-agenda-custome-commands says, among other things, the following:
...
settings A list of option settings, similar to that in a let form, so like
this: ((opt1 val1) (opt2 val2) ...). The values will be
evaluated at the moment of execution, so quote them when needed.
...
You can also define a set of commands, to create a composite agenda buffer.
In this case, an entry looks like this:
(key desc (cmd1 cmd2 ...) general-settings-for-whole-set files)
...
So all you need to do is add your settings at the end of the custom command:
(setq org-agenda-custom-commands
`(
("x"
"Scheduled tasks with Prio"
((tags-todo "+PRIORITY={A}"
((org-agenda-overriding-header "Scheduled Prio-A TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(tags-todo "+PRIORITY={B}"
((org-agenda-overriding-header "Scheduled Prio-B TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(tags-todo "+PRIORITY={C}"
((org-agenda-overriding-header "Scheduled Prio-C TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(tags-todo "+PRIORITY={D}"
((org-agenda-overriding-header "Scheduled Prio-D TODOs")
(org-agenda-skip-function
'(org-agenda-skip-entry-if 'unscheduled))))
(agenda))
;; settings for the above composite custom command
((org-agenda-todo-ignore-scheduled 'future)
(org-agenda-tags-todo-honor-ignore-options t)))
;; snip
;; other commands
...
))

Related

Having a problem with org-roam-dailies-capture-today

Having a problem with org-roam-dailies-... functions. My org-roam-capture-template is
(setq org-roam-dailies-capture-templates
'(
("d" "default" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d>\n\n")
("l" "lab" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d>\n"
:olp ("Lab notes"))
("j" "journal" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d>\n"
:olp ("Journal"))
("w" "words" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head "#+title: %<%Y-%m-%d>\n"
:olp ("Words"))
))
When I call org-roam-dailies-capture-today, using the 'l' (lab-notes) hotkey, it complains...
heading not found on level 1: Lab notes.
That makes perfect sense, in the context of vanilla org-capture, because the file hasn't been created yet, so it isn't going to have any headings in it. But the point of this function is to create the file. So it has to create these headings itself and then the sub-headings and then navigate to the proper location in the file.
If I create a file using the `default' template, then go in an add the other headings, then call org-roam-capture-dailies-today and use the 'l','j' or 'w' templates, it works fine.
Am I just missing something (which is entirely possible)
BTW. the 'default', 'lab','journal' entries in my capture template are copy-and-pastes out of the org-roam info file (org-roam is v1.2.3, as installed by emacs package manager from melpa (IIRC) ). The `words' template is based on those, and, as I said, works fine so long as a use the work-around discussed.
TIA
whd
p.s. I don't have the reputation to use org-roam... tags, and I need at least one tag. So, I used `emacs'. A bit vague, but what else could I do?
I don't know if you still need this. The question is 7 months old and is about org-roam v.1. But in any case.
You need to provide the headers you will use when you create the file. This can be done through the :head parameter.
(setq org-roam-dailies-capture-templates
(let ((header (concat "#+title: %<%Y-%m-%d>\n\n"
"* Lab notes\n\n"
"* Journal\n\n"
"* Words\n\n")))
`(("d" "default" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head ,header)
("l" "lab" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head ,header
:olp ("Lab notes"))
("j" "journal" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head ,header
:olp ("Journal"))
("w" "words" entry
#'org-roam-capture--get-point
"* %?"
:file-name "daily/%<%Y-%m-%d>"
:head ,header
:olp ("Words")))))

Glade as a starting point for GTK3/4/5 (instead of Gnome-Builder)

Have now spent some time coming to grips with Gnome Builder, Glade, Vala and Genie - and considering the excellent Gnome Human Interface Guidelines (GHIG) - why isn't Glade the starting point for almost all GTK GUI applications?
For example, are there any programs that will take a Glade (template) xml file and auto-generate the corresponding programmatic Vala or Genie source code? If there were standard Gtk.ApplicationWindow Glade xml files, for example, that followed the GHIG that were shipped with Glade/Gnome these could be quickly adapted for a specific project and a Genie class template with signals auto-generated - plus a full gresource/meson/flatpak structure. This would simply be imported directly into Gnome-Builder as a starting point. Has anything like this been done?
Update
The following file application.gs is auto-generated from application.ui using Genie attributes composition. Don't want to reinvent the wheel here - hence the reason for this question. The following has some fields removed but the actual file is fully complete and ready to use. The only information required in addition to the content of 'application.ui' is the resource path and ui file name. Everything is already contained within the Glade file.
/*
{PROJECT_SPACE}
'{PROJECT_NAME}' is a command line tool that will parse a glade ui
template and generate a skeleton class in the Genie language
with composite widgets. It will generate GTKTemplate, GTKChild
and GTKCallback entries.
'{PROJECT_NAME}' exists within the {PROJECT_NAMESPACE} namespace.
Copyright (C) 2018 {AUTHOR_NAME} {AUTHOR_EMAIL}
This library is free software; you can redistribute it and or
or modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (as you wish) a later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the:
Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301
USA
*/
[indent=4]
namespace {PROJECT_NAMESPACE}
[GtkTemplate (ui = "{RESOURCE_URI}/application.ui")]
class ApplicationWindow:Gtk.ApplicationWindow
[GtkChild]
application_grid:Gtk.Fixed
[GtkChild]
application_status_bar:Gtk.Statusbar
[GtkChild]
header_bar:Gtk.HeaderBar
[GtkChild]
application_button:Gtk.MenuButton
[GtkChild]
window_title:Gtk.Label
[GtkChild]
window_subtitle:Gtk.Label
[GtkChild]
tools_button:Gtk.MenuButton
[GtkChild]
application_popover:Gtk.PopoverMenu
[GtkChild]
home_menu:Gtk.Box
[GtkChild]
project_settings:Gtk.ModelButton
[GtkChild]
lateral_pressure:Gtk.ModelButton
[GtkChild]
service_life:Gtk.ModelButton
[GtkChild]
mixture_analysis:Gtk.ModelButton
[GtkChild]
general_simulation:Gtk.ModelButton
[GtkChild]
exit_application:Gtk.ModelButton
[GtkChild]
projects_menu:Gtk.Box
[GtkChild]
exit_projects:Gtk.ModelButton
[GtkChild]
new_project:Gtk.ModelButton
[GtkChild]
open_project:Gtk.ModelButton
[GtkChild]
save_project:Gtk.ModelButton
[GtkChild]
pressure_menu:Gtk.Box
[GtkChild]
exit_pressure:Gtk.ModelButton
[GtkChild]
boussinesq_3d:Gtk.ModelButton
[GtkChild]
strip_loading:Gtk.ModelButton
[GtkChild]
line_loading:Gtk.ModelButton
[GtkChild]
point_loading:Gtk.ModelButton
[GtkChild]
log_spiral:Gtk.ModelButton
[GtkChild]
service_life_menu:Gtk.Box
[GtkChild]
exit_service_life:Gtk.ModelButton
[GtkChild]
stratful_equation:Gtk.ModelButton
[GtkChild]
clear_equation:Gtk.ModelButton
[GtkChild]
relative_life:Gtk.ModelButton
[GtkChild]
diffusion_theory:Gtk.ModelButton
[GtkChild]
what_if_analysis:Gtk.ModelButton
[GtkChild]
mixture_analysis_menu:Gtk.Box
[GtkChild]
exit_mixture_analysis:Gtk.ModelButton
[GtkChild]
mixture_design:Gtk.ModelButton
[GtkChild]
volumetric_analysis:Gtk.ModelButton
[GtkChild]
particulate_analysis:Gtk.ModelButton
[GtkChild]
general_simulation_menu:Gtk.Box
[GtkChild]
exit_general_simulation:Gtk.ModelButton
[GtkChild]
construction_simulation:Gtk.ModelButton
[GtkChild]
mixture_simulation:Gtk.ModelButton
[GtkChild]
thermal_simulation:Gtk.ModelButton
[GtkCallback]
def on_exit_application_clicked( exit_application:Gtk.ModelButton )
print "Signal handler 'on_exit_application_clicked' was called ..."
[GtkCallback]
def on_new_project_clicked( new_project:Gtk.ModelButton )
print "Signal handler 'on_new_project_clicked' was called ..."
[GtkCallback]
def on_open_project_clicked( open_project:Gtk.ModelButton )
print "Signal handler 'on_open_project_clicked' was called ..."
[GtkCallback]
def on_save_project_clicked( save_project:Gtk.ModelButton )
print "Signal handler 'on_save_project_clicked' was called ..."
[GtkCallback]
def on_boussinesq_3d_clicked( boussinesq_3d:Gtk.ModelButton )
print "Signal handler 'on_boussinesq_3d_clicked' was called ..."
[GtkCallback]
def on_strip_loading_clicked( strip_loading:Gtk.ModelButton )
print "Signal handler 'on_strip_loading_clicked' was called ..."
[GtkCallback]
def on_line_loading_clicked( line_loading:Gtk.ModelButton )
print "Signal handler 'on_line_loading_clicked' was called ..."
[GtkCallback]
def on_point_loading_clicked( point_loading:Gtk.ModelButton )
print "Signal handler 'on_point_loading_clicked' was called ..."
[GtkCallback]
def on_log_spiral_clicked( log_spiral:Gtk.ModelButton )
print "Signal handler 'on_log_spiral_clicked' was called ..."
[GtkCallback]
def on_stratful_equation_clicked( stratful_equation:Gtk.ModelButton )
print "Signal handler 'on_stratful_equation_clicked' was called ..."
[GtkCallback]
def on_clear_equation_clicked( clear_equation:Gtk.ModelButton )
print "Signal handler 'on_clear_equation_clicked' was called ..."
[GtkCallback]
def on_relative_life_clicked( relative_life:Gtk.ModelButton )
print "Signal handler 'on_relative_life_clicked' was called ..."
[GtkCallback]
def on_diffusion_theory_clicked( diffusion_theory:Gtk.ModelButton )
print "Signal handler 'on_diffusion_theory_clicked' was called ..."
[GtkCallback]
def on_what_if_analysis_clicked( what_if_analysis:Gtk.ModelButton )
print "Signal handler 'on_what_if_analysis_clicked' was called ..."
[GtkCallback]
def on_mixture_design_clicked( mixture_design:Gtk.ModelButton )
print "Signal handler 'on_mixture_design_clicked' was called ..."
[GtkCallback]
def on_volumetric_analysis_clicked( volumetric_analysis:Gtk.ModelButton )
print "Signal handler 'on_volumetric_analysis_clicked' was called ..."
[GtkCallback]
def on_particulate_analysis_clicked( particulate_analysis:Gtk.ModelButton )
print "Signal handler 'on_particulate_analysis_clicked' was called ..."
[GtkCallback]
def on_construction_simulation_clicked( construction_simulation:Gtk.ModelButton )
print "Signal handler 'on_construction_simulation_clicked' was called ..."
[GtkCallback]
def on_mixture_simulation_clicked( mixture_simulation:Gtk.ModelButton )
print "Signal handler 'on_mixture_simulation_clicked' was called ..."
[GtkCallback]
def on_thermal_simulation_clicked( thermal_simulation:Gtk.ModelButton )
print "Signal handler 'on_thermal_simulation_clicked' was called ..."
construct()
print "On construction do stuff ..."
final()
print "On destruction do stuff ..."
def activate()
print "On activation do stuff ..."
def process()
print "On processing do stuff ..."
def run()
print "On run do stuff ..."
/* End of file */
For example, are there any programs that will take a Glade (template) xml file and auto-generate the corresponding programmatic Vala or Genie source code?
Forget it. Glade once had an embedded feature of generating the corresponding code that would create the UI. This is has been removed for a good reason: it makes the application code unmaintainable, as you modify generated code by hand, and if you want to change your UI you have to regenerate the source and resolve all the conflicts.
Using a UI file generated by Glade is nowadays a couple of lines of code to use GtkBuilder. I agree though that being able to insert in your code the callback with the right signature would be a plus. Maybe GNOME Builder planned to do it? You may want to check GNOME Builder developper's blog.

Unquoting in Nested Macros in Racket

Context
The language is #lang web-server/insta and this code will be generated inside a quasiquoted argument passed to response/xexpr
The Call
-> (define home 'home-page)
-> (make-navigation home "home-page")
Current Output
Note the ` backquote before ((href , (embed/url ...
'(p ((id "home-page")) (a `((href ,(embed/url home-page))) "home-page"))
Desired Output
Note that the ` is gone.
'(p ((id "home-page")) (a ((href ,(embed/url home-page))) "home-page"))
Current Code
(define (make-navigation uri label)
(define (make-id uri)
`((id ,(symbol->string uri))))
(define-syntax-rule (embed uri)
``((href ,(embed/url ,uri))))
`(p ,(make-id uri)
(a ,(embed uri)
,label)))
Problem Locus
The issue is probably with embed.
#lang racket
(define (make-navigation uri label)
(define (make-id uri)
`((id ,(symbol->string uri))))
(define-syntax-rule (embed uri)
'((href ,(embed/url uri))))
`(p ,(make-id uri)
(a ,(embed uri)
,label)))
(define home 'home-page)
(make-navigation home "home-page")
Output:
'(p ((id "home-page")) (a ((href ,(embed/url uri))) "home-page"))
UPDATE
(define (make-navigation uri label)
(define (make-id uri)
`((id ,(symbol->string uri))))
(define-syntax-rule (embed uri)
`((href ,(list 'unquote (list 'embed/url uri)))))
`(p ,(make-id uri)
(a ,(embed uri)
,label)))
(define home 'home-page)
(make-navigation home "home-page")
Output:
'(p ((id "home-page")) (a ((href ,(embed/url home-page))) "home-page"))

No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: clojure.lang.PersistentVector

Getting a java.lang.IllegalArgumentException: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: clojure.lang.PersistentVector
when i run lein test or lein repl from terminal on MAC OS X. Though lein repl works well in eclipse (with counterclockwise plugin)
My Project file is:
(defproject cmp "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[lib-noir "0.5.0"]
[compojure "1.1.5"]
[ring-server "0.2.7"]
[clabango "0.5"]
[korma "0.3.0-RC5"]
[clj-json "0.5.3"]
[mysql/mysql-connector-java "5.1.6"]
[com.taoensso/timbre "1.5.2"]
[com.taoensso/tower "1.5.1"]
[com.postspectacular/rotor "0.1.0"]
[markdown-clj "0.9.19"]
[clj-pdf "1.11.1"]
[dk.ative/docjure "1.6.0"]
[com.cemerick/friend "0.1.5"]
[ring-basic-authentication "1.0.2"]
[org.clojure/data.csv "0.1.2"]
[clojure-csv/clojure-csv "2.0.1"]
[clj-time "0.6.0"]
[log4j "1.2.15"
:exclusions
[javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri]]]
:plugins [[lein-ring "0.8.3"]]
:ring {:handler cmp.handler/war-handler
:init cmp.handler/init
:destroy cmp.handler/destroy }
:profiles {
:production {
:ring {:open-browser? false
:stacktraces? false
:auto-reload? false}}
:dev {:dependencies [[ring-mock "0.1.3"]
[ring/ring-devel "1.1.8"]]}}
:java-source-paths [["src/cmp/java"]]
:min-lein-version "2.0.0")
The entry under :java-source-paths in your project.clj is a nested vector. It should be a plain vector of strings. Try replacing
:java-source-paths [["src/cmp/java"]]
with:
:java-source-paths ["src/cmp/java"]

Apache CXF REST multipart upload, encoding exception

I want to upload a file using multipart form data and have problems with URLDecoder. The service code follows:
#POST
#Path("/document")
#Consumes(MediaType.MULTIPART_FORM_DATA)
public Response storeTravelDocument(
#Context UriInfo uriInfo,
#FormParam(value = "IDNR") String idnr,
#FormParam(value="DOCNR") String documentNr,
#FormParam(value="ISSUE_DATE") String issueDate,
#Multipart(value = "image", type="image/jpeg") InputStream pictureStream)
{..
I tested with three clients, for example rest-assured:
given().
formParam("IDNR", "A000000A").
formParam("DOCNR", "00001").
formParam("ISSUE_DATE", "14.06.2010").
multiPart("image", new File(picturePath), "image/jpeg").
expect().
statusCode(Response.Status.CREATED.getStatusCode()).
when().
post("/document");
or HttpClient:
// build mulitpart entity
MultipartEntity entity = new MultipartEntity();
entity.addPart("IDNR", new StringBody("A000000A"));
entity.addPart("DOCID", new StringBody("00001"));
entity.addPart("ISSUE_DATE", new StringBody("14.06.2010"));
FileBody fileBody = new FileBody(new File(picturePath), "image/jpeg");
entity.addPart("image", fileBody);
// build post request
String uri = System.getProperty("service.url") + "/document";
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(uri);
httpPost.setEntity(entity);
// execute request
HttpResponse response = httpClient.execute(httpPost);
int code = response.getStatusLine().getStatusCode();
// validate
assert code == Response.Status.CREATED.getStatusCode();
in all cases I receive the following exception:
in escape (%) pattern - For input string: "¬ "
at java.net.URLDecoder.decode(URLDecoder.java:192) ~[na:1.7.0_03]
at org.apache.cxf.common.util.UrlUtils.urlDecode(UrlUtils.java:55) ~[cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.common.util.UrlUtils.urlDecode(UrlUtils.java:63) ~[cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.HttpUtils.urlDecode(HttpUtils.java:81) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.FormUtils.populateMapFromMultipart(FormUtils.java:170) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processFormParam(JAXRSUtils.java:746) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.createHttpParameterValue(JAXRSUtils.java:667) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:625) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:578) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:238) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:89) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) [cxf-api-2.6.0.jar:2.6.0]
... 25 common frames omitted
2012-05-10 12:07:54,873 [http-bio-8080-exec-5] ERROR org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver - Error occurred during error handling, give up!
org.apache.cxf.interceptor.Fault: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "¬ "
at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:75) ~[cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:322) [cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122) [cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:129) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:187) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:110) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) [servlet-api.jar:na]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:166) [cxf-rt-transports-http-2.6.0.jar:2.6.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.27]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.27]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) [catalina.jar:7.0.27]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) [catalina.jar:7.0.27]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:7.0.27]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) [catalina.jar:7.0.27]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) [catalina.jar:7.0.27]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) [catalina.jar:7.0.27]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.27]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.27]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999) [tomcat-coyote.jar:7.0.27]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565) [tomcat-coyote.jar:7.0.27]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) [tomcat-coyote.jar:7.0.27]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "¬ "
at java.net.URLDecoder.decode(URLDecoder.java:192) ~[na:1.7.0_03]
at org.apache.cxf.common.util.UrlUtils.urlDecode(UrlUtils.java:55) ~[cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.common.util.UrlUtils.urlDecode(UrlUtils.java:63) ~[cxf-api-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.HttpUtils.urlDecode(HttpUtils.java:81) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.FormUtils.populateMapFromMultipart(FormUtils.java:170) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processFormParam(JAXRSUtils.java:746) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.createHttpParameterValue(JAXRSUtils.java:667) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:625) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:578) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:238) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:89) ~[cxf-rt-frontend-jaxrs-2.6.0.jar:2.6.0]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) [cxf-api-2.6.0.jar:2.6.0]
... 25 common frames omitted
I understand that CXF tries to decode my file (the picture) and throws an exception because of invalid characters, but I would like to prevent this decoding. The file should just be transmitted as a UTF-8 stream, unchanged and not decoded. Can anyone help me?
The issue got solved on the Apache CXF mailing list by Sergey Beryozkin.
To summarize it:
What happens with this declaration is that the form payload processor assumes the last parameter being just one more plain multipart/form-data parameter. When you have a 'mixed' multipart/form-data payload, containing simple String name/values pairs, alongside the binary parts, it is better to avoid using #FormParam or #Multipart annotations and only use a MultipartBody input parameter - it will provide a type-safe access to all the individual parts.
Replacing #FormParam with #Multipart should fix the issue (as an alternative to introducing MultipartBody), however the mix-up of #FormParam & #Multipart should ideally work too. This issue will be checked.
I choosed replacing #FormParam with #Multipart and this worked.