0

so im using the getRollBackOnly method located under EjbComponent class that implements org.jboss.logging.BasicLogger interface :

 public boolean getRollbackOnly() throws IllegalStateException {
if (isBeanManagedTransaction())
  throw EjbLogger.ROOT_LOGGER.failToCallgetRollbackOnly(); 
try {
  TransactionManager tm = getTransactionManager();
  if (tm.getTransaction() == null)
    throw EjbLogger.ROOT_LOGGER.failToCallgetRollbackOnlyOnNoneTransaction(); 
  int status = tm.getStatus();
  EjbLogger.ROOT_LOGGER.tracef("Current transaction status is %d", status); //this ligne is causing the error
  switch (status) {
    case 3:
    case 4:
      throw EjbLogger.ROOT_LOGGER.failToCallgetRollbackOnlyAfterTxcompleted();
    case 1:
    case 9:
      return true;
  } 
  return false;
} catch (SystemException se) {
  EjbLogger.ROOT_LOGGER.getTxManagerStatusFailed((Throwable)se);
  return true;
} 

EJBLogger interface target line :

public static final EjbLogger ROOT_LOGGER = (EjbLogger)Logger.getMessageLogger(EjbLogger.class, "org.jboss.as.ejb3");

the exception that i had :

   Caused by: java.lang.NoSuchMethodError: org.jboss.as.ejb3.logging.EjbLogger.tracef(Ljava/lang/String;I)V                                                                        at org.jboss.as.ejb3.component.EJBComponent.getRollbackOnly(EJBComponent.java:358)                                                                                      at org.jboss.as.ejb3.component.session.SessionBeanComponent.getRollbackOnly(SessionBeanComponent.java:100)                                                              at org.jboss.as.ejb3.context.EJBContextImpl.getRollbackOnly(EJBContextImpl.java:90)                                                                                     at org.jboss.as.ejb3.context.SessionContextImpl.getRollbackOnly(SessionContextImpl.java:133) 

does anyone know why I'm getting this error? ps:i have already jboss-logging jar

thanks .

aabc
  • 9
  • 5
  • Are you using the `EjbLogger` in your deployment? That's not meant to be used outside of the server itself. Also make sure you're not including the jboss-logging library in your deployment. – James R. Perkins May 13 '20 at 16:41
  • Hi James thanks for your quick response, actually I'm trying to deploy a multitenancy application on Jboss eap 7.1 server and, i am testing the method setRollBackOnly() under EjbLogger by using a not existing shema but it throws the error message mentioned previously wish i believe it is not the expected behavior. – aabc May 13 '20 at 23:01
  • So this is for a test case? If so maybe you've got the wrong version of jboss-logging on the class path. – James R. Perkins May 13 '20 at 23:28
  • Actually im using jboss-logging 3.1.0 GA with wildfly-ejb3-7.1.0.GA-redhat-11 ( ps: i don't have jboss-logging lib in my application ) – aabc May 13 '20 at 23:49
  • thanks , i have fixed the problem by using the latest version of this lib ( jboss-logging-3.4.1.Final) – aabc May 14 '20 at 00:08

1 Answers1

0

for whom who got the exception, i have fixed the problem by using the latest version of jboss-logging library ( jboss-logging-3.4.1.Final)

aabc
  • 9
  • 5