Archive for the ‘General’ Category
SizeLimitExceededException: the request was rejected because its size (…) exceeds the configured maximum
Stacktrace
On deploying a WAR in Tomcat:
[java]org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (128938160) exceeds the configured maximum (52428800)[/java]
Quick fix
Edit the file $CATALINA_HOME/webapps/manager/WEB-INF/web.xml
Replace the block
[xml] <multipart-config>
<!– 50MB max –>
<max-file-size>52428800</max-file-size>
<max-request-size>52428800</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config> [/xml]
with:
[xml] <multipart-config>
<!– 200 MB max –>
<max-file-size>209715200</max-file-size>
<max-request-size>209715200</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
[/xml]
Mount a shared drive with VirtualBox
Case
You have to share some content between the host (eg: Linux Mint) and the resident (eg: Windows 7) systems, with Virtual Box.
Solution
- In the resident system, go to Virtual Box, then:
Machine>Settings> SharedFolders> on the right:Add> checkautomountandpermanent, browse to the folder, let’s sayD:\sharedFolder - Launch the VM.
- Execute a terminal in host system:
- Grant rights of group
vboxsfto usermint:
sudo gpasswd -a mint vboxsf
- Create a “local” folder:
mkdir ~/sharedFolder
- Mount the folder
sharedFolderon/home/:
sudo mount -t vboxsf -o uid=1000,gid=1000 sharedFolder ~/sharedFolder
Conférence Devoxx: « 42 IntelliJ IDEA tips in 45 minutes »
JetBrains, le studio russe éditeur de notre IDE préféré IntelliJ IDEA, était présent en force cette année à Devoxx. Outre un stand où il était possible de discuter avec deux développeurs de l’IDE, JetBrains a animé deux conférences.
A vrai dire, j’étais un peu réticent à l’idée d’assister à la conférence de Hadi Hariri (@hhariri, blog): une conférence au titre similaire l’année dernière m’avait laissé sur ma faim, m’apprenant peu de chose. Le compère de Hadi m’a convaincu de faire l’effort. Eh bien je n’ai pas été déçu.
Hadi a présenté plusieurs dizaines de tips et raccourcis clavier. En voici quelques uns que j’ai appris durant la conférence:
- tout le monde connait le classique
Ctrl–Nouvrant une classe. L’astuce consiste, avecCtrl–N(et de manière similaire avecCtrl–Shift–N) à rajouter “:<numéro de ligne>” en suffixe à la classe à ouvrir : celle-ci s’ouvrira au numéro de ligne indiqué, par exemple:Ctrl–N>CHM:12ouvrira ConcurrentHashMap en ligne 12. - Désactiver la navigation bar (View > Navigation Bar). Cela permet, via un
Ctrl-Home, d’afficher à tout instant la barre de navigation en restant dans la fenêtre d’édition. Ctrl-Shift-Epermet de restreindre l’application deCtrl-Eaux fichier récemment édités.Ctrl-Shift-F7permet, dans le cas général, de mettre en surbrillance les occurrences d’un champ, d’une variable ou d’une méthode. En appliquantCtrl-Shift-F7sur unreturnou unthrow, respectivement tous les points de sortie de la méthode ou de levée d’exception seront surlignés.Shift-F4permet d’externaliser une fenêtre, c’est-à-dire de la rendre flottante et indépendante du reste de l’IDE- Symétriquement à
Ctrl-Wqui étend la sélection,Ctrl-Shift-Wla réduit Ctrl-Alt-Shift-Jpasse l’éditeur en mode multi-caret: ce mode permet d’effectuer des opérations sur plusieurs lignes en même temps, mais pas forcément sur la même colonne. Le mode colonne (Alt-Shift-Insert) apparait ainsi comme une application restreinte du mode multi-caret.- Dans un fichier HTML, en tapant par exemple
table>tr>td, IDEA complétera le code en<table><tr><td></td></tr></table>(toutefois il semblerait que cette fonctionnalité soit liée au plugin Zen-coding). Shift, Shift: c’est le “raccourci ultime” vers la recherche sur tout ce qui existe dans IDEA
En conclusion, IntelliJ IDEA confirme son statut de Rolls des outils de développement Java, dont la maitrise complète s’acquière par des années de pratique et d’exploration.
Conférence Devoxx: Introduction aux Google Glass
J’ai eu la chance d’assister à l’édition 2014 de Devoxx FR.
La première conférence que j’ai suivie était “Introduction aux Google Glass”, par Alain Régnier (@AltoLabs, +AlainRegnier), dont voici un résumé:
Alain fait partie d’un programme, les Google Glass Explorers, c’est-à-dire les heureux élus qui ont pu se procurer des paires de lunettes Google Glass. Théoriquement, seuls les résidents nord-américains peuvent souscrire au programme ; néanmoins, l’estimation du nombre de Google Glass circulant en France oscille entre 30 et 50 paires.
A mi-chemin entre des lunettes Star Trek et des scouters de Dragon Ball, les Google Glass ressemblent à des lunettes classiques dont l’une des branche est plus épaisse et dont un verre est surmonté d’un prisme et d’une mini-webcam. Le petit bijou de technologie embarque, sous le capot, de nombreux capteurs et connecteurs: visuel, sonore, bluetooth, wifi, et même infrarouge.
Les Google Glass affichent par défaut des informations de quatre types: texte, image, vidéo et une version limitée d’HTML. Elles sont contrôlables de plusieurs façons: à la voix (en lançant le mot magique “OK Glass!”), via un trackpad, une application “web” MyGlassWeb ou enfin une appli Android MyGlassMobile.
En tant qu’outil de développement, un Android Screen Monitor (un simple client ADB) permet d’afficher sur l’écran du PC ce qui est visible par la personne portant les Google Glass: en d’autres termes, le flux de la webcam sur lequel est superposé l’affichage du prisme.
Concernant le développement proprement dit, trois méthodes sont disponibles:
- Mirror API: les Glass communiquent avec un serveur hébergé par Google, qui redirige vers un serveur concret
- GDK: il s’agit d’un kit de développement similaire à celui d’Android
- WearScript: c’est une librairie, non-officielle, permettant de programmer les Glass en JavaScript
Alain a réalisé une démonstration d’utilisation des Glass. Avouons-le: c’est bluffant… En tant que développeur, les perspectives ouvertes par un tel objet connecté sont très enthousiasmantes! Le plus dur va encore être d’attendre que les Glass soient officiellement disponibles dans nos contrées européennes…
[DevoxxFR2013] Soon, in a Galaxy Not So Far Away: Real-Time Web with Play 2, Akka, and Spaceships
Lecturer
Mathieu Ancelin is a software engineer at SERLI, specializing in Java EE technologies with a particular focus on component frameworks. He contributes to open-source projects such as GlassFish, JOnAS, and leads initiatives like CDI-OSGi and Play CDI. A member of the JSR 346 expert group for CDI 1.1, Ancelin regularly teaches at the University of La Rochelle and Poitiers, and speaks at conferences including JavaOne and Solutions Linux. He is active in the Poitou-Charentes JUG and can be followed on Twitter as @TrevorReznik.
Abstract
Mathieu Ancelin demystifies Play 2’s real-time capabilities, answering the perennial question: “WTF are Iteratees?” Through live demonstrations of two playful applications—a multiplayer spaceship battle and a real-time roulette game—he showcases how Play 2 leverages Iteratees, Akka actors, Server-Sent Events (SSE), WebSockets, HTML5 Canvas, and even webcam input to build responsive, interactive web experiences. The session explores how these APIs integrate seamlessly with Java and Scala, enabling developers to create low-latency, event-driven systems using their preferred language. Beyond the fun, Ancelin analyzes architectural patterns for scalability, backpressure handling, and state management in real-time web applications.
Demystifying Iteratees: Functional Streams for Non-Blocking I/O
Ancelin begins by addressing the confusion surrounding Iteratees, a functional reactive programming abstraction in Play 2. Unlike traditional imperative streams, Iteratees separate data production, processing, and consumption, enabling composable, backpressure-aware pipelines.
val enumeratee: Enumeratee[Array[Byte], String] = Enumeratee.map[Array[Byte]].apply[String] { bytes =>
new String(bytes, "UTF-8")
}
This allows safe handling of chunked HTTP input without blocking threads. When combined with Enumerators (producers) and Enumeratees (transformers), they form robust data flows:
val socket: WebSocket[JsValue, JsValue] = WebSocket.using[JsValue] { request =>
val in = Iteratee.foreach[JsValue](msg => actor ! msg).map(_ => actor ! PoisonPill)
val out = Enumerator.fromCallback1(_ => futurePromise.future)
(in, out)
}
Ancelin demonstrates how this pattern prevents memory leaks and thread exhaustion under load.
Akka Actors: Coordinating Game State and Player Actions
The spaceship game uses Akka actors to manage shared game state. A central GameActor maintains positions, velocities, and collisions:
class GameActor extends Actor {
var players = Map.empty[String, Player]
val ticker = context.system.scheduler.schedule(0.millis, 16.millis, self, Tick)
def receive = {
case Join(id, out) => players += (id -> Player(out))
case Input(id, thrust, rotate) => players(id).update(thrust, rotate)
case Tick => broadcastState()
}
}
Each client connects via WebSocket, sending input events and receiving rendered frames. The actor model ensures thread-safe updates and natural distribution.
Real-Time Rendering with Canvas and Webcam Integration
The game renders on HTML5 Canvas using client-side JavaScript. Server pushes state via SSE or WebSocket; client interpolates between ticks for smooth 60 FPS animation.
A bonus feature uses getUserMedia() to capture webcam input, mapping head tilt to ship rotation—an engaging demo of sensor fusion in the browser.
navigator.getUserMedia({ video: true }, stream => {
video.src = URL.createObjectURL(stream);
tracker.on('track', event => sendRotation(event.data.angle));
});
Play Roulette: SSE for Unidirectional Live Updates
The second demo, Play Roulette, uses Server-Sent Events to broadcast spin results to all connected clients:
def live = Action {
Ok.chunked(results via EventSource()).as("text/event-stream")
}
Clients subscribe with:
const es = new EventSource('/live');
es.onmessage = e => updateWheel(JSON.parse(e.data));
This pattern excels for broadcast scenarios—news feeds, dashboards, live sports.
Language Interoperability: Java and Scala Working Together
Ancelin emphasizes Play 2’s dual-language support. Java developers use the same APIs via wrappers:
public static WebSocket<JsonNode> socket() {
return WebSocket.withActor(GameActor::props);
}
This lowers the barrier for Java teams adopting reactive patterns.
Architecture Analysis: Scalability, Fault Tolerance, and Deployment
The system scales horizontally using Akka clustering. Game instances partition by room; a load balancer routes WebSocket upgrades. Failure recovery leverages supervisor strategies.
Deployment uses Play’s dist task to generate start scripts. For production, Ancelin recommends Typesafe ConductR or Docker with health checks.
Implications for Modern Web Applications
Play 2’s real-time stack enables:
– Low-latency UX without polling
– Efficient resource use via non-blocking I/O
– Graceful degradation under load
– Cross-language development in polyglot teams
From games to trading platforms, the patterns apply broadly.
Links:
(long tweet) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ at line 1
Stacktrace
[java]org.hibernate.tool.hbm2ddl.SchemaExport – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ at line 1[/java]
Quick fix
In JPA configuration, replace:
datasource.dialect = org.hibernate.dialect.MySQLInnoDBDialect
with:
datasource.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
Actually, Java driver for MySQL 5.5+ is not backward compatible with the SQL dialect MySQLInnoDBDialect.
(long tweet) Run MS-DOS command as super user
How to run a MS-DOS command terminal with administrator priviledges, in Windows 7?
Let’s say you need execute cmd with the account admin: launch runas /user:admin cmd.
Windows will ask you to enter the admin password and then will open a CMD prompt in admin mode.
[DevoxxFR2013] Between HPC and Big Data: A Case Study on Counterparty Risk Simulation
Lecturers
Jonathan Lellouche is a specialist in financial risk modeling, focusing on computational challenges at the intersection of high-performance computing and large-scale data processing.
Adrien Tay Pamart contributes to quantitative finance, developing simulations that balance accuracy with efficiency in volatile markets.
Abstract
Jonathan Lellouche and Adrien Tay Pamart examine counterparty risk simulation in market finance, where modeling asset variability demands intensive computation and massive data aggregation. They dissect a hybrid architecture blending HPC for Monte Carlo paths with big data tools for transactional updates and what-if analyses. Through volatility modeling, scenario generation, and incremental processing, they demonstrate achieving real-time insights amid petabyte-scale inputs. The study evaluates trade-offs in precision, latency, and cost, offering methodologies for similar domains requiring both computational depth and data agility.
Counterparty Risk Fundamentals: Temporal and Probabilistic Dimensions
Lellouche introduces counterparty risk as the potential loss from a trading partner’s default, amplified by market fluctuations. Simulation necessitates modeling time—forward projections of asset prices—and uncertainty via stochastic processes. Traditional approaches like Black-Scholes assume log-normal distributions, but real markets exhibit fat tails, requiring advanced techniques like Heston models for volatility smiles.
The computational burden arises from Monte Carlo methods: generating thousands of paths per instrument, each path a sequence of simulated prices. Pamart explains path dependence in instruments like barriers, where historical values influence payoffs, escalating memory and CPU demands.
Architectural Hybrid: Fusing HPC with Big Data Pipelines
The system partitions workloads: HPC clusters (CPU/GPU) compute raw scenarios; big data frameworks (Hadoop/Spark) aggregate and query. Lellouche details GPU acceleration for path generation, leveraging CUDA/OpenCL for parallel stochastic differential equations:
def simulate_paths(S0, r, sigma, T, steps, paths):
dt = T / steps
dW = np.random.normal(0, np.sqrt(dt), (paths, steps))
S = S0 * np.exp(np.cumsum((r - 0.5 * sigma**2) * dt + sigma * dW, axis=1))
return S
Big data handles post-processing: MapReduce jobs compute exposures, aggregating across scenarios for expected positive exposure (EPE).
Incremental Processing and What-If Analysis: Efficiency in Volatility
Batch recomputation proves untenable for intraday updates. Pamart introduces incremental techniques: delta updates recompute only affected paths on market shifts. What-if simulations—hypothetical trades—leverage precomputed scenarios, overlaying perturbations.
This demands transactional big data stores like HBase for rapid inserts/queries. The duo analyzes latency: sub-second for deltas versus hours for full runs.
Volatility Modeling: From Simple Diffusions to Complex Stochastics
Basic Brownian motion suffices for equities but falters in options. Lellouche advocates local volatility models, calibrating to implied surfaces for accurate pricing. Calibration involves solving inverse problems, often via finite differences accelerated on GPUs.
Pamart warns of model risk: underestimating tails leads to underestimated exposures. Hybrid models blending stochastic volatility with jumps capture crises better.
Cost and Scalability Trade-offs: Cloud vs. On-Premises
On-premises clusters offer control but fixed costs; cloud bursts for peaks. Fonrose-like spot instances (though not directly cited) could slash expenses for non-urgent simulations. The lecturers evaluate AWS EMR for MapReduce, GPU instances for paths.
Implications: hybrid clouds optimize, but data gravity—transferring terabytes—incurs latency and fees.
Future Directions: AI Integration and Regulatory Compliance
Emerging regulations (Basel III) mandate finer-grained simulations, amplifying data volumes. Lellouche speculates on ML for path reduction or anomaly detection.
The case underscores HPC-big data synergy: computation generates insights; data platforms deliver them actionably.
Links:
[DevoxxBE2013] Flyway: The Agile Database Migration Framework for Java
Axel Fontaine, a software development consultant and creator of Flyway, advocates for disciplined database schema evolution in agile environments. Based in Munich and passionate about continuous delivery, Axel presents Flyway as a lightweight solution to the chaos of ad-hoc migrations. His session, spanning 30 minutes of dense insights, covers Flyway’s mechanics, integration strategies, and recipes for complex changes, drawing from his three-year journey building the tool.
Flyway transforms migrations into versioned SQL scripts, ensuring traceability and repeatability. Axel demonstrates seamless Maven and Gradle plugins, embedding migrations in CI/CD pipelines for zero-downtime deployments.
Tackling Ad-Hoc Migration Challenges
Axel exposes the pitfalls of manual updates: uncertainty about applied changes, script sequencing errors, and application-database mismatches. Flyway counters with a schema history table, tracking versions automatically.
This audit trail, Axel illustrates, restores confidence, allowing teams to query migration status effortlessly.
Core Mechanics and Integration
Flyway’s simplicity shines: place versioned SQL files in a classpath directory, invoke via flyway:migrate. Axel demos Maven integration, applying scripts in order, rolling back if needed.
For Java, callbacks enable pre/post hooks, like data validation. Gradle and Ant support extend reach, fitting diverse build ecosystems.
Handling Complex Schema Changes
Complex alterations, like column renames, demand caution. Axel outlines a three-step recipe: add new columns with defaults, migrate data via triggers, then drop legacy structures—detailed in Refactoring Databases.
This methodical approach, he emphasizes, minimizes risks, preserving data integrity during transitions.
Future Horizons and Adoption
Axel previews Flyway’s roadmap: SBT support, Android/SQLite extensions, and web framework integrations for streamlined workflows. He urges adopting any migration tool—Flyway or alternatives—to conquer this perennial challenge.
GitHub hosts the project, inviting contributions to evolve this essential agile companion.
Links:
[DevoxxFR2013] Play Framework vs. Grails Smackdown: A Head-to-Head Comparison Through Real-World Development
Lecturers
James Ward is a professional software developer since 1997, currently at AWS, dedicated to helping teams build effective applications. With experience across mountains of code and literal peaks, he shares discoveries through presentations, blogs, and demos. Previously a Technical Evangelist at Adobe and Typesafe, he focuses on scalable, reactive systems.
Matt Raible is a Java Champion and Developer Advocate, renowned for building web apps since the web’s dawn. Founder of AppFuse, author of Spring Live, and committer on Apache Roller and Struts, he has spoken globally on open-source adoption. His roles span UI Architect at LinkedIn, Evite.com, Time Warner Cable, and Oracle, emphasizing practical, performant solutions.
Abstract
James Ward and Matt Raible pit Play Framework against Grails in a comparative showdown, building identical “UberTracks” apps to evaluate productivity, performance, and ecosystem. Through lines of code, deployment simplicity, and scalability benchmarks, they dissect strengths: Grails’ convention-driven ORM versus Play’s reactive, stateless design. The session weighs server-side rendering, JavaScript integration, and backward compatibility, offering developers empirical guidance for framework choice in modern JVM web development.
Origins of the Smackdown: Hype Meets Hands-On Evaluation
Ward and Raible conceived this comparison amid hype surrounding full-stack JVM frameworks. Grails, leveraging Groovy’s conciseness, had dominated rapid development; Play, with Scala/Java options, promised superior performance and reactivity.
They built UberTracks—a music tracking app with user registration, OAuth, search, and social features—to benchmark real-world scenarios. This neutral app avoids framework biases, focusing on core web tasks.
Productivity Showdown: Lines of Code and Development Velocity
Grails shines in CRUD generation via scaffolding, minimizing boilerplate. Raible’s version clocked fewer lines overall, thanks to Groovy’s syntax sugar.
Play demands explicit controllers and views but excels in hot-reloading and type safety. Ward’s iteration emphasized Play’s compile-time checks, reducing runtime errors.
Both support rapid prototyping: Grails with grails generate-all, Play with activator new. Deployment to Heroku proved seamless for both, though Play’s statelessness eased scaling.
Performance and Scalability: Throughput Under Load
Benchmarks favored Play: higher requests/second in JMeter tests, lower memory footprint. Grails’ Hibernate sessions introduce state, complicating clustering; Play’s Akka integration enables reactive, non-blocking I/O.
Raible noted Grails’ plugin ecosystem for caching (Ehcache) mitigates issues, but Play’s built-in async support provides edge in high-concurrency scenarios.
Ecosystem and Community: Plugins, Documentation, and Job Market
Grails boasts 900+ plugins, covering security (Spring Security), search (ElasticSearch), and social (Spring Social). Documentation is exemplary, with books and tutorials abound.
Play’s ecosystem grows rapidly, emphasizing modularity via Typesafe Stack. Ward highlighted reactive manifesto alignment, fostering microservices.
Job trends show Grails’ maturity but Play’s ascent, particularly in startups.
JavaScript Integration and Modern Web Patterns
Both frameworks accommodate AngularJS or Backbone for SPAs. Raible’s Grails app used Grails-Asset-Pipeline for minification; Ward’s Play version leveraged WebJars.
Server-side templating—GSP in Grails, Twirl in Play—handles SEO-friendly rendering. Play’s JSON APIs pair naturally with client-side MV*.
Backward Compatibility and Maintenance Realities
AppFuse’s history informed this: Grails maintains smooth upgrades; Play 2.0 broke from 1.x, but migration guides exist. Raible praised Grails’ semantic versioning; Ward noted Play’s evolution prioritizes performance.
Conclusion: Contextual Winners in a Diverse Landscape
Raible and Ward conclude neither dominates universally. Grails suits data-heavy enterprise apps; Play excels in reactive, scalable services. Developers should prototype both, weighing team skills and requirements. The smackdown underscores JVM’s web strength, with both frameworks advancing the field.

