コンテキスト #1:
私のPC上のグラスフィッシュ3.1サーバー。
サーバーにデプロイされた単純な ejb。
日食(同じPC)で:
public class App
{
public static void main(String[] args) throws Exception
{
Properties p = new Properties();
p.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
String jndiname = "java:global/simpleEjb";
Context context = new InitialContext(p);
System.out.println(daoService.sayHello());
}
}
私の pom.xml で:
<dependency>
<groupId>org.glassfish.appclient</groupId>
<artifactId>gf-client</artifactId>
<version>3.1</version>
<scope>system</scope>
<systemPath>C:\Java\glassfish3\glassfish\lib\gf-client.jar</systemPath>
</dependency>
そしてそれは働いています。
実際のコンテキスト:
Glassfish は、別のマシンの ubuntu サーバーで実行されています。
だから私のアプリで:
Properties p = new Properties();
p.setProperty("java.naming.factory.initial","com.sun.enterprise.naming.SerialInitContextFactory");
p.setProperty("org.omg.CORBA.ORBInitialHost","10.12.3.93");
p.setProperty("org.omg.CORBA.ORBInitialPort","3700");
- ローカルサーバーを実行したままにすると、ローカルサーバーで ejb が呼び出されます!!
- ローカル サーバーを停止した場合: 例外はありませんが、アプリは終了しません (10 分以上待ってもルックアップでハングします)。
また、以前の依存関係を次のように置き換えて、pom.xml を変更しようとしました。
<dependency>
<groupId>org.glassfish.appclient</groupId>
<artifactId>gf-client</artifactId>
<version>3.1</version>
<type>pom</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>com.sun</groupId>
</exclusion>
<exclusion>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
</exclusion>
</exclusions>
</dependency>
および追加:
<repositories>
<repository>
<id>EclipseLink</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
</repository>
</repositories>
しかし、同じ結果...
頭がおかしくなりそう… 何が起こっているのか理解できません。
ホストIPを変更しようとすると:
Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: 10.12.3.94; port: 3700