[
https://jira.jboss.org/jira/browse/JBSEAM-3404?page=com.atlassian.jira.pl...
]
Luis Tama commented on JBSEAM-3404:
-----------------------------------
Hi Shane...
I tested with the hibernate example as you did, and yes, it deployed fine...
And, as you suggested, I compared the structures of the war files (please note
"my" war file is a generated one, which is exploded BTW). I found the
difference in the way they arrange the source code and the bin output folders. So
let's see...
AFAIK, JBoss Tools -> Create New Seam Web Project makes use of seam-gen tools, right?
This seam-generated project creates these source folders:
/src/action
Here I have the Authenticator component, and my EntityHome classes, and everything related
to actions / forms / conversations. Also my extended Identity component...
The output folder is /WebContent/WEB-INF/dev, and is intended for incremental hot
deployment during Seam development, as stated in section 2.8 in the docs.
/src/model
Here I must put the Entity classes, which will never be hot-deployable.
The output folder is /build/classes, which is the default, and all the classes will be
placed in /WEB-INF/classes at war generation.
The BUG is the following: Initialization seems to not be properly scanning /WEB-INF/dev
folder during seam application startup/deployment.
So, a workaround could be to place these components in /src/model, but then they will not
see hot deployable components inside /WEB-INF/dev (as stated in the docs). I already
tested this workaround in my original app and it crashes because my Identity component and
some other components depend on the ones in the hot deployable area, and even my pages
don't render the data from these hot deployable beans/components, because they resolve
to 'null' from the context they are in. I get this kind of exeptions in
debug.seam:
...
Exception during request processing:
Caused by javax.el.PropertyNotFoundException with message: "Target Unreachable,
identifier 'taskPlanificarArea' resolved to null"
...
Evantually, in order to avoid all those errors, the final workaround is to change the
output folder for the whole /src/action source folder, to be the default /build/classes
-> WEB-INF/classes. This way my app works, but this turns off incremental hot
deployment for all components... :-(
I think this is a real bug, and I guess it's located in
org.jboss.seam.init.Initialization.java (which has had some changes, specially in init(),
redeploy() and createHotDeployment() methods... Maybe there are also some problems in
org.jboss.seam.deployment.HotDeploymentStrategy.java
Please test this scenario as I did, with a seam-generated app, or from a JBoss Tools Seam
Web Project, not from the examples, because they don't have this hot deployable
structure... Then you will reproduce the bug for sure...
Hope this will be solved soon!!
Thanks in advance!!
Extended Identity component is not being loaded during Initialization
process
-----------------------------------------------------------------------------
Key: JBSEAM-3404
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3404
Project: Seam
Issue Type: Bug
Components: Core, Security
Affects Versions: 2.1.0.BETA1
Environment: Windows XP SP2, JDK 1.5.0_16, JBoss AS 4.2.2.GA, Eclipse JEE Europa
Winter (3.3.2), JBoss Tools 2.1.2.GA, JBoss Seam 2.1.0.BETA1 and 2.1.0-SNAPSHOT # 309
Reporter: Luis Tama
Assignee: Shane Bryzak
Attachments: home.page.xml, Identity.java
I have this Extended Identity component, which lets me render different home pages
according to the user roles:
@Name("org.jboss.seam.security.identity")
@Scope(ScopeType.SESSION)
@Install(precedence = Install.APPLICATION)
@BypassInterceptors
@Startup
public class Identity extends org.jboss.seam.security.Identity {
private static final String DEFAULT_HOME_PAGE = "/home/home.xhtml";
private String homePage = DEFAULT_HOME_PAGE;
// getter and setter for homePage, and business logic
// and some other important properties related to my business model...
}
In Seam 2.1.0.BETA1, it works fine:
...
21:53:16,159 INFO [Initialization] Installing components...
...
21:53:16,921 INFO [Component] Component: org.jboss.seam.security.identity, scope:
SESSION, type: JAVA_BEAN, class: org.ostion.siplacad.session.Identity
...
In Seam 2.1.0-SNAPSHOT # 303, it's not being loaded:
...
21:55:54,125 INFO [Initialization] Installing components...
...
21:55:55,500 INFO [Component] Component: org.jboss.seam.security.identity, scope:
SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.Identity
...
21:55:56,765 INFO [Initialization] two components with same name, higher precedence
wins: org.jboss.seam.security.identity
...
So I can't access identity.homePage from my webapp. I can see this exception in
debug.seam:
Exception during request processing:
Caused by javax.el.MethodNotFoundException with message: "Method not found:
org.jboss.seam.security.Identity(a)9527ee.renderHomePage()"
...
I will not post the full stack trace, because the obvious reason for the problem is that
the extended component is not being loaded by Seam.
I checked Seam source code, comparing versions BETA1 and SNAPSHOT # 303:
Class org.jboss.seam.Component has no changes between versions.
Class org.jboss.seam.security.Identity has changed, but i don't think there is a
problem there.
Class org.jboss.seam.init.Initialization does have some changes, specially regarding
hotDeploymentStrategy. I guess there is a problem is with the hacks over there.
Please check this. I must tell I switched to the SNAPSHOT to not have the "NPE with
hot Redeployment" issue, but now I can't even see my webapp!!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira