1 Reply Latest reply on May 20, 2006 5:18 AM by ramcisjboss

    EJB3NamingStrategy

    ramcisjboss

      I tried to Override the EJB3NamingStrategy but when I deployed my jar file I got error. Here is some log from JBOSS console.

      org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:197)
      Caused by: java.lang.Error: Unresolved compilation problems:
      The import org.hibernate cannot be resolved
      The import org.hibernate cannot be resolved
      EJB3NamingStrategy cannot be resolved to a type
      StringHelper cannot be resolved
      StringHelper cannot be resolved
      StringHelper cannot be resolved
      StringHelper cannot be resolved
      StringHelper cannot be resolved
      
      at de.laliluna.library.CustomNamingStrategy.(CustomNamingStrategy.
      java:6)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct


        • 1. Re: EJB3NamingStrategy
          ramcisjboss

          I ask and I answer alone.

          There is a problem with Jboss version.
          Now all works fine. here a solution

          /**
           *
           */
          package de.laliluna.library;
          import org.hibernate.cfg.EJB3NamingStrategy;
          import org.hibernate.util.StringHelper;
          
          /**
           * @author RamcisJBOSS
           *
           */
          public class NamingStrategy extends EJB3NamingStrategy {
           // The tablename is simply found by appending a "s" to the classname
           public String classToTableName(String className) {
           return StringHelper.unqualify(className) + "s";
           }
          }