JDK1.4中的Ejb消耗 [英] Ejb consumption in JDK1.4

查看:137
本文介绍了JDK1.4中的Ejb消耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为使用EJB 问题的一个帖子。我在JBOSS AS 6.0上创建了一个ejb,并且使用以下代码在java客户端中使用它。

As a postlude to Consuming an EJB question. I have created an ejb on JBOSS AS 6.0 and am consuming it in a java client using the following code.

private ServiceLocator(String host, String principal, String creadentials) throws NamingException {
        Properties env = new Properties();
        env.put(Context.INITIAL_CONTEXT_FACTORY,
                "org.jnp.interfaces.NamingContextFactory");
        env.put(Context.URL_PKG_PREFIXES,
                "org.jboss.naming:org.jnp.interfaces");
        env.put(Context.PROVIDER_URL, "jnp://" + host);
        System.out.println("jnp://" + host);
        env.put(Context.SECURITY_PRINCIPAL, principal);
        env.put(Context.SECURITY_CREDENTIALS, creadentials);
        env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                "org.jboss.security.jndi.JndiLoginInitialContextFactory");
        InitialContext ct = new InitialContext(env);
        cachedStructSpeechRemote = (StructSpeechRemote) ct.lookup("eCWServicesEAR/StructSpeechService/remote-com.ecw.ejb.StructSpeechRemote");
    }

消费者使用JBoss客户端文件夹中的JBOSS-all-client.jar AS6.0。我不能使用与JDK1.4相同的代码,因为jar不兼容JDK 1.4。我也试图从JBoss AS的旧版本中获取jar文件,但是它不适用于服务器的较新发行版(
)有没有办法编写JDK版本的EJB消费者版本(也可以是供应商独立的!),并且可以在1.4到6之间的所有JDK中工作?

The consumer uses JBOSS-all-client.jar present in client folder of JBoss AS6.0. I am not able to use the same code with JDK1.4 because the jar is not JDK 1.4 compatible. I have also tried to get the jar file form the older distribution of JBoss AS but than it does not work with the newer distribution of the server:( Is there a way to write an EJB consumer which is JDK version independent (May be also vendor independent!) and can work in all JDKs ranging from 1.4 to 6?

推荐答案

在你的情况下,我会暴露EJB在JBoss上作为Web服务能够从任何jvm调用它,否则你可以尝试在这里找到更多的信息: https://issues.jboss.org/browse/EJBTHREE-1029?focusedCommentId=12371962

In your case I would expose the EJB on JBoss as a web service to be able to call it from any jvm. Otherwise you can try to find more info here: https://issues.jboss.org/browse/EJBTHREE-1029?focusedCommentId=12371962

这篇关于JDK1.4中的Ejb消耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆