[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-02 Thread blue_due
It works :)  Cheers.

Keep up the good work!



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927527#3927527

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927527


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-02 Thread [EMAIL PROTECTED]
Fixed in CVS.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927506#3927506

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927506


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-02 Thread [EMAIL PROTECTED]
Oh, you are right. It is such a stupid bug. It only detects the @Role 
annotation when the component is listed on 
org.jboss.seam.core.init.componentClasses.


I am embarrassed.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927503#3927503

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927503


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-02 Thread blue_due
I'm using both @Name and @Role as in the original example. 

I think I may have given you the wrong impression when I said:

anonymous wrote : 
  | Using the '@Name' name works fine.
  | 

I meant that I tried using the default name, i.e. I used 'test' to reference 
the component in the FooAction and JSP just to make sure that the component was 
working under the default name.





View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927497#3927497

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927497


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-02 Thread [EMAIL PROTECTED]
Are you trying to use a class with a @Role annotation, but no @Name annotation?

(That is not what your original code example showed.)

Currently, Seam does not support components with no "default role".

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927473#3927473

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927473


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-02 Thread blue_due
Sorry, should have included that in my last post.

It doesn't log the components.  Using the '@Name' name works fine.  It's as 
though the @Role annotation is being ignored.  I've checked out the latest cvs 
version of seam.

I've had a look through the seam code it looks as though the only class that 
knows about roles in components is: org.jboss.seam.init.Initialization.  It 
checks for the @Role/@Roles annotations in the compponents contained in the 
init context variable.  When I run my example the init.getComponentClasses 
returns zero components.

Later on in Initilization, there are another few lines that add components 
using a Scanner instance which does not appear to be aware of @Role/@Roles 
annotaions.  My components are picked up here.

Here is the block of code that contains the only references to the Role 
annotations that I could find.  The body of the for loop does not get run as no 
component classes are returned.  This is taken from 
org.jboss.seam.init.Initilization, line 165 onwards.


  |  //TODO: move all this stuff into Init component?
  |   for ( String className : init.getComponentClasses() )
  |   {
  |  try
  |  {
  | Class componentClass = 
Reflections.classForName(className);
  | addComponent( componentClass, context );
  | if ( componentClass.isAnnotationPresent(Role.class) )
  | {
  |   
  |Role role = componentClass.getAnnotation(Role.class);
  |ScopeType scope = Seam.getComponentRoleScope(componentClass, 
role);
  |addComponent( role.name(), scope, componentClass, context );
  | }
  | if ( componentClass.isAnnotationPresent(Roles.class) )
  | {
  |Role[] roles 
=componentClass.getAnnotation(Roles.class).value();
  |for (Role role: roles)
  |{
  |   ScopeType scope = 
Seam.getComponentRoleScope(componentClass, role);
  |   addComponent( role.name(), scope, componentClass, context 
);
  |}
  | }
  |  }
  |  catch (ClassNotFoundException cnfe)
  |  {
  | throw new IllegalArgumentException("Component class not found: 
" + className, cnfe);
  |  }
  |   }
  | 

Here is the scanner bit which appears to register components using only the 
@Name annotation.  My component classes get picked up here, but their Role 
annotations are not looked at.  This is taken from 
org.jboss.seam.init.Initilization, line 220 onwards.


  | if (isScannerEnabled)
  |   {
  |  for ( Class clazz: new Scanner().getClasses() )
  |  {
  | if ( clazz.isAnnotationPresent(Name.class) )
  | {
  |addComponent(clazz, context);
  | }
  |  }
  |   }
  | 

I think I'm either doing something wrong which is stopping my components 
appearing in init.getComponentClasses() or I've found a bug.

Relavent startup output:


  | 09:04:38,193 INFO  [Scanner] scanning: /C:/Program 
Files/jboss-4.0.4RC1/server/default/tmp/deploy/tmp25621test.ear-contents/test.jar
  | 09:04:38,240 INFO  [Component] Component: fooaction, scope: SESSION, type: 
STATELESS_SESSION_BEAN, class: uk.foo.FooAction, JNDI: test/FooAction/local
  | 09:04:38,271 INFO  [Component] Component: test, scope: SESSION, type: 
JAVA_BEAN, class: uk.foo.TestBean
  | 09:04:38,286 INFO  [Initialization] done initializing Seam
  | 

The full log:


  | 09:04:35,802 INFO  [EARDeployer] Init J2EE application: file:/C:/Program 
Files/jboss-4.0.4RC1/server/default/deploy/test.ear
  | 09:04:36,755 INFO  [Ejb3AnnotationHandler] found EJB3: ejbName=FooAction, 
class=uk.foo.FooAction, type=STATELESS
  | 09:04:36,818 FATAL [PersistenceXmlLoader] userDatabase JTA
  | 09:04:36,833 INFO  [Ejb3Deployment] EJB3 deployment time took: 140
  | 09:04:36,849 INFO  [JmxKernelAbstraction] installing MBean: 
persistence.units:ear=test.ear.ear,jar=test.jar.jar,unitName=userDatabase with 
dependencies:
  | 09:04:36,849 INFO  [JmxKernelAbstraction]   
jboss.jca:name=DefaultDS,service=ManagedConnectionFactory
  | 09:04:36,911 INFO  [ConnectionProviderFactory] Initializing connection 
provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
  | 09:04:36,927 INFO  [InjectedDataSourceConnectionProvider] Using provided 
datasource
  | 09:04:36,927 INFO  [SettingsFactory] RDBMS: HSQL Database Engine, version: 
1.8.0
  | 09:04:36,927 INFO  [SettingsFactory] JDBC driver: HSQL Database Engine 
Driver, version: 1.8.0
  | 09:04:36,927 INFO  [Dialect] Using dialect: 
org.hibernate.dialect.HSQLDialect
  | 09:04:36,943 INFO  [TransactionFactoryFactory] Using default transaction 
strategy (direct JDBC transactions)
  | 09:04:36,943 INFO  [TransactionManagerLookupFactory] instantiating 
TransactionManagerLookup: 
org.hibernate.transaction.JBossTransactionManagerLookup
  | 09:04:36,943 INF

[JBoss-user] [JBoss Seam] - Re: @Role problem

2006-03-01 Thread [EMAIL PROTECTED]
What does the startup log say? Does it actually log the component at startup?

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927283#3927283

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927283


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user