Ever experience a wonderfully fantastic “green bar!” in Eclipse, NetBeans, or IntelliJ, only to find that when you run your ANT or Maven build, you get an equally catastrophic build failure? If you have, you’ve probably tried what most of us tried, and you’ve attempted to increase Maven’s heap capacity using MVN_OPTS:
exportMAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
That would normally work fine if the error we received is something like:
java.lang.OutOfMemoryError: PermGen space
Oops…
Unfortunately, though, this doesn’t solve the problem because Maven actually uses a separate JVM for each JUnit test execution! So while we have successfully enabled Maven to be a hog, our tests are still running in a constrained environment. What we need to do instead is increase the memory capacity of the Maven Surefire launcher: Continue reading this article »
Close your eyes, take a deep breath, then repeat after me: “Trying to test any Enterprise application by manually executing a test suite is just preposterous, and an application with any complexity at all quickly becomes too burdensome to test without automation.”
Now repeat it a hundred times – still think you can live without automation?
In part one we set up our tools, part two we did project configuration, and in part three we ended with a fully functional application; however, now that you’ve become familiar with the Red Hat tools and Facebook API, it’s time we get to a topic we ideally should have started with in the first place: TESTING! Continue reading this article »
According to a recent research paper by the Aspect Security Group, entitled The Unfortunate Reality of Insecure Libraries, “Eighty percent of the code in today’s applications comes from libraries and frameworks, but the risk of vulnerabilities in these components is widely ignored and under appreciated. A vulnerable library can allow an attacker to exploit the full privilege of the application, including accessing any data, executing transactions, stealing files, and communicating with the Internet. Organizations literally trust their business to the libraries they use.”
When validating user input from forms and exposed services, we often ignore the URL or think to ourselves, “that information is validated later, it’ll be fine,” but when hacks like the following start turning up – in common web-frameworks – it’s time to start thinking seriously about URL validation. Fortunately, it’s easy to accomplish using a number of methods, but first, let’s look at how these attacks work.
Hi Java web-developers. I hope you are already familiar with PrettyFaces. If not, I will give you a very short introduction taken from the project documentation:
PrettyFaces is:
“The open-source /url/#{rewriting} solution for Servlet, JSF, and Java EE, including features such as: page-load actions, seamless integration with faces navigation, dynamic view-id assignment, managed parameter parsing, and configuration-free compatibility with other web frameworks.”
Rewrite, on the other hand, is a URL-rewriting framework built for extendability, for use with any web-framework or pure Servlet itself, and will be used for the core of PrettyFaces 4.0 – once released, bringing the best of both worlds… so that sounds very cool thus far, but what do we want to achive with it? Why would we use either of these frameworks? Continue reading this article »
PrettyFaces is an OpenSource Filter-based Servlets extension with enhanced support for JavaServer Faces – JSF 1.1, 1.2 and 2.0 – enabling creation of bookmark-able, pretty URLs. PrettyFaces solves the “RESTful URL” problem elegantly, including features such as: page-load actions, seamless integration with faces navigation, dynamic view-id assignment, managed parameter parsing, and configuration-free compatibility with other web frameworks.
Get version 3.3.3 of PrettyFaces now! See how simple URL-rewriting can be, with the power of open-source tools at your fingertips.
Thanks goes out to all of the developers who contributed to this release; a lot of work has been done, particularly in the realms of stability, performance, and inter-operability with other frameworks. Continue reading this article »
This is the third article in the series of Creating a Facebook App with Java. In the first and second articles we set up a number of tools, and used the Facebook JavaScript API to retrieve our personal account information, as well as some information about our friends.
In this article we will set up the Web Service (in Java) that will house all of our game logic. Remember we want to maintain separation of concerns, so if you ever find yourself putting if statements, or other logic in your html pages, you may be doing something that will be expensive or time-consuming to change later. After our Web Service is set up, we’ll start to tie our webpages to it, and then build out our actual game! Continue reading this article »
The first article in our series took care of setting up and installing an IDE, some tools, and signing up for your new app at Facebook. Now we’ll begin creating the Web application with a landing page and some basic Facebook API calls. We’ll be creating our web application using Forge – where we left off in the part one. Because Forge allows us to start our new application very easily, and streamlines things like adding persistence (and eventually Arquillian, the testing framework) with a single command.
We’ve all heard of “mobile apps” that are sweeping the internet – stories of developers creating hit apps in their parents basements, or while having coffees at Starbucks. They strike it rich, quit their jobs, and retire wealthy before the age of 25; but first, lets set some reasonable expectations. Those stories do happen, and they make the news because they’re fun to hear about, but you might want to consider playing the lottery for some better odds if you really think you’re next. I strongly believe that mobile apps (and/or HTML5 webpage apps) are the future of software development. Beyond that, social media is going to keep playing a greater and greater role in these applications.
This article will take you through setting up a new Facebook app, from beginning to end. It is assumed that you are a developer, and as such are working on some UNIX based platform (all examples in this article will be from Ubuntu 11.10). Those working on Windows (like I may have been just last year) will have to find equivalent commands for certain parts, or decide to join the rest of the “real developer” community. It is worth noting here that I am not a JBoss employee, nor am I affiliated with them in any way. However I am friends with several of their lead developers, which probably helped my initial gravitation in that direction. You will see me reference JBoss projects many times throughout this tutorial, and while you are always free to use your own alternatives, you may need to deviate from my instructions to do so. Continue reading this article »
Hello open-source fanatics! You may have noticed our recent move from ocpsoft.com to ocpsoft.org, and we would like to take a brief moment to explain this change. We have always been an open-source website, a group of technologists dedicated to the open-source programming model, but our domain name did not reflect this initiative. OCPsoft is an organization for shared open ideas, and in order to promote that reality, we have decided to take the risk at damaging our search rank in order to stay true to our ideals.
If you would like to help us through this transition, you can do so by blogging about or linking to our new domain: ocpsoft.org, using the following HTML.
Often unknown, or heralded as confusing, regular expressions have defined the standard for powerful text manipulation and search. Without them, many of the applications we know today would not function. This two-part series explores the basics of regular expressions in Java, and provides tutorial examples in the hopes of spreading love for our pattern-matching friends. (Read part one.) Continue reading this article »