Problems with common JavaEE tasks in IDEA

Hi, I'm struggling with some basic programming tasks related to JavaEE support in IDEA.

1) Problem with application.xml which is ear descriptor created when JavaEE facet is added.
a) When I change anything in the facet options. e.g. rename the "Path Relative To Deployment Root" IDEA always adds all modules again while duplicating the existing modules. The existing modules are not updated but new are added.
b) Multiple EJB modules in one ear are not supported. Idea adds same ]]> for both of them. The id must be unique.

2) Problems creating new Session Bean in EJB facet.
a) Using the action New/Session Bean creates new bean but no home/local interface
b) Didn't find a way how to generate home interface for existing session bean manually
c) The Session Bean MyBean tab opens in editor with gui support for editing some basic features of the bean. This tab is marked "*" like not saved but does not respond to any save actions. Changes in this window - e.g. changing session type from stateless to statefull - are not propagated to java file. This window seams a bit broken.

3) The HQL Console is not working with JPA persistance which uses Hibernate

IDEA 7.0.3 7744

Greetings,
Steve

6 comments
Comment actions Permalink

2) Problems creating new Session Bean in EJB facet.
a) Using the action New/Session Bean creates new bean but no home/local interface
b) Didn't find a way how to generate home interface for existing session bean manually
c) The Session Bean MyBean tab opens in editor with gui support for editing some basic features of the bean. This tab is marked "*" like not saved but does not respond to any save actions. Changes in this window - e.g. changing session type from stateless to statefull - are not propagated to java file. This window seams a bit broken.

You've created EJB3 facet, where session beans aren't required to have
home/local interfaces, so they aren't created by default. Maybe you need
EJB2.1 instead?

Session bean GUI editors are editors for ejb-jar.xml parts. So the
changes you make are reflected there.

0
Comment actions Permalink

Hi,
I'm sorry I have confused you. Of course I'm talking about local interfaces, not home. I have a Seam project (Seam 2.0.1) which uses EJB3 and it needs the local interfaces. In Eclipse you can generate the local interface for existing session bean. Why is this not possible in IDEA?

About the GUI editor. The bean is generated with @Stateless annotation and GUI editor opens. I change it to Stateful. It is changed in ejb-jar.xml but not the annotation in the bean itself. This is kind of useless. And I would like to make another point. The information about bean in ejb-jar.xml is not needed if you have annotated bean (at least in Seam). I always delete it from the xml. The GUI editor does not support editing the beans which have only annotations and not entries in xml.

I think IDEA developers should focus more on testing the compatibility of IDEA JavaEE support with real world use cases like Seam than just sticking with paper specs.

Anyhow the GUI editor still has the problem with this "*" marker. And lets not forget the other problems in points 1) and 3).

0
Comment actions Permalink

We will improve EJB support in IntelliJ IDEA 8.0.

0
Comment actions Permalink

I cannot reproduce item 1a. Could you please provide more details about
structure of your project?

IDEA uses name of EJB facet as id for the corresponding module in
application.xml so in order to workaround the problem 1b you should
give different names to your EJB facets in "Project Structure" dialog.

Hi, I'm struggling with some basic programming tasks related to JavaEE support in IDEA.

1) Problem with application.xml which is ear descriptor created when JavaEE facet is added.
a) When I change anything in the facet options. e.g. rename the "Path Relative To Deployment Root" IDEA always adds all modules again while duplicating the existing modules. The existing modules are not updated but new are added.
b) Multiple EJB modules in one ear are not supported. Idea adds same <module id="EJB"> for both of them. The id must be unique.

2) Problems creating new Session Bean in EJB facet.
a) Using the action New/Session Bean creates new bean but no home/local interface
b) Didn't find a way how to generate home interface for existing session bean manually
c) The Session Bean MyBean tab opens in editor with gui support for editing some basic features of the bean. This tab is marked "*" like not saved but does not respond to any save actions. Changes in this window - e.g. changing session type from stateless to statefull - are not propagated to java file. This window seams a bit broken.

3) The HQL Console is not working with JPA persistance which uses Hibernate

IDEA 7.0.3 7744

Greetings,
Steve



--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Hi, thanks for info. I didn't know that IDEA uses ejb module name as id. I had both names the same. So 1b is solved. The 1a problem happened because the ids have been the same. Solved as well.

0
Comment actions Permalink

Ok let's not go too fast on this one. I have found the reason why I have two facets with duplicate "EJB" names in the first place.

I have a multimodule maven2 project. The maven modules are synchronized into IDEA modules with the same names. So I have two EJB modules "actions" and "models" and one Web module "webapp". The IDEA modules with same names are automatically created on synchronize including nested ejb and web facets.

The real problem is that the ejb and web facet names are not using maven module names but general names. So in result I get this:

- module "actions" with facet "EJB"
- module "models" with facet "EJB"
- module "webapp" with facet "Web"

Since the facet names are used in application.xml as ids the whole thing breaks! The question is how fast you can fix it? :)

0

Please sign in to leave a comment.