EJB를 조회하는 데 전용 Spring EJB 액세스 클래스를 사용하지 마십시오

Spring 프레임워크 6.0 전용 EJB 액세스가 제거되었습니다. Spring 프레임워크 5.x EJB 액세스는 다음을 사용하여 수행됩니다 LocalStatelessSessionProxyFactoryBean, SimpleRemoteStatelessSessionProxyFactoryBean, LocalSlsbInvokerInterceptorSimpleRemoteSlsbInvokerInterceptor 클래스에서 찾을 수 있습니다 org.springframework.ejb.access 발견됩니다.

이러한 클래스는 다음과 같은 Spring XML 파일에서 참조할 수 있습니다 application-config.xml.

다음은 이 사용 사례의 예입니다:

<빈 id="myEjb" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">

Java 파일에서 다음과 같이 참조할 수도 있습니다:


import org.springframework.ejb.access.*;	
@Bean
public SimpleRemoteStatelessSessionProxyFactoryBean myEjb() {
    SimpleRemoteStatelessSessionProxyFactoryBean factory = new SimpleRemoteStatelessSessionProxyFactoryBean();
}

이 규칙은 org.springframework.ejb.access 패키지의 Java .class 파일 또는 .xml 파일만. Spring 6.0 을 통해 JNDI를 직접 사용하세요 JndiObjectFactoryBean Java 파일 또는 jee:jndi-lookup 다음에서 .xml 파일만.

다음은 다음과 같은 예입니다 JndiObjectFactoryBean:


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jndi.JndiObjectFactoryBean;
import com.example.ejb.MyRemoteBean;
@Configuration
public class EjbJndiConfig {

    @Bean
    public JndiObjectFactoryBean myRemoteEjb() {
        JndiObjectFactoryBean jndiBean = new JndiObjectFactoryBean();
        jndiBean.setJndiName("java:global/myApp/MyRemoteBean!com.example.ejb.MyRemoteBean");
        jndiBean.setProxyInterface(MyRemoteBean.class);
        jndiBean.setLookupOnStartup(false);  // delay lookup if needed
        return jndiBean;
    }
}

다음은 다음과 같은 예입니다 jee-jndi-lookup:

<beans xmlns=" http://www.springframework.org/schema/beans " xmlns:jee=" http://www.springframework.org/schema/jee " xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance ".... <jee:jndi-lookup id="myEjb" jndi-name="java:global/myApp/MyRemoteBean!com.example.ejb.MyBean" proxy-interface="com.example.ejb.MyBean" /> </beans>

자세한 정보는 다음 자원을 참조하십시오.