seam integration?
Hi.
I'm using the newest Diana EAP (build 8280) and I'm really enjoying the seam integration!
But sometimes idea tells me my seam components are not components! I get red squiggly lines under all seam annotations, including @Name at it tells me that these annotation are only allowed on seam components. Deleting and then creating the annotation again seems to make the inspector recheck and sometimes it concludes that all is well.
I am unable to reproduce it the error consistently...
The application works fine when deployed to JBoss 4.2.2, so they are valid components.
I was wondering, how does the inspector determine that a java class is a seam component? I know that our project structure is relatively complex, and i suspect that it confuses the inspector.
./Daniel
请先登录再写评论。
Hi, Daniel,
I've been trying to reproduce this bug. Seam annotations must be highlighted
if @Name isn't defined in class. But in your case @Name exists.
So could you help us to fix problem?
Is seam facet defined in your module?
Is only one seam facet in module?
How seam libraries are configured for your project (module, project, global)?
What did you do befor idea highlighted your annotations(typing, refactoring)?
Did you got any exceptions?
thank you for feedback,
Serega
P.S.
1. You can disable "Seam annotations inconsistency" inspection : )))
2. Don't hesitate to create jira requests : ) (new features and bugs).
Hi, and thanks for replying.
To answer your questions:
The seam facet is only on the UI module, and no duplicates.
Seam libraries are available using project libraries.
No exceptions.
Our project has a variety of modules, for seperating things like EJB(more than one module) and JPA(code reuse in other modules), a test module for running tests based on jboss embedded with separate classpaths and a UI module based on seam.
In making some of the entities and EJBs available to seam, I placed some annotations on enitites in our JPA module and on some EJB's along with an empty seam.properties on the src/ folder, which made seam recognise the components when deployed.
I experience two different behaviours from the inspector. In our JPA module, the inspector would consistently claim that @Name (from seam annotations) is only supported on seam components. These seam components are not available for code completion in EL expressions in our UI module.
In our EJB module, I experience the behaviour described in my original post. I've just type around i class file, and when editing the EJB annotation (ie. deleting @Stateful and typing it again) would make the inspector claim that @Name is only supported on seam components. I can make the error go away by restarting IDEA and re-opening the file. Seam components defined in this EJB module is available for code completion if the inspector has no errors.
I tried adding the seam facet to our JPA module. That made the inspector happy and now all components are recognised correctly. Unfortunately, the component names are not available for code completion in our UI module, we would very much like that.
Adding the seam facet to our EJB module also make the inspection errors go away and the components are available for code completion.
./Daniel
EDIT: Aha! Adding our JPA module as a dependency to our UI module made the JPA components appear in EL code completion
I guess all of this boils down to the inspector inspecting modules not defined as seam facets, and perhaps better auto-dectection of seam facets...
Edited by: Daniel Nielsen on Apr 17, 2008 12:03 PM
Hi, Daniel.
thanks for your detailed answer. It really helped to fix a few seam model
bugs.
The main problem was that module with defined seam facet didn't provide own
seam components in dependent modules.
So you couldn't complete "parent"(JPA?) components in UI module and @Name
annotatated classes were not defined as seam components at all.
please, try the next eap build. it has to work.
Serega.