seamjboss7.xseam2

Seam2.2 migration to 2.3 produce org.jboss.seam.core.init.jndiPattern or use @JndiName error


I'm currently working on migrating from Seam 2.2 to 2.3.

I'm following the guide from here: http://docs.jboss.org/seam/latest/reference/en-US/html/migration23.html and is now testing the migrated app.

Unfortunately, I'm stuck with this error:

Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName:

In my components.xml I've tried 2 approach:

  1. Use core:init:

    <core:init debug="@debug@" jndi-pattern="@seam_jndiPattern@" />
    //where seam_jndiPattern=java:app/myApp-ejb.jar/#{ejbName}
    
  2. Listing the Stateless beans:

    <component class="org.service.admin.impl.AccountService"
            jndi-name="java:app/myApp-ejb/AccountService" />
    
    @Stateless
    @Name("accountService")
    @AutoCreate
    public class AccountService{
    }
    

But both produced:

Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: accountService

But when I tried to add @JndiName annotation to the stateless session bean, the error was resolved, but I don't want to add the annotation on each class because I have hundreds of them. Any possible workaround?


Solution

  • In components.xml change core:init to

    <core:init debug="true" jndi-pattern="java:app/**your-ejb-name**/#{ejbName}" />
    

    or use @JndiPattern annotation in your beans.

    @JndiName("java/jboss:phoenix-ejb/**yourClassName**")
    

    In your case it would be

    @JndiName("java/jboss:phoenix-ejb/**AccountService**")