JNDI “Cannot instantiate class: org.jboss.naming.remote.client.InitialContextFactory”

后端 未结 4 693
余生分开走
余生分开走 2021-01-12 13:05

I\'m using JBoss Server for EJB And I need JNDI in console app to get reference of session bean, console app code looks like this

import java.util.Properties         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-12 13:50

    You need dependency:

    
        org.jboss
        jboss-remote-naming
    
    

    https://mvnrepository.com/artifact/org.jboss/jboss-remote-naming/

    For WildFly you can use org.wildfly.naming.client.WildFlyInitialContextFactory form:

    
        org.wildfly
        wildfly-naming-client
    
    

    https://mvnrepository.com/artifact/org.wildfly/wildfly-naming-client

    You can use bom file for import:

    
        org.wildfly
        wildfly-ejb-client-bom
        pom
    
    

    https://mvnrepository.com/artifact/org.wildfly/wildfly-ejb-client-bom

提交回复
热议问题