X

Geertjan's Blog

  • January 12, 2006

To be or not to be... J2EE

Geertjan Wielenga
Product Manager
Let's say you're a web developer but you have no interest in J2EE. You also have a slow computer. So you disable the J2EE module, which is something you can do because the IDE is modular. Suddenly everything speeds up and the world is wonderful again. However...

  1. You run into a problem with your JSP page, and you think: "Hmmm. I wonder what the helpfiles says about this." Then you look in the helpfiles and discover... there's nothing in the helpfiles about JSP files! There's nothing in there about servlets! There's nothing about building or deploying your web application! Why? Simple: The helpfiles that relate to web applications are all in the J2EE module.

  2. You think to yourself: "Hmmm. I've got a cool web application. Let's add some web services." You go to the New File wizard and you find... no web services! Why? Simple: Web services are part of the J2EE module, and when you disabled the J2EE module you also disabled web services.

  3. You read the J2EE specification and you find that the J2EE specification covers far more than just EJB and web services—it also deals with JSP files and servlets. Then you look in the Module manager and you see there's a module called "J2EE" and a module called "Web". You think to yourself: "What's going on here?" This doesn't seem to comply with the specification at all. Why? Simple: NetBeans IDE considers "J2EE" to mean functionality that pertains to application servers, EJBs, and web services. But, this is wrong. (In fact, the first sentence of this blog entry is wrong—if you are a web developer, you must be interested in J2EE, because web development is part of J2EE.)

Worse, the first two of the above things happened to me while demonstrating things in Egypt. Firstly, my flatmate Lou Ruppert was in the first scenario—he has a very slow laptop, which is okay when he's doing his daily web development, via Tomcat. He hasn't used EJBs and web services and has no need to do so, so we disabled the J2EE module. But he wanted to upgrade an old web.xml file from 2.3 to 2.4. I said: "Look in the helpfiles, because I wrote a help topic which describes exactly how you do that." When he looked in the helpfiles, he found nothing. Only after I remembered that it was part of the J2EE module did I realize the cause of our being unable to find the help topic. Secondly, while demonstrating new 5.0 functionality to the AUC students in Cairo, I wanted to show them how a J2SE application can consume web services in 5.0. Again, the J2EE module had been disabled, and only after realizing that was it possible to continue with the demonstration. (If they had disabled a module called "web services", they would probably have been more aware of what functionality they had excluded, rather than something as amorphous as "J2EE".)

The third point above is something that NetBeans Evangelist Gregg Sporar pointed out to me—JSPs and servlets belong to J2EE. Whatever the case, though, I think it would be helpful to split the J2EE module into (at least) three—"EJB", "web services", and "application servers". I'm guessing there's some technical reason for why this hasn't been done already, but I'm hoping that this is possible somehow. Because, the current status is not very satisfactory—the term "J2EE" is just not transparent enough.

Join the discussion

Comments ( 8 )
  • Roumen Thursday, January 12, 2006
    In my experience disabling the J2EE modules doesn't speed up the IDE that much. The startup gets only slightly better as well as the memory footprint. I would suggest not to disable these modules at all. After all this is not a supported scenario - it's hard to test what would happen if you disable some combination of modules.
  • guest Thursday, January 12, 2006
    Sure, but imagine your computer is slow and you're not doing anything fancy with the IDE, you're just doing some very basic web development... if you browse through the Module manager, which module would you be most likely to disable? Okay, so you're browsing through the Module manager, and you come across "J2EE". You expand the J2EE node and you see a whole bunch of things, none of which you're using. So you disable that... and then you have no helpfile for web development. (I guess I should create an issue and assign it to myself -- the web development helpfiles should not be in the J2EE module.)

    And, whether or not it makes sense to disable the J2EE module, it is just <u>wrong</u> to call the module "J2EE". As pointed out above, the "web" module <u>also</u> falls under "J2EE".

  • Geertjan Thursday, January 12, 2006
    Oops... the unsigned person above is me...
  • Geertjan Thursday, January 12, 2006
    And what do you mean by this: "I would suggest not to disable these modules at all. After all this is not a supported scenario - it's hard to test what would happen if you disable some combination of modules."

    What's the point of having a modular IDE if you shouldn't be disabling them? Sure, the benefit that NetBeans has over other IDEs is that you don't need to look around for plugins, because so much stuff is provided out of the box. But I wonder how many people really need all of it? If you're not using WebLogic (and I wonder how many people really are using WebLogic), isn't an automatic thing to think: "Hmmm. I have an old and slow computer. Lets disable a whole bunch of modules." If disabling modules has no impact on performance, then it seems odd to have so many available out of the box.

  • vbrabant Thursday, January 12, 2006
    Roumen, I don't agree with you. Maybe you can see any difference between disabling and enabling modules, because your PC has powerful, but personally, I like to disable somes modules, be sure it's working and then uninstall them safely. Then, I am sure NetBeans will use less memory, and will start more rapidly, ...
    If disabling module is something that is proposed to the NetBeans users, it would be a supported scenario.
  • Geertjan Thursday, January 12, 2006
    I'm glad you said that, Vincent. With Lou, the flatmate in Egypt, I had the same experience. And the students at the university had the J2EE module disabled before I got there. In other words, they'd decided that was useful (without my prompting them or anything).

    Earlier today, Vincent sent me an e-mail in response to this blog and one of the points he makes there is: "If you disable J2EE support, the JSF and Struts Support are also disabled."

    If this is true, then I think that's pretty terrible.

  • Roumen Sunday, January 15, 2006
    I agree that the grouping needs to be resolved. I just wanted to point out that QE currently doesn't test all the variants of turned off modules, so it might be risky.
  • guest Tuesday, January 17, 2006
    Without getting involved in the "should web be part of J2EE debate", I have some comments from what I can recall immediately of the implementation dependencies.
    The DD providers for the J2ee standard descriptor files (web.xml, ejb-jar.xml, etc.) share common beans (otherwise changes to things like resource-ref's gets really ugly). This means that the web.xml DDAPI has dependencies on shared code here (and thus is part of the J2EE DDAPI module).
    A standard web project implements J2eeModuleProvider from j2eeserver because, you guessed it, a web module is a J2eeModule. I'm sure this and related code introduces a number of tricky dependencies.
    On the other hand, I just checked the module manager, and it seems to me what you are really commenting on is the module organization and what is categorized under "J2EE Modules". I'm sure you can disable several of the submodules in that list w/o hurting web (like all of EJB, EAR, and the various application servers).
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.