Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "java". 1,588 entries found.

You can also try this same search on Google.

Tomcat/Oracle Connectivity Problems

I had a problem that I thought I fixed a while back. The problem was that our firewall between Tomcat and Oracle would close our database connection after 90 minutes of inactivity. We first solved this problem by using a Servlet/Ant Task/cron job combination to ping and use the DBCP connection pool we'd configured in Tomcat. This worked, for a little while. Then we realized we had to also ping the JDBCRealm, so we used a login test (via WebTest) and added this to our Ant Task/cron job. Again, this worked for a couple of months, until a QA Expert came on board and starting using WAPT to load test our app. Then we began having issues with many connections being opened (20+), then they were closed by the firewall, and when the app would try to re-use these connections, they wouldn't respond, and the app would enter into the "dithering idiot" mode. We finally figured out a solution, rather than workarounds, and here it is:

// In the file:
$ORACLE_HOME/network/Admin/SQLNET.ORA

// Add the following line to check every 10 minutes
SQLNET.EXPIRE_TIME=10

Posted in Java at Jun 02 2003, 09:25:58 AM MDT Add a Comment

Hibernate PlugIn for Struts

I don't know that there's a need for a Hibernate PlugIn for Struts, but I wrote one today just for kicks. Pretty simple stuff that only requires you to have hibernate.cfg.xml in your WEB-INF/classes directory, and to add the following to your struts-config.xml.

<plug-in className="org.appfuse.webapp.util.HibernatePlugIn"/>

Then create the file org.appfuse.webapp.util.HibernatePlugIn as follows:

public class HibernatePlugIn implements PlugIn {
    //~ Instance fields ========================================================

    private Log log = LogFactory.getLog(HibernatePlugIn.class);

    //~ Methods ================================================================

    public void init(ActionServlet servlet, ModuleConfig config)
    throws ServletException {
        try {
            SessionFactory sf =
                new Configuration().configure().buildSessionFactory();

            if (log.isDebugEnabled()) {
                log.debug("Hibernate configuration completed.");
            }
        } catch (HibernateException h) {
            log.fatal("Error configuring Hibernate!", h);
        }
    }

    public void destroy() {}
}

This doesn't seem to have any advantages over using a StartupListener, but it would be pretty sweet if it was included with Struts (or Hibernate), so you could simply put it in struts-config.xml and be done with it.

Posted in Java at May 31 2003, 11:31:41 AM MDT 2 Comments

Hotels.com powered by Struts!

This is kind of a cool announcement - giving more credibility to Struts. Personally, I think all the leading web application frameworks are great - and can probably be learned in a week or two (or a few days/hours!) - so it's not about which one you're using, it's about if you're using one or not. If you are - you're on the right path. If not, you're probably wasting a lot of time developing your own.

I am proud to announce the successful launch of a major vacation packaging site whose presentation tier has been built entirely with Struts:

http://packaging.hotels.com/packaging/index.do

We have made extensive use of the Struts MVC framework, custom tags, and I18N components, with some custom modifications. It has proven itself to be a stable and robust platform, able to amply handle the needs of both our users and management.

I would like to applaud everyone who has worked on the Struts project; it has been shown yet again to be an excellent framework for a commerical web application.

James Childers hotels.com Packaging Team

Posted in Java at May 30 2003, 10:59:40 AM MDT 1 Comment

Anthill and Maven

I did a little more research this morning - this time trying to find out if Anthill could play nicely with Maven. Here is the answer I received from the anthill mailing list:

We've recently implemented a Maven builder for Anthill Pro -- it's not 
released yet but will be part of version 2.1.

We will probably implement a Maven builder for Anthill OS sometime soon 
as well.

In the meantime, check out how some people have gotten Maven builds to 
work with Anthill in the past -- 

http://lists.urbancode.com/pipermail/anthill/2002-December/000543.html

Cool! Thanks Maciej!

Posted in Java at May 30 2003, 07:48:48 AM MDT 3 Comments

Can I Mavenize my release process?

I sent the following e-mail to the maven-user mailing list this morning:

Since the deployment of my project's site was so easy using  "maven
site:deploy", I suspect that's there's an easy way to  "package" my app and
upload it to SourceForge.

For packaging, here's what I had in mind.

1. Creates a "dist" directory.
2. Copies the following directories/files into dist:
   bin/*
   conf/*
   target/lib -> dist/lib
3. zips and gzips contents of dist for distribution.
4. Uploads zip and gzip to upload.sf.net
5. (Optionally) Creates a branch in CVS for this release.

In the midst of writing this post, I actually got an answer! Using "maven dist", I created distributions in target/distributions. This directory contains moblogger-*.jar, LICENSE.txt and a docs folder. A little more work and I'm sure I can get a "lib" directory with all the required .jar's for running moblogger, as well as the bin and conf directories. If any of you have examples of dist-ing your project to SourceForge using Maven, please let me know.

Here's a good question for you: Is it possible to create entries in moblogger.jar/META-INF/MANIFEST.MF that point to the other .jar files required to run moblogger? I'd love to simply be able to run:

java -jar moblogger.jar conf/agentsettings.xml

Rather than how it is now (java -cp [each jar listed here] net.sf.moblogger.agent.MoblogAgent conf/agentsettings.xml). The MANIFEST.MF file generated by Maven gives me the impression that this is possible. Consider the following entry in this file:

Extension-List: jaf,mail,commons-lang,commons-logging,ftp,jdom,log4j,q
 uartz,smack,xerces,xmlrpc,junit
jaf-Extension-Name: jaf
jaf-Implementation-Version:
jaf-Implementation-URL: http://www.ibiblio.org/maven/jaf/jars/activati
 on.jar

When I try this now, I get:

Exception in thread "main" java.lang.NoClassDefFoundError: org/quartz/SchedulerFactory

I'm assuming that it might be possible to change the Implentation-URL to something to point to the local file in the same directory. If not, is it possible to add these JARs into my moblogger.jar? Or will this violate some JARs licenses?

Posted in Java at May 30 2003, 06:27:12 AM MDT Add a Comment

Mavenizing Moblogger

I did some work to Mavenize Moblogger this evening. The biggest plus thus far? The Moblogger.zip file when from 1.9 MB to 45 KB - that rocks!! I got jar and site:generate working just fine, but there's no unit tests, so probably a fair amount of work needs to be done there. Regardless, I'll try to check it in tonight so others can start pitching in. The hardest part? Learning to type maven instead of ant.

Update: Deploying the moblogger site was a piece of cake (maven site:deploy). Thanks to the Flock developers for providing a nice template for Mavenizing an app.

Posted in Java at May 29 2003, 06:58:23 PM MDT Add a Comment

Good JavaServer Faces Article

The latest issue of Java Developers Journal has an excellent article on developing with JavaServer Faces. I read it on the plane last week and thoroughly enjoyed it. I like it so much, that if I had my laptop with me, I probably wouldn't tried porting one of my sample apps to use JSF.

However, the magazine I had did not have any code samples in it - even though it referred to Figure 1, Figure 2, etc. So naturally, I was excited to see the online version and the downloadable source code. I might be a little ignorant (being from Montana and all ;-), but this download does nothing for me. It's a 3K zip file with one file in it - that has no extension. If I view it with Notepad, I get some text, but lots of garbage too. This would be a much better article if it included a simple WAR file. An example app that cannot be downloaded and run (or built and then run) is worth nothing to me.

Posted in Java at May 29 2003, 08:35:01 AM MDT Add a Comment

[ANNOUNCE] Apache 2.0.46 Released

The Apache Software Foundation and the Apache HTTP Server Project are pleased to announce the ninth public release of the Apache 2.0 HTTP Server.
...
Apache 2.0 versions 2.0.37 through 2.0.45 can be caused to crash in certain circumstances. This can be triggered remotely through mod_dav and possibly other mechanisms. Specific details and an analysis of the crash will be published Friday, May 30. All Apache 2.0 users are encouraged to upgrade now.

Posted in Java at May 28 2003, 01:20:25 PM MDT Add a Comment

News you can use - Quartz Plugin for Struts

While plowing through the 5000+ e-mails at work this morning, I tripped over the QuartzPlugin for Struts. This looks very cool - a way to configure scheduled tasks (i.e. a cron job) as part of your web application.

The QuartzPlugin for Struts allows you to automatically configure and start a Quartz scheduler upon initialization of your Struts application. It also places itself in your application context to make a scheduler available within your actions. That is, in addition to statically scheduled events like "every six hours," you can dynamically schedule events from Struts actions for "24 hours from now".

Now I just hope I get a chance to utilize this bad boy in the near future.

Posted in Java at May 28 2003, 05:56:13 AM MDT 1 Comment

Vacation Rocks!

I'm home for a mere 12 hours between my New York trip and my Florida trip. Vacation has been awesome so far - and one of the best parts has been not having my laptop and therefore not try to "get things done" - as I am right now! ;-)

Hightlights (so far) have been seeing all my family, seeing Matrix Reloaded (I found myself giggling with glee during some of the fight scenes), playing in a family golf tournament, doing laps in my cousins backyard in a go-cart and going to the Yankees game yesterday with my cousin Paul. To top it all off, I found that the XDoclet team has incorporated my enhancement to allow generating Struts' Forms from POJO's. That ROCKS - Thanks Mathias!

The Apple Store called and said my laptop is finished, so I will pick it up on the way to the airport. I just hope I choose not to take it with me - vacation is so much better without it.

Posted in Java at May 19 2003, 09:40:26 AM MDT 1 Comment