2017-01-03 11 views
0

私は、EJBリモートプロキシを取得するためにJBoss 4.2.3アプリケーションサーバーに接続するApache Camel Springプロセスを持っています。 は、以下のXML設定ファイルの抜粋です:SpringプロセスでEJB JNDIエンドポイントを探す際のエラーを解決する方法はありますか?

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory 
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces 
java.naming.provider.url=http://10.10.0.240:1100 

しかし、私は次のエラーときを受け付けております:私は含まれていクラスパスにjndi.propertiesファイルを、持っている

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:jee="http://www.springframework.org/schema/jee" 
     xmlns:camel="http://camel.apache.org/schema/spring" 
     xsi:schemaLocation="http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans.xsd 
     http://www.springframework.org/schema/jee 
     http://www.springframework.org/schema/jee/spring-jee.xsd 
     http://camel.apache.org/schema/spring 
     http://camel.apache.org/schema/spring/camel-spring.xsd" 
     default-lazy-init="true"> 

    <!-- ================================ --> 
    <!-- EJB Components --> 
    <!-- ================================ --> 

    <jee:remote-slsb id="brokingReferenceService" 
        jndi-name="BrokingReferenceServiceBean/remote" 
        business-interface="com.company.command.ejb.BrokingReferenceService"/> 

    <jee:remote-slsb id="strategyReferenceService" 
        jndi-name="StrategyReferenceServiceBean/remote" 
        business-interface="com.company.command.ejb.StrategyReferenceService"/> 

    <jee:remote-slsb id="instantMessageOrderService" 
        jndi-name="InstantMessageOrderServiceBean/remote" 
        business-interface="com.company.command.ejb.InstantMessageOrderService"/> 
    ... 
</beans> 

次プロセスはJNDIエンドポイントを検索しようとします:

2017-01-03 09:15:07.057 DEBUG (org.springframework.jndi.JndiTemplate) Looking up JNDI object with name [java:comp/env/BrokingReferenceServiceBean/remote] 
2017-01-03 09:15:09.322 DEBUG (org.jnp.interfaces.NamingContext) Failed to connect to http:1099 
javax.naming.CommunicationException: Failed to connect to server http:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server http:1099 [Root exception is java.net.UnknownHostException: http]] 
     at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274) 
     at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533) 
     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634) 
     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) 
     at javax.naming.InitialContext.lookup(InitialContext.java:417) 
     at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) 
     at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) 
     at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) 
     at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) 
     at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) 
     at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) 
     at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.lookup(AbstractRemoteSlsbInvokerInterceptor.java:100) 
     at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.refreshHome(AbstractSlsbInvokerInterceptor.java:122) 
     at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.refreshHome(SimpleRemoteSlsbInvokerInterceptor.java:163) 
     at org.springframework.ejb.access.AbstractSlsbInvokerInterceptor.afterPropertiesSet(AbstractSlsbInvokerInterceptor.java:109) 
     ... 
Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server http:1099 [Root exception is java.net.U 
nknownHostException: http] 
     at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248) 
     ... 48 more 
Caused by: java.net.UnknownHostException: http 
     at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) 
     at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928) 
     at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323) 
     at java.net.InetAddress.getAllByName0(InetAddress.java:1276) 
     at java.net.InetAddress.getAllByName(InetAddress.java:1192) 
     at java.net.InetAddress.getAllByName(InetAddress.java:1126) 
     at java.net.InetAddress.getByName(InetAddress.java:1076) 
     at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:76) 
     at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:244) 
     ... 48 more 

URLを正しくピックアップしない理由は誰か分かりますか?私はプロパティファイルでURLを定義しましたが、URLを "http:1099"として解析しています。

ありがとうございました。

+0

が何をしようとした場合のjava.naming.provider.url = JNPを参照してください://10.10。代わりに0.240:1100? – hammerfest

答えて

1

は、それらのものをお試しください:

  • java.naming.provider.url=jnp://10.10.0.240:1100
  • java.naming.provider.url=10.10.0.240:1100

は、ドキュメントhere

+0

"jnp://10.10.0.240:1100"を使用すると、魅力的に機能しました!クラスタ化された環境では、 "jnp://10.10.0.240:1100、jnp://10.10.0.241:1100"を実行できますか? –

+0

私はそうは思わない...ドキュメントには、それについて話すセクションがあります – BrunoDM

+0

@JoseChavez、あなたの質問に合っている場合は、受け入れられてupvoteとして答えをマークすることを忘れないでください! – BrunoDM

関連する問題