2017-01-20 8 views
0

基本的な列挙型を引数とし、同じ列挙型を返す単純なステートレスEJBがあります。名前にCONNECTを含むenum値を送信すると、Wildfly 10.xリモートEJBクライアントがハングする

@Stateless 
@LocalBean 
public class SerialBean implements RemoteSerial { 
    @Override 
    public Whatever enumTest(Whatever type) { 
     return type; 
    } 
} 

ここでは、簡単な列挙型です:

public enum Whatever { 
    TEST, 
    CONNECT_TEST 
} 

とシンプルなクライアント:

Properties jndiProps = new Properties(); 
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); 
jndiProps.put(Context.PROVIDER_URL, "http-remoting://localhost:8080"); 
jndiProps.put("jboss.naming.client.ejb.context", true); 

try { 
    Context ctx = new InitialContext(jndiProps); 
    RemoteSerial serial = (RemoteSerial)ctx.lookup("rmi_test/rmi_ejb/SerialBean!test.RemoteSerial"); 
    System.out.println(serial.enumTest(Whatever.TEST)); 
    System.out.println(serial.enumTest(Whatever.CONNECT_TEST)); 
} catch (NamingException ex) { 
    ex.printStackTrace(); 
} 

私はこのコードを実行すると、クライアントが正常に(TESTをWildFlyに接続し、最初の結果を返しますが、 )。ただし、クライアントは2番目のメソッド呼び出し(CONNECT_TEST)を実行するときにフリーズします。応答は受信されません。

CONNECT_TESTの名前をCONNECTがないものに変更すると、コードが機能します。 CONNECTをcONNECTに変更することもできます。

私はおそらくここで起こって何ができるかjdk1.8.0_102を使用して、Windows 7上で10.0と10.1の両方でこれを試してみましたが、121

ましたか?

+0

私は、様々なプラットフォームでいくつかのテストを行ってきました。 * Linux to Win7デスクトップ(この問題が発生しているデスクトップ) * Win10デスクトップ(別のマシン)からLinux * Win10デスクトップからWin7デスクトップ パケットトレースは、Win7デスクトップが問題のあるデータをまったく送信していないことを示しています。 これはすべてJBoss 6.1でうまくいきます。デスクトップとWildFly 10のクライアントでは、明らかに奇妙なことが起こっています。 –

答えて

0

結果を再現できませんでした。比較のため、ここに私のコードがあります。

サーバー(EJBモジュールrmi_test):

TestEnum.java

package com.example.rmitest; 

public enum TestEnum { 
    TEST, CONNECT_TEST 
} 

SerialBean.java

package com.example.rmitest; 

import javax.ejb.LocalBean; 
import javax.ejb.Stateless; 

@Stateless 
@LocalBean 
public class SerialBean implements RemoteSerial { 

    @Override 
    public TestEnum enumTest(TestEnum input) { 
     return input; 
    } 

} 

RemoteSerial.java

package com.example.rmitest; 

import javax.ejb.Remote; 

@Remote 
public interface RemoteSerial { 
    TestEnum enumTest(TestEnum input); 
} 

クライアント(スタンドアロンJSEアプリ、ウィット時間wildfly-10.1.0.Final/bin/client/jboss-client.jarそれはクラスパスだ上):

Client.java

package com.example.rmitest; 

import java.util.Properties; 

import javax.naming.Context; 
import javax.naming.InitialContext; 
import javax.naming.NamingException; 

public class Client { 

    public static void main(String... args) { 
     RemoteSerial remoteSerial = lookupRemoteService(); 
     System.out.println(remoteSerial.enumTest(TestEnum.TEST)); 
     System.out.println(remoteSerial.enumTest(TestEnum.CONNECT_TEST)); 
    } 

    private static RemoteSerial lookupRemoteService() { 
     try { 
      return (RemoteSerial) jndiConnect().lookup("/rmi_ejb/SerialBean!com.example.rmitest.RemoteSerial"); 
     } catch (NamingException e) { 
      throw new RuntimeException("Failed to lookup a remote interface", e); 
     } 
    } 

    private static Context jndiConnect() { 
     try { 
      Properties properties = new Properties(); 
      properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory"); 
      properties.setProperty(Context.PROVIDER_URL, "http-remoting://localhost:8080"); 
      properties.setProperty("jboss.naming.client.ejb.context", "true"); 
      return new InitialContext(properties); 
     } catch (NamingException e) { 
      throw new RuntimeException("Failed to establish a connection", e); 
     } 
    } 

} 

そして最後に、私のコンソール出力:

TEST

CONNECT_TEST

関連する問題