Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Java Programming

Building A J2EE App with Linux 32

Dejected @Work writes "If you think "Hello World" is always simple and boring try building it with a entity/session EJBs, a servlet, a JSP page, and a HTML home page on Linux. This tutorial shows you how to develop, test, run, and debug a complete J2EE application using Linux and WebSphere(trial download)."
This discussion has been archived. No new comments can be posted.

Building A J2EE App with Linux

Comments Filter:
  • by tps12 ( 105590 ) on Wednesday June 19, 2002 @09:42PM (#3733551) Homepage Journal
    This tutorial is an excellent starting point for people who want to get into J2EE. J2EE has quickly become one of the hottest new technologies on the market, and for good reason.

    Some background for n00bs: J2EE == Java 2 Enterprise Edition, Java's flagship Java product. Ironically, "Java 2" actually refers to Java >= 1.2, but we'll let that slide. ;) In any case, the enterprise edition has proven the favorite environment for high-availability, low-latency business applications.

    As for deployment platform, I have to say that Linux is the ideal Java platform. Both companies support open source, so the community has made sure the integration is tight and optimized for users that demand the performance of C++ with the ease of use of Python.

    This tutorial would be of help to anyone trying to break into the software industry, and a boon especially to those interested in C# and .NET, which by all appearances will be to Java what Java was to Linux, minus X11 and plus COM.
    • What a bunch of gibberish to get modded up!

      Both companies support open source

      What "both companies"? Is Sun one of them? Their support for open source is highly dubious. For certain, it's hardly in their interests to make Linux the "ideal" Java platform.

      so the community has made sure the integration is tight and optimized

      Give one example of how Java is "integrated" into Linux, much less "tight and optimized". On my system, Java is terribly integrated: I have to download parts from all over the net and put them together myself. Most of those parts (like the 50 MB jre) don't feel very "tight and optimized". Indeed, it is the Java industry's disregard for (or fear of?) open source that most impedes "the community"'s efforts to make Linux a good Java platform.

      the performance of C++ with the ease of use of Python

      Java "performance" is still largely vaporware: "just one more technology, and we'll be as fast as C++". (Not that this matters for most applications.) And if Java is as easy to use as Python, why am I so grateful for Jython?

      C# and .NET ... by all appearances will be to Java what Java was to Linux, minus X11 and plus COM

      Ok, now I think you're just putting us on! Either that, or you didn't do very well on the analogies section of the SAT. :-)

    • Ironically, "Java 2" actually refers to Java >= 1.2

      Sorry, Alanis, that's not ironic, just marketing.
  • I wonder if there are any JBoss tutorials that would show us how to do it as easily as this.
  • Is this a sign to anyone that programs are having to include too much code at a deeper level of implementation than they have to? A Hello World program for a PC gets complicated when it has to include code for the OS that it runs on.
  • Simply write the program in assembly, and have the computer say Hello World without a pre-recorded wave or audio file. Now do it without an operating system (self bootable, sound card drivers build in, etc.)

    That said, good tutorial.
  • by FortKnox ( 169099 ) on Thursday June 20, 2002 @09:44AM (#3735610) Homepage Journal
    And d/l the Java & J2EE SDK, run on Linux with Apache, Jakarta's Tomcat, JBoss, and use an open source DB like postgres or mySQL.

    There are full open source options for J2EE (in fact, I have been toying the idea of making a weblogging program similar to slashcode or scoop with J2EE, under the GPL, of course).

    And as a side note, J2EE on windows, linux, unix, or mac isn't different, you know. Did this article just get approved cause it has a tutorial in linux? The only thing that you'll have to deal with is installing the side software in linux (websphere, essentially).
    • There are full open source options for J2EE (in fact, I have been toying the idea of making a weblogging program similar to slashcode or scoop with J2EE, under the GPL, of course).

      I have been toying with the idea of writing slashcode as a J2EE app. I written a number of J2EE apps for my company in the past year or two. I am very experienced with the EJB and backend layers, but not so experienced with the jsp layer. If you're really interested in doing this let me know. I would like to help. I think it would be really interesting to see if a J2EE open source app could run in a large volume environment such as slashdot. I can give you a lot of tips on performance and/or shortcommings of the J2EE environment.
      • It's called Squabble [squabble.org] named after the website that uses it. It's not ready for prime time yet (they are working on v2.0, which in their words "Won't cause as much embarrassment to us when people brose the code").

        As far as help goes, I'm sure if you contacted Clay, he would be happy to talk.

    • I have on problem with going FULL open source _development_ for J2EE apps. I'm part of a project that is trying to develop a J2EE application with as many Open Source Tools as possible. One thing that is sorely missing is a decent, GPL-like development tool for EJB. Sure, we can do it in vim, but why? Other tools, like Forte or Web-sphrere, offer "free" multi/cross platform tools, but they won't do EJB or XML schema validation (Sun's Forte does XML checking and validation, but validates only against DTDs). Does anybody here have any suggestions for tools that will aid in developing EJB and related technologies? Otherwise, we will be forking money over to Websphere, Sun, or CodeWeavers....
      • I would steer you towards Eclipse [eclipse.org]. It's the basis for WebSphere's IDE, was written by IBM (Supposedly at a cost of 40million or something) and has been donated to the open source community under the GPL.

        Version 2.0 will be available in a week or two. One of the wonderful things about Eclipse, is how extensible it is. There are many plugin's available for EJB development.

        Eclipse ships with plugins builtin for integration with Ant, JUnit, etc. If you're using Tomcat or JBoss, WebSphere (Or pretty much any mainstream J2EE App Server) there are plugins to integrate with them too.
  • J2EE overkill (Score:5, Insightful)

    by oops ( 41598 ) on Thursday June 20, 2002 @10:55AM (#3736061) Homepage
    The problem I see repeatedly with J2EE adoption is the insistence of developers to use every facet of the API. That means EJBs, JSPs, servlets, JMS (messaging), transaction services etc. People don't seem to realise that J2EE is a set of APIs, and a simple servlet/JSP/JDBC solutions is just as 'J2EE'-compliant as a full bean-driven, JTA-enabled solution.

    To ease yourself in, start with servlets and JSP (obviously for web-enabled apps). Then start adding beans (stateless session then stateful session and then entity), etc. Don't hope to throw every Java-enabled TLA together and hope for a performant J2EE solution!
    • Re:J2EE overkill (Score:1, Interesting)

      by Anonymous Coward
      amen. I've seen too much of this lately. I'm starting a project using J2EE, and the only components of it that I'm using are EJB, JMS, and JTA. The other stuff I'm filling in with Apache and PHP.
  • I'm a J2EE developer. I mostly use JSP/Servlets, but I have a couple EJB container apps where it makes sense. I've made a selection of books I think people interesting in getting into this market should own.

    Go to http://www.starvingmind.net/tech.php [starvingmind.net] and check them out.

    Changing topics, I have been experimenting with a servlet container called Resin [caucho.com], which people in the industry seem to regard as the fastest for JSP/Servlet apps. Development License is free, production license is $500 IIRC. Worth looking into once JSP/Servlet performance becomes an issue for you. It is not Open Source, but it looks to be a very high quality product, which runs fine on Linux.

    -Pete
  • O'Reilly's Book (Score:3, Informative)

    by peterdaly ( 123554 ) <petedaly.ix@netcom@com> on Thursday June 20, 2002 @11:14AM (#3736196)
    If you want the learn about the J2EE EJB container services, I highly reccomend O'Reilly's Enterprise JavaBeans (3rd Edition) [amazon.com], I have both the second and third additions, and think they are both great.

    -Pete
  • under Linux?

    I tried the whole Linux/Java thing. Couldn't get the Java environment to install for love or money.
    • Ehm sorry but if you can't get Java to work at all, should you even be trying to build a J2EE application? Getting Java to work is the easy part. The real issues come much later, for instance, trying to figure out why your J2EE app works on one app server and doesn't on another.
  • Unfortunately, Linux is not an adequate deployment platform for high-traffic enterprise apps. This is due for the most part to the Linux threads architecture (or lack thereof) and less-than-optimized java implementation. Since Linux has no real threads and no optimized mutex locking (such as adaptive locks), high workload, simultaneous requests and network traffic brings latencies up very rapidly and makes the system dog slow very quickly.

    Of course, Linux can be a great development platform for J2EE, and the apps can be deployed on Solaris (even Solaris Intel) or MacOS X (which has a marveous super-optimized JVM)

    In (clearly unscientific) testing that I made, Solaris Intel was about 3x as fast under load and a lot snappier than Linux on the same hardware.
    • Unfortunately, you're smoking crack. This is due for the most part to you're narrow-minded view that a high-traffic enterprise app needs to run on one, gigantic server.

      The JVM itself does not scale adequately to serve high-traffic enterprise apps. The locking issues are not w/ Linux - they're with the JVM itself. You'll get nearly linear scaling w/ Sun's JRE going from one to 2 processors. A fair amount less making the jump to 4. After that, you're screwed. The JVM will hang on internal locks, and you'd be lucky to get much performance gain at all. It's certainly true that Sun's JRE implementation runs best on Solaris - imagine that. But if you run under IBM's JRE (Which is already a good bit faster than Sun's), you'll see very little difference.

      Web-applications are perfectly suited to load-balancing. Throw a couple hot/hot $1000 LVS 1u servers in front of your application servers, and you can scale to millions of hits/day.
  • by JohnA ( 131062 ) <johnanderson&gmail,com> on Thursday June 20, 2002 @05:40PM (#3739347) Homepage
    AnalystScan (http://www.analystscan.com [analystscan.com]) is a high volume, dynamic Java powered web site. It runs PURELY open software (Jakarta Tomcat, Linux, PostgreSQL, Sendmail, JBoss), and has even withstood a mini-slashdotting when it was the focus of a slashdot posting regarding stock market analysts.

    If you want to get going quickly, I recommend that you begin using Jakarta Tomcat 4. It has some features that make developing true J2EE apps a lot easier (JNDI support, JMS support, etc.) Remember that many J2EE apps don't actually need EJBs, which means that you do not need to deploy a J2EE container. If you choose to deploy a container, I recommend JBoss [jboss.org]. It has some quirks, but is true free software, and the latest versions are actually beginning to outperform some commercial EJB containers.

    Finally, take heed of some other people's comments... you do not need to have every Java TLA running for the solution to be a J2EE application. Choose the bits and pieces that meet your needs, and don't throw in the kitchen sink just because it's the technology du jour.

  • Skip the WebSphere download and start with JBoss. Still compliant, but simple to manage and open. Even if you're just getting started, stepping through container source in a debugger can be an enlightening experience.

    After you read the hype about the mystical and versatile powers of EJBs, brush up on its real-world shortcomings and some useful patterns for overcoming them at The Server Side [theserverside.com].
  • All these tools (yes, I have the required regiustration to look through the tutorial) Are great for doing the O/R stuff, but what JSP and web development ion general needs is goog WYSIWYG editros for the Composition of Web Pages.

    Anyone know of one?

If you want to put yourself on the map, publish your own map.

Working...