JBoss Community

Re: Unwanted deployments after migrating EJB3 app from JBoss 4.2.3 to 5.1.0

created by Csaba Toth in EJB3 - View the full discussion

Sure. The KeyManagerService is annotated, but it's not the implementation, it is the interface class. Here is KeyManagerService.java, it is in the keyserver-ejb-1.0.0.jar

 

package org.hiplab.simgap.ejb.service;

 

import javax.ejb.Remote;

 

import org.hiplab.simgap.ApplicationException;
import org.hiplab.simgap.model.Key;

 

@Remote
public interface KeyManagerService
{
    public Key addKey(String sessionKey) throws ApplicationException;
   
    public void deleteKey(String sessionKey, Long keyId) throws ApplicationException;
   
    public Key getKey(String sessionKey, Long keyId) throws ApplicationException;
}

 

Is it a problem, if the implementation class (KeyManagerServiceBean.java) is also contained in the ejb-jar?

 

package org.hiplab.simgap.ejb.service;

 

import javax.ejb.Stateless;
import javax.interceptor.Interceptors;

 

import org.hiplab.simgap.ApplicationException;
import org.hiplab.simgap.context.Context;
import org.hiplab.simgap.ejb.BaseSpringInjectableBean;
import org.hiplab.simgap.ejb.SpringInjectionInterceptor;
import org.hiplab.simgap.model.Key;

 

@Stateless(name="KeyManagerService")
@Interceptors ({SpringInjectionInterceptor.class})
public class KeyManagerServiceBean extends BaseSpringInjectableBean implements KeyManagerService
{
    private static final long serialVersionUID = -9052466924525425485L;

 

    public Key addKey(String sessionKey) throws ApplicationException {
        log.trace("In addKey method.");
        Context.authenticate(sessionKey);
        org.hiplab.simgap.service.KeyManagerService keyService = Context.getKeyManagerService();
        return keyService.addKey();
    }
   
    public void deleteKey(String sessionKey, Long keyId) throws ApplicationException {
        log.trace("In deleteKey method.");
        Context.authenticate(sessionKey);
        org.hiplab.simgap.service.KeyManagerService keyService = Context.getKeyManagerService();
        keyService.deleteKey(keyId);
    }
   
    public Key getKey(String sessionKey, Long keyId) throws ApplicationException {
        log.trace("In getKey method.");
        Context.authenticate(sessionKey);
        org.hiplab.simgap.service.KeyManagerService keyService = Context.getKeyManagerService();
        return keyService.getKey(keyId);
    }
}

 

Or do you see any unusual thing?

Reply to this message by going to Community

Start a new discussion in EJB3 at Community