Slashdot Mirror


Building A J2EE App with Linux

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)."

32 comments

  1. asefkljalkfdjsadlkjflsaidjvlksdajflkasd by mobydill · · Score: 0, Informative

    asdfasdfasdf awfd asdf asdf asdf ASDF

    --


  2. j2ee and linux: the killer combo by tps12 · · Score: 4, Interesting

    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.

    --

    Karma: Good (despite my invention of the Karma: sig)
    1. Re:j2ee and linux: the killer combo by The+Pim · · Score: 3, Insightful
      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. :-)

      --

      The evaluation of an action as 'practical' . . . depends on what it is that one wishes to practice.
    2. Re:j2ee and linux: the killer combo by Icculus · · Score: 1

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

      Sorry, Alanis, that's not ironic, just marketing.

  3. JBoss tutorials by trajano · · Score: 1

    I wonder if there are any JBoss tutorials that would show us how to do it as easily as this.

    --
    Archie - CIO-for-hire :-)
    1. Re:JBoss tutorials by Anonymous Coward · · Score: 0

      yes

      in the jboss manual

      it's easier.

    2. Re:JBoss tutorials by SarcasticTester · · Score: 1

      Anything is easier than freakin' WebSphere! I don't understand the choice made here, why on earth use an evaluation licence of websphere i fyou can use a full version of JBoss! ?

      --
      We're all out there, somewhere, waiting to happen.
    3. Re:JBoss tutorials by Anonymous Coward · · Score: 0

      Because the tutorial is on IBM's site, the same people who made WebSphere :P

  4. Systems Code? by hackwrench · · Score: 1

    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.

  5. Check this project for a complete application... by Cpt_Corelli · · Score: 1
  6. Hello World boring? by rtaylor · · Score: 1

    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.

    --
    Rod Taylor
  7. Why not go FULL open source? by FortKnox · · Score: 4, Informative

    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).

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    1. Re:Why not go FULL open source? by The+Slashdolt · · Score: 1

      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.

      --
      mp3's are only for those with bad memories
    2. Re:Why not go FULL open source? by grimiore1 · · Score: 1

      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....

      --
      Ben, you've become an UberGeek! Take me as your padawan!!!
    3. Re:Why not go FULL open source? by gengee · · Score: 2

      I would steer you towards Eclipse. 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.

      --
      - James
  8. J2EE overkill by oops · · Score: 5, Insightful

    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!

    1. Re:J2EE overkill by Anonymous Coward · · Score: 1, Interesting

      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.

  9. Check out my J2EE books by peterdaly · · Score: 2

    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 and check them out.

    Changing topics, I have been experimenting with a servlet container called Resin, 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

  10. O'Reilly's Book by peterdaly · · Score: 3, Informative

    If you want the learn about the J2EE EJB container services, I highly reccomend O'Reilly's Enterprise JavaBeans (3rd Edition), I have both the second and third additions, and think they are both great.

    -Pete

  11. How about how to INSTALL the bastard by BluedemonX · · Score: 2

    under Linux?

    I tried the whole Linux/Java thing. Couldn't get the Java environment to install for love or money.

    --

    --- Jump!! Fire!! Bullet time!! - Lego version of the Matrix
    1. Re:How about how to INSTALL the bastard by PommeFritz · · Score: 1

      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.

    2. Re:How about how to INSTALL the bastard by Anonymous Coward · · Score: 0

      Which part could you not get to work? The untarring of the tarball into the directory? Or the use of RPM, if you're using an RPM-based distro? Honestly, installation of a JDK under Linux is trivial.

  12. Linux/J2EE Scalability Problem for Enterprise Apps by lprimak · · Score: 3, Interesting

    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.

    --
    Lenny Primak PP-ASEL-IA,Heli
  13. YHBT. YHL. HAND. by Anonymous Coward · · Score: 0

    YHBT. YHL. HAND.

  14. Easy, Robust, and Open! by JohnA · · Score: 3
    AnalystScan (http://www.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. 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.

  15. Re:Linux/J2EE Scalability Problem for Enterprise A by gengee · · Score: 3, Informative

    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.

    --
    - James
  16. JBoss by Diet+Rapture · · Score: 1

    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.

    --
    Stop eating my hands.
  17. There IS a blog/slash J2EE project by serps · · Score: 2

    It's called Squabble 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.

    --
    "Einstein argued that [...] God is not capricious or arbitrary. No such faith comforts the software engineer." ~ Brooks
  18. Re:Linux/J2EE Scalability Problem for Enterprise A by lprimak · · Score: 1

    I guess my crack smoking is to blame to do the tests on the same hardware. IBM JRE, unfortunately, crashes, and I will also take 4 2-way boxes over 10 1-ways. sorry. shhhh--cough-cough-cough

    --
    Lenny Primak PP-ASEL-IA,Heli
  19. WYSIWYG Form Editor for JSP by adamy · · Score: 1

    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?

    --
    Open Source Identity Management: FreeIPA.org