Java 没有这样的字段错误:调用EJB客户端时的SASL属性

Java 没有这样的字段错误:调用EJB客户端时的SASL属性,java,jakarta-ee,jboss,ejb-3.0,Java,Jakarta Ee,Jboss,Ejb 3.0,我试图调用EJB,但得到了SASL属性:没有这样的文件错误。我还添加了SASL-jar“jboss-SASL-1.0.0.Beta1.jar”作为依赖项 这是我的代码: Properties properties = new Properties(); properties.put("endpoint.name", "client-endpoint"); properties.put("remote.connectionprovider.crea

我试图调用EJB,但得到了SASL属性:没有这样的文件错误。我还添加了SASL-jar“jboss-SASL-1.0.0.Beta1.jar”作为依赖项

这是我的代码:

        Properties properties = new Properties();

        properties.put("endpoint.name", "client-endpoint");
        properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
        properties.put("remote.connections", "default");
        properties.put("remote.connection.default.host", "localhost");
        properties.put("remote.connection.default.port", "4447");
        properties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
        properties.put("remote.connection.default.username", "user");
        properties.put("remote.connection.default.password", "pass");

        EJBClientConfiguration cc = new PropertiesBasedEJBClientConfiguration(properties);

        final ContextSelector<EJBClientContext> ejbClientContextSelector = new ConfigBasedEJBClientContextSelector(cc);

        final ContextSelector<EJBClientContext> previousSelector = EJBClientContext.setSelector(ejbClientContextSelector);              

        StatelessEJBLocator<SomeClass> locator = new StatelessEJBLocator(SomeClass.class, "app", "module", "viewType", "distinctName");               

        SecurityDomainService ejb =  org.jboss.ejb.client.EJBClient.createProxy(locator);`
Properties属性=新属性();
properties.put(“endpoint.name”、“client endpoint”);
properties.put(“remote.connectionprovider.create.options.org.xnio.options.SSL_ENABLED”,“false”);
properties.put(“remote.connections”、“default”);
properties.put(“remote.connection.default.host”、“localhost”);
properties.put(“remote.connection.default.port”,“4447”);
properties.put(“remote.connection.default.connect.options.org.xnio.options.SASL_POLICY_NOANONYMOUS”、“false”);
properties.put(“remote.connection.default.username”、“user”);
properties.put(“remote.connection.default.password”、“pass”);
EJBClientConfiguration cc=新属性basedejbclientconfiguration(属性);
最终上下文选择器ejbClientContextSelector=新的ConfigBasedEJBClientContextSelector(cc);
最终上下文选择器previousSelector=EJBClientContext.setSelector(ejbClientContextSelector);
无状态ejblocator=新的无状态ejblocator(SomeClass.class、“app”、“module”、“viewType”、“distinctName”);
SecurityDomainService ejb=org.jboss.ejb.client.EJBClient.createProxy(定位器)`
但我有一个例外:

java.lang.NoSuchFieldError:SASL_属性
org.jboss.ejb.client.PropertiesBasedEJBClientConfiguration.(PropertiesBasedEJBClientConfiguration.java:79)


有人能帮忙吗?

我发现这个错误是因为我没有使用正确的EJB客户端jar

我猜
jboss-ejb-client-1.0.16.Final.jar
引入了这个字段,当与这个jar一起使用时,它工作得很好