History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: JBSEAM-2143
Type: Feature Request Feature Request
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Pete Muir
Votes: 3
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Seam

Hotdeployed components can't be configured through components.xml

Created: 23/Oct/07 07:27 AM   Updated: 15/May/08 06:27 PM
Component/s: Hot Deploy
Affects Version/s: 2.0.0.CR2
Fix Version/s: 2.1.0.BETA2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Duplicate
 
This issue is duplicated by:
JBSEAM-1001 Hot deploy for JavaBean components li... Major Closed
Related
This issue related:
JBSEAM-2291 Hot deploy pages.xml Major Closed
 


 Description  « Hide
he hot deployment scanner is isolated, using a URLClassloader that is not available once that method comes to a close. The only way to make this work would be to keep that classloader alive during the rest of the startup process. I can direct you to the line of code that you need to look at if you are curious about it.

Check out lines 540 and 541 or org.jboss.seam.init.Initialiation. The scanForHotDeployableComponents uses the following logic to create a component scanner:

            URL[] urls = { url };
            classLoader = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader());
            paths = new File[] { directory };

Once it processes the classes, that classloader is discarded and obviously, since it is a URLclassloader, the classes aren't going to be found later on.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order:
Joshua Partogi [05/Jan/08 06:00 AM]
Does this mean that in the future release components that is configured through components.xml will be able to be hot deployed?

Pete Muir [05/Jan/08 06:08 AM]
In some form, yes. Possibly you will need a separate components.xml that is hot deployable

Dan Allen [14/May/08 04:24 PM]
I want to clarify that there is a distinction between "configuring" and "defining" a component. It *is* possible to configure (the properties of) a hot deployable component in components.xml. You just cannot define a component this way. As Pete was saying, if we did allow components to be defined in components.xml, it would need to be a separate components.xml that resides on the hot deployable classpath (not a bad idea actually).

If you have a hot deployable component defined as follows:

@Name("myComponent")
public class MyComponent {
  private String propA;

  // getters and setters as needed
}

You can configure the initial value of the property named propA in components.xml using the following declaration:

<component name="myComponent">
  <property name="propA">initial value</property>
</component>

What you cannot do is the following:

<component name="myComponent" class="MyComponent">
    <property name="propA">initial value</property>
</component>

The second XML stanza is a component definition (it has both name and class) and Seam cannot *see* into the hot deployment classloader in order to fulfill it.

Detailed coverage of this topic can be found in chapters 4 and 5 of Seam in Action.